0% found this document useful (0 votes)
16 views6 pages

N Using Meta-Learning

This document presents a study on short-term stock price-trend prediction using a meta-learning framework that addresses the limitations of conventional machine learning models, which require large amounts of labeled data. The proposed method utilizes convolutional neural networks and a slope-detection labeling technique to classify stock trends into four categories, demonstrating improved prediction accuracy when applied to the S&P500 dataset. The meta-learning framework allows for effective training with limited data, enhancing the ability to predict stock price trends in a noisy and dynamic financial environment.

Uploaded by

zilong9000
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views6 pages

N Using Meta-Learning

This document presents a study on short-term stock price-trend prediction using a meta-learning framework that addresses the limitations of conventional machine learning models, which require large amounts of labeled data. The proposed method utilizes convolutional neural networks and a slope-detection labeling technique to classify stock trends into four categories, demonstrating improved prediction accuracy when applied to the S&P500 dataset. The meta-learning framework allows for effective training with limited data, enhancing the ability to predict stock price trends in a noisy and dynamic financial environment.

Uploaded by

zilong9000
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

2021 IEEE International Conference on Systems, Man, and Cybernetics (SMC)

17-20 October, 2021. Melbourne, Australia

Short-Term Stock Price-Trend Prediction Using Meta-Learning


Shin-Hung Chang, Cheng-Wen Hsu, Hsing-Ying Li, Wei-Sheng Zeng and Jan-Ming Ho
2021 IEEE International Conference on Systems, Man, and Cybernetics (SMC) | 978-1-6654-4207-7/21/$31.00 ©2021 IEEE | DOI: 10.1109/SMC52423.2021.9658607

relevant to stock price-trend prediction. Additionally, these


Abstract— Although conventional machine learning


algorithms have been widely adopted for stock-price conventional machine learning models are limited by their
predictions in recent years, the massive volume of specific need for massive volumes of labeled data for training.
labeled data required are not always available. In contrast,
meta-learning technology uses relatively small amounts of Stock price dataset generally include only 250 records per
training data, called fast learners. Such methods are beneficial year or 2500 records per decade, for each stock. Furthermore,
under conditions of limited data availability, which often obtain this sparse price dataset may not necessarily be representative
for trend prediction based on time-series data limited by sparse of the dataset used to train the prediction model. This lack of
information. In this study, we consider short-term stock price training data in financial trend prediction is widely
prediction using a meta-learning framework with several considered a significant challenge to the construction of well-
convolutional neural networks, including the temporal tuned models. Thus, methods must be developed to process
convolution network, fully convolutional network, and residual sparse training datasets which tend to lack examples for
neural network. We propose a sliding time horizon to label specific categories. In this study, we focus on meta-learning
stocks according to their predicted price trends, referred to as algorithms to solve this network model training problem
called slope-detection labeling, using prediction labels including using only relatively few samples.
“rise plus,” “rise,” “fall,” and “fall plus”. The effectiveness of
the proposed meta-learning framework was evaluated by The meta-learning framework requires a meta-learning
application to the S&P500. The experimental results show that network and several task learning mechanisms, which each
the inclusion of the proposed meta-learning framework classify a small number of samples [4]–[10]. The training
significantly improved both regular and balanced prediction process of the meta-learner is based on the principle of
accuracy and profitability. “learning to learn” which extends the scope of each task
learner component from which knowledge can be derived.
I. INTRODUCTION
The meta-learner is presented with a number of tasks, on
Time-ordered data have become widely available in which two functions are performed. First, information is
recent years, and numerous time series classification (TSC) rapidly acquired from each of the tasks. Second, the acquired
algorithms have been proposed. Owing to the natural information from among the various tasks is processed at the
complexity of time sequence information, some interpretation higher level.
is almost always required to accurately model such data
This study presents a novel meta-learning framework for
patterns. More specifically, for any classification problem on
stock price-trend prediction employing several classic neural
ordered time series data, some labeling consideration need to
network models, temporal convolution network (TCN) [13],
be kept in mind. The grouping of types of ordered data types
fully convolutional network (FCN) [9] [11], and residual
can be understood as a TSC problem. At present TSC
neural network (ResNet) [12]. We used a fixed time horizon,
methods are commonly employed in many practical
referred to as a slope-detection labeling method, to label
applications, including financial forecasting.
stocks into four categories according to predicted price trends,
Machine learning models trained on historical financial including “rise plus,” “rise,” “fall,” and “fall plus”.
datasets are increasingly used for stock price-trend
The effectiveness of the proposed meta-learning
predictions. Conventional time-series forecasting models are
framework was evaluated by applying it to the Standard and
generally limited to the identification of linear relationships.
Poor’s 500 Index (S&P500). The remainder of this study is
As the result they are poorly suited to financial data, which is
organized as follows. Section II summarizes the relevant
typically noisy, dynamic, and nonlinear [1]–[3]. Therefore,
literature. Section III presents our proposed meta-learning
these models may not be ideal to represent the nonlinear
framework. Section IV details the experimental setup and
relationships commonly encountered in the complex datasets
results in terms of prediction accuracy, while concluding
remarks and possible avenues for future research are given in
Shin-Hung Chang is an assistant professor in Department of Computer
Science and Information Engineering, Fu Jen Catholic University, 24205,
Section V.
New Taipei City, Taiwan. (phone:886-2-229053894; fax:886-2-29052442; II. RELATED WORKS
e-mail: shchang@[Link]).
Cheng-Wen Hsu is an undergraduate student in Department of Computer The stock market has long been an important topic in
Science and Information Engineering, Fu Jen Catholic University, 24205, finance and computation. The prediction of stock price
New Taipei City, Taiwan. (e-mail: chwnhsu@[Link]).
Hsing-Ying Li is an undergraduate student in Department of Computer trends poses unique challenges owing to the noisy data
Science and Information Engineering, Fu Jen Catholic University, 24205, associated with the stochastic nature of financial data [2].
New Taipei City, Taiwan. (e-mail:xingyingli855@[Link]). Many researchers have applied machine learning
Wei-Sheng Zeng is a research assistant in Institute of Information Science, technologies to the prediction of stock prices, and have
Academia Sinica, 115, Taipei, Taiwan. (e-mail: wilson7126@[Link]). generally found that trading volumes had little impact on
Jan-Ming Ho is a researcher in Institute of Information Science,
Academia Sinica, 115, Taipei, Taiwan. (e-mail: hoho@[Link]).
prediction performance when applied to the S&P500 and

978-1-6654-4207-7/21/$31.00 ©2021 IEEE 2900


Authorized licensed use limited to: Wenzhou University. Downloaded on November 05,2024 at 08:22:25 UTC from IEEE Xplore. Restrictions apply.
DJIA datasets [14][16]. labeled as “rise plus”. If only condition 𝛿𝑑𝑛 > 0 is satisfied,
Such methods are generally categorized into two types, the trend is labeled as “rise”. In contrast, if the closing price
including individual and universal training models. of stock n on the day d, 𝑝𝑑𝑛 , is less than (𝜇𝑑𝑛 −𝜎𝑑𝑛 ) and 𝛿𝑑𝑛 < 0,
Individual training models are trained using historical data the trend of stock n on the day d is labeled as “fall plus”. If
from only single specific stock market [18]–[20]. In contrast, only condition 𝛿𝑑𝑛 < 0 is satisfied, the trend is labeled as
universal models are trained by feature extraction from a “fall”. In our proposed labeling method, “rise plus” indicates
diverse of stock markets [23]. Regarding the former, Trafalis the end of a rising period (peak) and “fall plus” indicates the
et al. [21] employed a support vector machine (SVM) to end of a falling period (trough). Additionally, “rise” means
facilitate the prediction of prices over the short term, and price trend is in an ascending period and “fall” means price
Althelaya et al. [17] used long-term short-term memory trend is in a descending period. Table I presents the judgment
(LSTM) to predict stock prices. Zhang et al. [15] used a conditions of our proposed slope-detection labeling method.
hybrid model combining adaptive boosting (AdaBoost), a Fig. 1 presents a labeling example of the proposed slope-
genetic algorithm (GA), and a probability SVM to predict the detection method, where K was set at 3.
directions of stock price changes. However, the performance TABLE I. JUDGEMENT OF SLOPE-DETECTION LABELING METHOD
these individual models has thus far remained limited owing Trend Labeling Judgement Condition
to the short-term training data employed. Among the latter, rise plus 𝑝𝑑𝑛 > (𝜇𝑑𝑛 +σ𝑛𝑑 ) and 𝛿𝑑𝑛 > 0
Fischer et al. [22] used an LSTM with large-scale data to rise 𝛿𝑑𝑛 > 0
predict the direction of price changes, and Hoseinzade et al. fall 𝛿𝑑𝑛 < 0
[23] adjusted a universal predictor using a variety of data fall plus 𝑝𝑑𝑛 < (𝜇𝑑𝑛 −σ𝑛𝑑 ) and 𝛿𝑑𝑛 < 0
sources to extract general characteristics of various stocks
price changes.
Overall, universal models have achieved better prediction
results than individual models. Additionally, convolutional
neural models have demonstrated the ability to learn better by
extracting important features to predict market patterns by
using more highly diverse training datasets.
III. PROPOSED META-LEARNING FRAMEWORK
In this paper, we propose a novel meta-learning
framework for price trend forecasting based on financial
time-series data. In contrast to previous studies, we applied
this meta-learning framework to perform pre-training. These
pre-training parameters were then used as the initialized
parameter of the subsequent component learning models,
which may be universal or individual models. The
experimental results show that the proposed combined model Figure 1. Labeling examples using slope-detection method between
improved prediction accuracy compared with the component 2015-01-01 and 2015-12-31, where K=3.
models alone.
B. Designed Input Tensor
A. Slope-detection Labeling Method To increase profits, we selected our dataset from among
Labeling methods, Lunde [24] and Pagan [25], are often various component stocks of the S&P500, which comprises
used to identify market trends, which are not sensitive to high well-established firms in the United States. The conventional
frequency short-term stock price trends. We employed the approach employed by investors involves the observation of
proposed slope-detection method to define our stock price technical indicators based on the assumption that previous
trends, including “rise plus,” “rise,” “fall,” and “fall plus”. In trading activity can provide important indicators of future
this paper, 𝑝𝑑𝑛 represents the closing price of stock n on a trends. Accordingly, we selected the technical indicators
target day 𝑑 . 𝐹̅𝑑𝑛 = ∑𝐾 𝑛
𝑖=1 𝑝𝑑+𝑖 denotes the average closing presented in Table II, and used open-high-low-close (OHLC)
price of the stock n in the next K days after the day 𝑑 . prices as prediction features.
𝐵̅𝑑𝑛 = ∑0𝑖=−𝐾+1 𝑝𝑑+𝑖
𝑛
relatively represents the average closing
price of the stock n in the past K days, including the day 𝑑. TABLE II. TECHNICAL INDICATORS
Slope, 𝛿𝑑𝑛 , is defined as 𝐹̅𝑑𝑛 − 𝐵̅𝑑𝑛 . 𝜇𝑑𝑛 denotes the mean value Daily Price
OHLC Open-High-Low-Close Price
of the closing price and 𝜎𝑑𝑛 is defined as standard deviation of Technical indicators
the stock n during these 2K days. The variable 𝜎𝑑𝑛 was ATR Average True Range
mathematically calculated using the following expression (1). EMA20 Exponential Moving Average
MOM6 Momentum for 6 days
𝑛 𝑛 2
∑𝐾
𝑖=−𝐾+1(𝑝𝑑+𝑖 −𝜇𝑑 ) MOM12 Momentum for 12 days
𝜎𝑑𝑛 = √ (1)
MA5 Moving Average for 5 days
2𝐾
We applied σ𝑛𝑑 as the threshold to label the price trend of MA10 Moving Average for 10 days
detecting ascending (upward) or descending (downward) CCI Commodity Channel Index
period according to slope, 𝛿𝑑𝑛 . In the proposed method, if the MACD Moving Average Convergence Divergence
SMI Stochastic Momentum Index
closing price of the stock n on the day d, 𝑝𝑑𝑛 , is greater than ROC Rate of Change
(𝜇𝑑𝑛 +σ𝑛𝑑 ) and 𝛿𝑑𝑛 > 0, the trend of the stock n on the day d is WILLR Williams %R

2901
Authorized licensed use limited to: Wenzhou University. Downloaded on November 05,2024 at 08:22:25 UTC from IEEE Xplore. Restrictions apply.
of each stock 𝑖 is processed based on one-month sliding, as
presented in ② of Fig. 3.

Figure 2. Structure of designed two-dimension input tensor.

Additionally, the proposed method utilizes an input tensor


formed by combining these 11 technical indices and OHLC
prices pertaining to each stock over a period of 22 days. In
Figure 3. Proposed scenarios for meta training and meta testing.
our short-term stock trend prediction model, we apply the
selected 15 features of a stock over the previous 22 days, C. Meta-Training Algorithm
including day 𝑑 , day ( 𝑑 − 1) , day (𝑑 − 2) , …, and day
(𝑑 − 21), to predict the price trend at the day 𝑑. Therefore, The meta-training process of our meta-learning
we constructed a two-dimensional input tensor, as shown in framework is implemented in two phases. The first phase
Fig. 2. updates the parameters of each task-learner, which involves
training task-learner 𝜃𝑖 of each stock 𝑖 with support set 𝑆𝑖 .
We introduce the following notation for clarity. 𝜙 denotes The support set 𝑆𝑖 is organized by sampling 20 records in
the parameters of meta-learner, while 𝜃𝑖 indicates the each of the four labeling categories of stock 𝑖. Therefore,
parameters of each task-learner of stock 𝑖, 𝑆𝑖 represents the 40,000 records were randomly selected for 500 stocks of the
support set of stock 𝑖 for training each task-learner 𝜃𝑖 in the S&P500, as shown in Fig. 4 (a). The second phase updates
inner loop, 𝑄𝑖 represents the query set for training a meta-
the parameters of meta-learner 𝜙. After five training epochs
learner 𝜙 in the outer loop, and α and 𝛽 denote the learning
each task-learner 𝜃𝑖 , query set Q 𝑖 is input to each trained
rate used to update 𝜃𝑖 and 𝜙, respectively.
task-learner, and the summation of loss from each task-
Our meta-learning framework was trained in two phases. learner is calculated and applied to update meta-learner 𝜙, as
The first phase, meta-training, involved training the meta- shown in Fig. 4 (b). Additionally, in the first phase, we
learner 𝜙 by evaluating gradients and computing adapted applied a sampled support set to avoid training failure
parameters. The second phase, meta-testing, involved fine- caused by an unbalanced dataset, which influences the
tuning all of the task-learners 𝜃𝑖 based on pre-trained 𝜙 adaptability of the update process of the meta-learner.
trained using a training set 𝑋𝑖 . We then evaluated the task
learners using a testing dataset 𝐸𝑖 .
The overall process is illustrated in Fig. 3. Stocks in
different periods were defined as different tasks. In the meta-
training phase, data from the year leading up to the previous
month (training set) are used to train all of the tasks 𝜃𝑖 , and
then data from the previous month (testing set) are used to
evaluate 𝜃𝑖 . In the meta-testing phase, our objective was to
ensure that the task learners performed well when applied to (a) Updating a task-learner 𝜃𝑖 . (b) Updating a meta-learner, 𝜙.
Figure 4. Learning framework used to update task-learner and meta-
the testing dataset. learner.
By applying the meta-training process, we obtain a Algorithm 1: Meta-Learning algorithm for pre-training
general meta-learner 𝜙 including pre-trained parameters for Required: 𝜙: Meta learner; 𝜃𝑖 : Task learner of each stock 𝑖;
all stocks of the S&P500. In the proposed method, the 𝑆𝑖 : Support set of stock 𝑖 ; Q 𝑖 : Query set of stock 𝑖;
support set 𝑆𝑖 in one year is used to train each task-learner𝜃𝑖 α: Task learning rate; β: Meta learning rate;
of stock 𝑖 . After task learning, every query set 𝑄𝑖 in one 1. initialize 𝜙
2. initialize meta learner loss ℒ𝜙
month is used to update meta-learner 𝜙, as presented in ① of
3. 𝐟𝐨𝐫 each iteration in 𝟏𝟎𝟎 steps 𝐝𝐨 /*Outer loop*/
Fig. 3. 4. 𝐟𝐨𝐫 each stock 𝑖 with 𝑆𝑖 𝐝𝐨
5. 𝜃𝑖 ← 𝜙
Furthermore, the regular labeling of data from the 6. 𝐟𝐨𝐫 each 𝑆𝑖 in 𝟓 epochs 𝐝𝐨 /*Inner loop*/
previous period makes it possible to fine-tune the data from 7. update Task learner 𝜃𝑖 by gradient
the current period and thereby update the meta-learner with 8. 𝜃𝑖 = 𝜃𝑖 − 𝛂∇𝜃𝑖 ℒ(ℱ𝜃𝑖 )
time sliding to train the prediction capability of each task- 9. 𝐟𝐨𝐫 each 𝜃𝑖 with 𝑄𝑖 𝐝𝐨
learner 𝜃𝑖 . The proposed meta-learning model also performs 10. ℒ 𝜙 ← ℒ 𝜙 + ℒ(ℱ𝜃𝑖 )
a fine-tuning process with horizontal time sliding mechanism 11. update meta learner 𝜙 by gradient
to enable its. In one year, with a one-year training including 12. 𝜙 = 𝜙 − 𝜷𝛻𝜙 ℒ 𝜙
each stock 𝑋𝑖 , the model transfers the pre-trained meta-
The support set can be adapted to ensure that the latest
learner 𝜙 as a task-learner 𝜃𝑖 for each specific stock. This
features in each stock are used to train the model, such that
fine-tuning process of task-learner 𝜃𝑖 with the training set 𝑋𝑖
𝜃𝑖 fits each stock i. 𝜃𝑖 is updated via the gradient calculated

2902
Authorized licensed use limited to: Wenzhou University. Downloaded on November 05,2024 at 08:22:25 UTC from IEEE Xplore. Restrictions apply.
using the following loss function (2). Universal Model
of all stocks of all stocks of all stocks
at month t+2
at month t at month t+1

𝜃𝑖 = 𝜃𝑖 − 𝛂∇𝜃𝑖 ℒ(ℱ𝜃𝑖 ) (2) Update Update


Meta
While training the task-learner, the number of epochs Learner Task Learner Task Learner Task Learner

was usually kept low to prevent overfitting. Based on the


Figure 6. Meta-testing with universal task-learner.
approach adopted to learn overall stock trends, the meta-
learner is updated in accordance with the loss summary for Algorithm 3: Universal fine tuning model algorithm
every stock in the query set, as shown in (3) below. Required: 𝑋𝑖 : Training set of stock 𝑖; 𝐸𝑖 : Testing set of stock 𝑖;
𝜙: Pre-trained meta-learner from Algorithm 1;
ℒ 𝜙 ← ℒ 𝜙 + ℒ(ℱ𝜃𝑖 ) (3) 𝜃: Universal Task learner for all stocks;
The difference between prediction and fine-tuning is that γ: fine trning learning rate;
in the former, the query set does not update the meta-learner, 1. 𝜃 ← 𝜙
2. 𝐟𝐨𝐫 each year with one month sliding 𝐝𝐨
rather, it only predicts the stock price trends. In formulating 3. 𝐟𝐨𝐫 each 𝑋𝑖 in each 𝟓𝟎 epochs 𝐝𝐨
predictions for each subsequent period, we adaptively 4. update task learner 𝜃 by gradient
transform previous features of the meta-learner to be 5. 𝜃 ← 𝜃 − 𝛾𝛻𝜃 ℒ(ℱ𝜃 )
appropriate to the next time step as follows (4). 6. 𝐟𝐨𝐫 each stock 𝑖 with 𝐸𝑖 𝐝𝐨
7. Output prediction results from universal Task learner 𝜃
𝜙 = 𝜙 − 𝜷𝛻𝜙 ℒ 𝜙 (4)
In preparing to predict stocks in real time, we do not set IV. EXPERIMENTAL RESULTS AND ANALYSIS
the initial θ randomly, but rather pre-train it using prior A. Analysis of Proposed Labeling Method
knowledge. The pre-training is based on the assumption that
patterns closer to the target period may be expected to be 1) Two-level vs. Four-level labels
more similar to data in the target period. Thus, our proposed Most priors works have labeled price predictions as in a
method initially pre-trains the model and then continues binary fashion as trend-up (rise) and trend-down (fall).
fine-tuning it for every period up to the present. The overall However, in most investment situations, the two types of
process is described in Algorithm 1. markers are often relatively weak indicators of the ground
D. Meta-Testing Algorithm for Fine Tuning truth signals, and incorrect predictions are often obtained for
values between small rises and small declines. Therefore, in
Two types of proposed meta-testing models are this study, we hope that the proposed trend prediction model
presented in this study, including individual and universal may achieve a high degree of investment credibility in
modes. In the individual model, the pre-trained meta-learner making predictions. Therefore, we label stock price-trend
𝜙 is transferred to each task-learner 𝜃𝑖 , (as shown in Fig. 5). predictions using four categories, including rise plus, rise,
Pseudocode representing the steps of this individual model is fall, and fall plus. The major goal of the four labeling
presented in Algorithm 2. The following fine-tuning process categories is to predict the trend of a given stock, which is
is applied with each specific training set 𝑋𝑖𝑡 at one month 𝑡. indeed a rising trend or falling trend.
Individual Model
of stock N
at day t
of stock 2
of stock N
at day
of stock 2t
of stock N
at day
of stock 2 t
2) Threshold σ of Slope-detection Method
at day
of stock 1 t at day
of stock 1 t at day
of stock 1 t In this study, we use the standard deviation σ𝑛𝑑 of the
at month t
··· at month t+1
Update
···
at month t+2
Update
··· closing prices of stock n from the past K days to the next K
Task Learner Task Learner Task Learner days as the threshold on the target day d. To observe the
Meta
Update Update
Task Learner
effectiveness of labeling the price trend in individual stocks,
Task Learner Task Learner
Learner
we compare the stock price 𝑝𝑑𝑛 of stock n on the day d with
···
···

Update Update
···

Task Learner Task Learner Task Learner the this designed threshold σ𝑛𝑑 .
Figure 5. Meta-testing with individual task-learner.

Algorithm 2: Individual fine tuning model algorithm


Required: 𝑋𝑖 : Training set of stock 𝑖; 𝐸𝑖 : Testing set of stock 𝑖;
𝜙: Pre-trained meta-learner from Algorithm 1;
𝜃𝑖 : Task learner of stock 𝑖;
γ: fine trning learning rate;
1. 𝜃𝑖 ← 𝜙
2. 𝐟𝐨𝐫 each year with one month sliding 𝐝𝐨
3. 𝐟𝐨𝐫 each 𝑋𝑖 in each 5𝟎 epochs 𝐝𝐨
4. update task learner 𝜃𝑖 by gradient
5. 𝜃𝑖 ← 𝜃𝑖 − 𝛾𝛻𝜃𝑖 ℒ(ℱ𝜃𝑖 )
6. 𝐟𝐨𝐫 each stock 𝑖 with 𝐸𝑖 𝐝𝐨
7. Output prediction result from Task learner 𝜃𝑖

In contrast, in the universal mode, the pre-trained meta-


𝜎𝑑𝑛
learner 𝜙 is transferred only to a single task learner 𝜃. All Figure 7. Box plot of 𝑛 from year 2015 to year 2020.
𝜇𝑑
the training sets 𝑋 𝑡 are applied to fine-tune this task-learner
𝜃, as shown in Fig. 6. The process of this universal model is In Fig. 7, taking the S&P500 index as an example, we
presented in detail in Algorithm 3. observe that for more unstable market trends, the distribution

2903
Authorized licensed use limited to: Wenzhou University. Downloaded on November 05,2024 at 08:22:25 UTC from IEEE Xplore. Restrictions apply.
𝜎𝑑𝑛 10 percent. Additionally, models applying a meta-learning
of 𝑛 was more dispersed, especially during the China-US
𝑝𝑑 framework showed better performance in terms of prediction
trade war of 2018 and the COVID-19 pandemic of 2020. accuracy, balance accuracy, and weighted F1-score. ResNet
Therefore, our proposed slope-detection labeling method can with a meta-learning framework achieved the best “rise”
indeed provide a clearer reflection of stock market trends. prediction accuracy. For comparison, we evaluated the
Furthermore, the experimental results demonstrate that our models’ ability to distinguish between “rise” and “fall” by
proposed labeling method was able to effectively tolerate merging the labels “rise plus” and “rise” into “rise", and the
drastic market changes. labels “fall plus” and “fall” into “fall”. Table VI shows the
B. Parameter Settings of Experiments accuracy of only using these two levels of labels, “rise” and
In our proposed meta-learning framework, we “fall”. The best results were achieved by applying the meta-
incorporated three different classical neural networks, include learning framework with the universal model.
a fully convolutional network (FCN), a residual neural
TABLE V. PREDICTION ACCURACY WITH FOUR-LEVEL LABELS.
network (ResNet), and a temporal convolutional network
Regular Balance Weighted “rise”
(TCN). In addition, individual and universal models were Models
Accuracy Accuracy F1-Score Precision
implemented in our meta-testing process. Abbreviations for Ind-FCN 45.19 % 26.03 % 39.54 % 48.14 %
these model combinations are presented in Table III. Meta-Ind-FCN 48.59 % 28.29 % 44.29 % 51.30 %
Ind-ResNet 41.44 % 25.98 % 38.57 % 47.73 %
Table IV presents the hyperparameters used in our Meta-Ind-ResNet 45.68 % 26.65 % 41.43 % 48.91 %
experiments. All our learning models used the “Adam” Ind-TCN 36.76 % 28.73 % 39.45 % 56.53 %
optimizer and the “CosineAnnealingLR” scheduling module Meta-Ind-TCN 37.04 % 47.71 % 39.14 % 62.88 %
in the training process. In the meta-training phase, we Uni-FCN 59.82 % 40.30 % 57.37 % 63.87 %
adjusted the task-learner for five epochs, and after every five Meta-Uni-FCN 59.33 % 40.32 % 57.02 % 63.92 %
adjustments, we adjusted the meta-learner once, and this Uni-ResNet 59.82 % 40.30 % 57.36 % 64.09 %
Meta-Uni-ResNet 60.09 % 39.97 % 57.50 % 64.22 %
training process was executed for a total of 100 generations. Uni-TCN 62.06 % 36.94 % 57.31 % 64.70 %
In the meta-testing phase, we adjusted the individual model Meta-Uni-TCN 62.14 % 37.73 % 57.81 % 65.06 %
and the universal model in 50 generations, and then selected
TABLE VI. PREDICTION ACCURACY WITH TWO- LEVEL LABELS.
the model hyper-parameters in the last generation.
Regular Balance Weighted
Models
TABLE III. MODEL ABBREVIATIONS. Accuracy Accuracy F1-Score
Models NNs Learning Architectures Ind-FCN 54.38 % 52.01 % 51.37 %
Ind-NNs Individual + NNs Meta-Ind-FCN 58.79 % 57.52 % 58.01 %
FCN Ind-ResNet 52.92 % 51.52 % 51.97 %
Uni-NNs Universal + NNs
ResNet Meta-Ind-ResNet 54.97 % 53.37 % 53.65 %
Meta Ind-NNs Meta learning + individual + NNs
TCN
Meta Uni-NNs Meta learning + universal + NNs Ind-TCN 60.21 % 58.93 % 59.47 %
Meta-Ind-TCN 72.95 % 73.29 % 73.01 %
TABLE IV. PARAMETER SETTINGS. Uni-FCN 76.31 % 75.85 % 76.24 %
Learning Parameter Value settings Meta-Uni-FCN 75.98 % 75.64 % 75.95 %
α, β, γ 1 × 10−4 Uni-ResNet 76.33 % 75.94 % 76.28 %
Steps updating 𝜙 in Meta-Training 100 Meta-Uni-ResNet 76.48 % 76.10 % 76.43 %
Epochs updating 𝜃 in Meta-Training 5 Uni-TCN 77.42 % 76.95 % 77.35 %
Epochs updating 𝜃 for universal model 50 Meta-Uni-TCN 77.66 % 77.25 % 77.60 %
Epochs updating 𝜃 for individual model 50
Epochs updating 𝜃 in Meta Testing 50
Optimizer Adam 2) Investment Profitability Analysis
Scheduler CosineAnnealingLR We also compared various models in terms of investment
profitability. Our stock trading strategy was to buy stocks
C. Experimental Results held in S&P500 when the price trend signal of the stock was
Here, we evaluate the effectiveness of our proposed meta- predicted to be “rise”. Furthermore, these purchased stocks
learning framework in two aspects. First, we present the were sold if other three signals appeared on the next
prediction accuracy of each model. Second, we address forecasting day with the price trend prediction model. In this
investment profitability based on the prediction results as an study, we use the total cumulated return to show the
investment strategy from 2015-01-01 to 2020-12-31. investment profitability according to the prediction signal of
1) Performance Metrics different models and the proposed stock trading strategy.
Additionally, we evenly distribute the funds (Equally
We address the stock trend prediction problem as a four- Weighted Portfolio) to each stock that is predicted to have a
fold classification problem. The four labels used include signal of “rise”. The value of our assets is calculated as the
“rise plus,” “rise,” “fall,” and “fall plus”. To avoid unfair sum of the value of all stocks held which is calculated by
experimental comparisons due to uneven labeling data, we multiplying number of each stock and the stock price on that
applied regular accuracy, balance accuracy, and weighted day. In assessing profitability, we compared the cumulative
F1-score to comprehensively evaluate the performance of return of different models from 2015-01-01 to 2020-12-31.
our proposed models. As presented in Fig. 8, the investment profitability of models
Table V shows that the accuracy of the universal models applying meta-learning frameworks with individual tuning
was better than that of the individual models by more than model achieved better performance than those of the

2904
Authorized licensed use limited to: Wenzhou University. Downloaded on November 05,2024 at 08:22:25 UTC from IEEE Xplore. Restrictions apply.
conventional models. In addition, we have observed that [5] Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and Pieter Abbeel, “A
when applying a meta-learning framework with universal simple neural attentive meta-learner,” in Proceedings of 6th
International Conference on Learning Representations (ICLR), 2018.
fine tuning models, profitability cannot be significantly [6] Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra,
improved. Different degrees of profit improvement are and Timothy Lillicrap, “Meta-learning with memory-augmented
caused by the accuracy of the meta-learning framework for neural networks,” in Proceedings of International Conference on
trend prediction. Machine Learning (ICML), pp.1842–1850 2016.
[7] Chelsea Finn, Pieter Abbeel, and Sergey Levine, “Model-agnostic
meta-learning for fast adaptation of deep networks,” in Proceedings of
the 34th International Conference on Machine Learning (ICML),
Sydney, PMLR 70, 2017.
[8] Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Koray
Kavukcuoglu, and Daan Wierstra, “Matching net-works for one shot
learning,” Advances in Neural Information Processing Systems, vol.
29, pp.3630–3638, 2016.
[9] Koch, Gregory, “Siamese neural networks for one-shot image
recognition,” in Proceedings of ICML Deep Learning Workshop, 2015.
[10] Antreas Antoniou, Harrison Edwards, and Amos Storkey, “How to
train your MAML,” in Proceedings of the International Conference
on Learning Representations (ICLR), 2019.
[11] Long J, Shelhamer E, and Darrell T, “Fully convolutional networks
for semantic segmentation,” in Proceedings of IEEE International
conference on computer vision and pattern recognition,” pp.3431-
3440, 2015.
Figure 8. Cumulated return from 2015-01-01 to 2020-12-31. [12] Ismail Fawaz Hassan, Forestier G,Weber J, and Idoumghar L,Muller
PA, “Data augmentation using synthetic data for time series
V. CONCLUSION classification with deep residual networks,” in Proceedings of
International Workshop on advanced analytics and learning on
In this study, we have applied meta-learning to solve the temporal data, 2018.
time-series prediction problem for short-term stock price [13] S Bai, JZ Kolter, and V Koltun, “An empirical evaluation of generic
trends. We have proposed a novel slope-detection labeling convolutional and recurrent networks for sequence modeling,” arXiv
method to divide the data into four categories, including preprint arXiv:1803.01271, 2018.
[14] Qiu, M., and Song, Y, “Predicting the direction of stock market index
“rise plus,” “rise,” “fall,” and “fall plus,” which movement using an optimized artificial neural network model,” PLoS
demonstrated the ability to be more representative of stock one Journal, 11(5), 2016.
market trends. We experimentally compared the [15] L. Zhang, C. Aggarwal, and G.-J. Qi, “Stock price prediction via
discovering multi-frequency trading patterns,” in Proceedings of 23rd
effectiveness of different models on the basis of prediction
ACM SIGKDD International Conference on Knowledge Discovery
accuracy and investment profitability. In terms of prediction and Data Mining, pp.2141–2149, 2017.
accuracy, we focused on regular accuracy, balance accuracy, [16] W. Nuij, V. Milea, F. Hogenboom, F. Frasincar, and U. Kaymak, “An
and weighted F1-scores. Our proposed meta-learning automated framework for incorporating news into stock trading
strategies,” IEEE Transactions on Knowledge and Data Engineering,
framework not only achieved higher accuracy than 2(11): pp.823–835, 2014.
conventional methods, but also improves on their accuracy [17] K. A. Althelaya, E. M. El-Alfy and S. Mohammed,”Evaluation of
in avoiding the prediction of opposite trends. In terms of bidirectional LSTM for short-and long-term stock market prediction,”
investment profitability, the Meta-Ind-TCN model was in Proceedings of 9th International Conference on Information and
Communication Systems (ICICS), pp. 151- 156, Irbid, 2018.
superior to the other models. Meta-Ind-TCN model could be [18] Xiao Dan Zhang, Ang Li, and Ran Pan, “Stock Trend Prediction:
trained satisfactorily to achieve greater than 70% accuracy Based on a New Status Method and AdaBoost Probability Support
with two-level labels. Furthermore, the cumulated return of Vector Machine,” Applied Soft Computing, vol. 49, pp.385-398, 2018.
using Meta-Ind-TCN model was able to grow more than 1.8 [19] Jingyi Shen and M. Omair Shafiq, “Short-term stock market price
trend prediction using a comprehensive deep learning system,”
times the original investment amount. Thus, our proposed Journal of Big Data, Article number: 66, 2020.
method demonstrated a significant improvement. In our [20] Xiao Teng, Tuo Wang, Xiang Zhang, Long Lan, Zhigang Luo,
future work, we will seek to improve forecast accuracy and “Enhancing Stock Price Trend Financial via a Time Sensitive Data
Augmentation Method,” Complexity, Article ID 6737951, 2020.
profit performance further by considering other features, [21] Trafalis, T “Short Term Forecasting with Support Vector Machines
such as other technical indices and financial news. and Application to Stock Price Prediction,” in Proceedings of
REFERENCES International Journal of General Systems, 37(6), pp.677-687, 2008.
[1] I. F. Hassan, G. Forestier, J. Weber, L. Idoumghar, and P. A. Muller, [22] Fischer, Thomas, and Christopher Krauss. "Deep learning with long
“Deep learning for time series classification: a review,” Data Mining short-term memory networks for financial market predictions,”
and Knowledge Discovery, vol. 33(4), pp. 917–963, Jul. 2019. European Journal of Operational Research, 270.2: 654-669, 2018.
[2] Chauvet, Marcelle, and Simon Potter, “Coincident and leading [23] Hoseinzade, Ehsan, Saman Haratizadeh, and Arash Khoeini. “U-
indicators of the stock market,” Journal of Empirical Finance, 7.1, cnnpred: A universal cnn-based predictor for stock markets,” arXiv
pp.87-111, 2000. preprint arXiv:1911.12540, 2019.
[3] Yi Cao, Yuhua Li, Sonya Coleman, Ammar Belatreche, and Thomas [24] Lunde, Asger, and Allan Timmermann, “Duration dependence in
Martin McGinnity, “Adaptive hidden Markov model with anomaly stock prices: An analysis of bull and bear markets,” Journal of
states for price manipulation detection,” IEEE Transactions on Neural Business \& Economic Statistics, 22.3, pp.253-273, 2004.
Networks and Learning Systems, 26 (2), pp.318-330, 2015. [25] Pagan, Adrian R., and Kirill A. Sossounov, “A simple framework for
[4] Tsendsuren Munkhdalai and Hong Yu, “Meta networks,” in analysing bull and bear markets,” Journal of Applied Econometrics,
Proceedings of International Conference on Machine Learning 18.1, pp.23-46, 2003.
(ICML), pp.2554-2563, 2017.

2905
Authorized licensed use limited to: Wenzhou University. Downloaded on November 05,2024 at 08:22:25 UTC from IEEE Xplore. Restrictions apply.

Common questions

Powered by AI

Meta-learning enhances feature adaptability through a sliding mechanism in training and fine-tuning processes. By continually updating the meta-learner with new data and adjusting task-learners based on shifted periods, the framework allows models to quickly adapt previous features to align with new data patterns, improving prediction outcomes and relevancy over time .

Meta-learning frameworks improve investment profitability as they enhance prediction accuracy, allowing more precise buy and sell decisions in stock trading, thus achieving better returns. For instance, the Meta-Ind-TCN model demonstrated superior profitability, achieving a cumulated return that was 1.8 times greater than the original investment by effectively utilizing the improved accuracy from the meta-learning framework for trend prediction .

The novel slope-detection labeling method enhances stock market trend prediction by dividing data into four categories: “rise plus,” “rise,” “fall,” and “fall plus,” instead of the traditional binary labels. This method captures more nuanced market movements, allowing the model to better represent stock market trends and potentially improve prediction accuracy and profitability .

The individual model transfers the pre-trained meta-learner to each task-learner specific to each stock, allowing for targeted fine-tuning based on individual stock data. In contrast, the universal model applies the pre-trained meta-learner to a single task-learner, with all training sets used to fine-tune this task-learner, aiming for a generalized approach applicable to any stock. This distinction allows the individual model to be more specialized, while the universal model strives for broader applicability .

The use of four-level labels, such as “rise plus” and “fall plus,” enhances the model's prediction accuracy by providing a more granular representation of market conditions, reducing the chances of misclassification between subtle rises and falls. This method improves the model's ability to differentiate between varying magnitudes of trend movements, resulting in higher prediction accuracy .

A two-dimensional input tensor is used in the model to integrate 11 technical indices and OHLC prices over 22 days for each stock, forming a comprehensive view of past trends to predict future stock movements. This structured integration of data allows for efficient processing and model training, enhancing the prediction accuracy by considering a wide range of input parameters in the analysis .

During the meta-training phase, the query set is used to evaluate the trained task-learners. The summation of the loss from each task-learner when the query set is input is calculated and applied to update the meta-learner's parameters. This process ensures the meta-learner adapts effectively based on real data outcomes .

The framework supports real-time predictions by pre-training the initial parameters of each task-learner based on prior knowledge, assuming similar patterns will recur close to the target period. This pre-training leverages historical data patterns, ensuring task-learners are immediately more effective when adapting to real-time data, thus optimizing prediction outcomes continuously .

To prevent overfitting during task-learner training, the meta-learning framework keeps the number of epochs low. This strategy limits excessive adjustments of the task-learner’s parameters to the training data, which helps maintain generalization ability and avoids fitting noise or specific patterns irrelevant to new data .

The meta-learning framework addresses dataset imbalance by applying a sampled support set in the first phase of the meta-training process to avoid training failure. The support set is organized by sampling an equal number of records in each labeling category to ensure balanced data input. This approach influences the adaptability of the update process of the meta-learner, improving the model's capability to generalize to imbalanced datasets .

You might also like