Dynamic Advisor-Based Ensemble (dynABE): Case study in stock trend prediction of critical metal companies

Stock trend prediction is a challenging task due to the market’s noise, and machine learning techniques have recently been successful in coping with this challenge. In this research, we create a novel framework for stock prediction, Dynamic Advisor-Based Ensemble (dynABE). dynABE explores domain-specific areas based on the companies of interest, diversifies the feature set by creating different “advisors” that each handles a different area, follows an effective model ensemble procedure for each advisor, and combines the advisors together in a second-level ensemble through an online update strategy we developed. dynABE is able to adapt to price pattern changes of the market during the active trading period robustly, without needing to retrain the entire model. We test dynABE on three cobalt-related companies, and it achieves the best-case misclassification error of 31.12% and an annualized absolute return of 359.55% with zero maximum drawdown. dynABE also consistently outperforms the baseline models of support vector machine, neural network, and random forest in all case studies.


Introduction
Acquirement of resources has been a continual interest in human history.Among the numerous resources human utilizes, metal is especially crucial, constituting the foundation of almost all technological innovations, from bronze weapons to steam engines.Over the past century, the total demand for metals grew at an unprecedented rate, with the demand in the United States alone increasing 20-fold from around 160 million to 3.3 billion tons [1].Moreover, the demand for metals in technology has been shifting from several major metals, such as iron and copper, to numerous minor metals, such as cobalt and indium, for specialized uses.For example, modern photovoltaic cells require a wide range of minor metals such as indium and germanium [2].Many minor metals do not constitute their own ores but exist in low concentrations in ores of other common metals, such as copper or aluminum [3].Therefore, for these minor metals, their high susceptibility to supply instability coupled with their industrial importance has led to them being termed as "critical metals" [3].The criticality of these highly demanded minor metals raises concerns about their potential future shortage.As a result, there has been a growing investment interest in critical metals, both in the metals themselves and in their producing companies [4].Our research caters to this investment need by developing a specialized stock prediction model, i.e. a model which focuses on one specific group of companies instead of serving as a universal predictor for all companies on the market.In this work, critical metal companies are our focus.
We specifically investigate companies associated with cobalt for this metal's appealing investment values.Cobalt demand growth has been accelerated in the past century by its rising importance in technology, from jet engines in World War II to rechargeable batteries in the present [3].Currently, battery electrodes are the largest use of cobalt [5], consuming about 30% of the total production [3].It is mostly used in lithium-ion batteries found in electronics, which contain up to 60% of cobalt, and nickel-metal hybrid batteries found in electric automobiles, which contain up to 15% of cobalt [3].Metallurgy such as forming superalloys is another big use of cobalt [5].Therefore, it is not surprising that, as these high technologies continue to develop, cobalt demand is expected to grow significantly in the future-Cobalt Development Institute forecasts a 68% increase in cobalt consumption from 2015 to 2025 [6].Although substitution metals for cobalt exist, they almost always lower the product performance [3].Therefore, the high values and high demands of cobalt make it an appealing metal to investors.
We do not restrict our interest to companies that have big cobalt mines.Instead, we choose three companies as case study to each represent cobalt miners, cobalt refiners, and companies that do not directly produce cobalt but produce major host metals of cobalt.The three companies are Jinchuan Group International Resources (HKG: 2362) listed in Hong Kong Stock Exchange, Sumitomo Metal Mining (TYO: 5713) listed in Tokyo Stock Exchange, and Zijin Mining Group (HKG: 2899) listed in HKSE.We propose a novel ensemble learning framework for specialized stock prediction on a daily frequency, which we will elaborate later.It is important to point out that although we choose critical metal companies as case study in this paper, our model is not restricted to them but works for specialized stock prediction of any company.

Related Works and Proposed Approach
Stock trend prediction is a challenging objective due to the price data's high noise and seemingly random changes.Early works use financial measures such as the dividend yield and simple regression methods to estimate stock returns.For example, Fama et al. [7] use a least square regression to predict the NYSE stock portfolio stock returns, and Pesaran et al. [8] predict excess returns for S&P 500 and Dow Jones Industrial portfolio stocks using multivariate regression.
More complex models such as neural networks become more popular in the field as they explore the nonlinearity of stock data.Tsang et al.'s work [9] uses a simple 3-layer neural network to predict the stock trend of HSBC and experiments with several trading strategies to demonstrate the profitability of their method.Tsai et al.'s study [10] also uses a 3-layer neural network as the prediction model but includes multiple feature selection methods.Variations of neural networks especially suitable for time series data are investigated as well, such as Saad et al.'s comparative study using time delay, recurrent, and probabilistic neural networks [11] and Bisoi et al.'s work [12] that develops an evolutionary dynamic neural network.
In addition, support vector machine has proven to be a robust model candidate.In a certain case, a support vector machine with a hybrid feature selection method, which uses an F-score filter and supported sequential forward search, is able to yield an average accuracy of 87.3% in Lee's research [13].Moreover, with features extracted with text-mining techniques, Hagenau et al. [14] also use support vector machine to successfully predict stock prices.
While neural network and support vector machine are still popular models for predicting the stock trend, they have been outperformed by other methods in recent years.For example, Park and Shin's work [15] exploits the financial assumption that factors which impact stock prices can be themselves intercorrelated.Therefore, their work creates an interrelation network that explores both the relationship between the input and output variables and the relationship among input variables themselves.This method outperforms support vector machine and neural network in their case study.In addition, tree-based ensembles have also continuously outperformed support vector machine and neural network.Patel et al.'s research [16] compares performances of artificial neural network, support vector machine, random forest, and naïve-Bayes classifier in stock trend prediction, and random forest ends up being most accurate.
Similarly, in Ballings et al.'s comparative study [17], random forest outperforms classifiers including logistic regression, neural networks, k-nearest neighbor, and support vector machine as well as other ensemble methods including AdaBoost and Kernel Factory.Our research compensates the weaknesses of current methods.First of all, as most current methods aim to serve as universal predictors of stock prices, the selection of features is very general, such as stockprice-derived technical indicators or simply stock prices of previous days, and does not focus on specific companies at all.This unmotivated feature selection has problems when viewed from a financial standpoint.
For example, studies that use historical prices as features entirely rely on the assumption that "history repeats itself" and that price patterns in the past will reoccur in the future.However, financial theories argue against this assumption, such as the Random Walk theory proposed by Eugene Fama, which suggests that successive price changes are independent and past prices contain no information to predict the future [19].
In addition, considering technical indicators alone ignores signals related to market fundamentals.Stock prices are expected to reflect the intrinsic values, such as the cash flow, of the company [20].Studies have shown that the market often has a delayed estimate, and stock prices fail to immediately use publicly available information to reflect the future cash flow [21].Therefore, in order to determine the stocks worthy of investment, the technique of fundamental analysis evaluates the future value of a company using a variety of domain-specific information.For example, oil prices may influence the cash flow of oil producing companies, so fluctuations in oil prices might result in fluctuations in stock prices of the producers.Such domain-specific information is often ignored by many stock prediction studies because they attempt to serve as general predictors for all stocks on the market, limiting themselves to general signals only.
In Moreover, the very diversity of the models used for stock prediction in the field suggests that there is not a single model that proves to be most effective, calling for the need of ensemble-based methods that utilize the strengths of a variety of classifiers.The motivation behind ensembles is that a combination of multiple weak classifiers can still be strong, relying on each base classifier to compensate for one another's mistakes [22].Currently, most mature ensemble-based methods consider simple classifiers as weak classifiers for the sake of computational simplicity, such as random forest and XGBoost that use the simple classification and regression trees (CART) as base models.However, when dealing with stock prediction, even more complex models, such as support vector machine, should be considered as weak classifiers because there is no guarantee that they will necessarily perform well.Therefore, an effective ensemblebased approach to stock prediction should sacrifice some computational simplicity and incorporate complex models as base models as well.
Therefore, in order to address the problems described above, we propose a model framework called "Dynamic Advisor-Based Ensemble" (dynABE) for specialized stock prediction.First of all, we go beyond general indicators and exploit domain-specific features that have rich information in market fundamentals.
In our case, we explore data related to the critical metal mining industry.Then we group the features into multiple subsets called "advisors," each representing a specific factor that we believe will be influential to critical metal cmpnaies using domain knowledge.For example, financial knowledge suggests that macroeconomics, cost of mining, and the supply and demand of the metal market are three important factors that influence critical metal stock prices.Therefore, we would group the features into these three separate categories as advisors.Each advisor set undergoes an ensemble learning procedure that uses complex models as base models for creating high-level ensembles.Eventually, we develop a novel online update strategy to dynamically combine the predictions of each advisor during the validation period.In general, the process of dividing the features into advisors forces the model to consider every possible factor separately, avoiding the previously mentioned case of the model ignoring certain factors just because they appear to be less influential during the training period.After the model considers each factor, it then weighs the relative importance of them dynamically in the online update step.Additional optimizations of stabilizing predictions through bootstrap sampling and the incorporation of "decay rate" and "diversity bias" in the online update strategy add further predictive strengths and dynamic flexibility to our model.

Data Selection and Pre-processing
We start with a pool of features that we believe to have potentials to signal the trends in critical metal companies' stock prices.These features include various commodity indices; prices of chemicals used frequently in industrial productions; prices of energy resources, including crude oil, natural gas, coal, and electricity; currency exchange rates between currencies of major metal producing countries and US dollar; and an extensive record of the historical prices of metals and their storage in different warehouses around the world.The motivations behind the data selection will be discussed later.
The output data are stock prices of a cobalt-related company.The three companies we investigate are Jinchuan Group, Sumitomo Metal Mining, and Zijin Mining.We choose these three companies because they are representative of three kinds of cobalt-related companies.Jinchuan Group represents mining companies that have cobalt as their main metal product; Jinchuan Group is a leading cobalt miner globally, having an annual mining capacity of 10,000 tons that constitutes around 10% of the world production [23].
Sumitomo Metal Mining represents companies that refine cobalt as part of their business; Sumimoto Metal Mining focuses on nickel and cobalt refining and is the only electrolytic cobalt refiner in Japan [24], having produced 4,000 tons of electrolytic cobalt in 2017 [25].Last but not least, Zijin Mining Group represents companies that do not directly produce cobalt, but have host metals of cobalt as their main metal products; in this case, Zijin Mining is the second largest mined copper producer in China [26], and copper is a major host metal of cobalt.
For this research, historical data from the entire year of 2015 is used for training.Data of 2016 and the first half of 2017 is used for validation.

Feature Makeup and "Advisor Groups"
In contrast to universal stock prediction studies, we incorporate domain knowledge to motivate the data selection for specialized stock prediction.We believe that features which represent different factors have different patterns in influencing critical metal producers.Therefore, putting all these features into one model might confuse such distinct patterns.As a result, we propose the concept of "advisors."This term is an analogy that when executives make decisions, they never try to understand the implications of every single possible factor themselves.Instead, they listen to suggestions of different advisors, each an expert in his or her field, in order to consider a variety of factors.Similarly, in our model, each "advisor" specializes in one particular factor and only investigates features in that particular area.The "executive decision" is made in the final step when all the advisors are combined to generate the final prediction.For case study in critical metal producers, we look at three economic factors that influence critical metal producers, therefore creating three advisors.Dividing the features into advisors based on their categories also makes sure that each advisor has very a different and diverse feature set, an appealing feature for ensemble learning.
The first advisor is responsible for discovering the impacts of macroeconomics on stock prices of critical metals producers.Studies show that macroeconomics often influence the entire stock market [27], so we include commodity indices such as the S&P GSCI Commodity Total Return as general indicators.
Moreover, there are also indicators specific to the metal market, such as the London Metal Exchange Index (LMEX).In addition, we consider currency exchange rates as important macroeconomic features.This is because not only are they revealed to have dynamic linkages to stock prices [28], studies also show that metal prices and currency exchange rates of major metal-producing countries are sometimes correlated.As an example, it was found that Chilean Peso to US Dollars exchange rate and copper prices are highly correlated, with a correlation coefficient of 0.93 from July 7 to September 7 of 2015 [29].
The second advisor is responsible for handling data related to the cost of production for metals.
Specifically, we incorporate prices of chemicals used in industrial productions as well as prices of energy resources.Energy is especially important to the mining industry as crude oil and electricity are considered to be the main operating costs of mining [30].
The third advisor includes data specific to the metal market.The feature set of this group includes extensive price records of a variety of metals, both precious and non-precious, critical and non-critical.It also includes records of trading such as the London Metal Exchange daily turnover and storage of metals in warehouses around the world.The motivation behind including non-critical metal data is that we assume the metal market to be intercorrelated as host metal prices can often influence byproduct metal prices.
Our data selection includes as many features as possible in this step no matter how small their significance appears to be in common sense, a strategy which results in roughly 700 features in total for three advisors.This is because apparent correlations between key features and the stocks of critical metal producers have not yet been established in the field, so a large feature set avoids the danger of missing out less apparent yet potentially important features.All features undergo a feature selection process later to dramatically reduce the number of features for each advisor.In other words, we entrust the selection more to machine learning models, because no domain knowledge is significant enough to dictate the exact feature set.
As previously mentioned, dynABE works for specialized stock prediction of any company.If one wants to implement dynABE on other companies, one only needs to change the feature makeup and advisor groupings mentioned above.For example, if we use dynABE to predict the stock trend of consumer electronics companies, we can make several advisors corresponding to macroeconomics, prices of key materials in making the products, text-mined news of new product releases, and stock prices of competitor companies.There is a high degree of freedom in choosing the features and grouping them into advisors.

Data Cleaning and Preprocessing
All data is cleaned at first.Since the purpose of this research is to predict the stock trend on a daily basis, less dynamic features with more than 50% of the observation being static are omitted.Afterward, all NA values in the features are replaced with the last non-NA observation.In doing so, the difference from the last non-NA observation will be reflected in the next non-NA observation, ignoring the NA observations in between.
After the cleaning, all observations are first-differenced in order to satisfy the stationarity assumptions of regression models.This is a common approach in financial and economic studies involving the use of time series data [31].First-differencing reflects the changes in the time series data because our final goal is to predict the trend of the stock prices rather than their actual values.In addition, the first five lags of all features are used instead of lead terms, since we only use past data for future prediction.A total of five lags quintuples the number of features and can roughly capture information in the period of a week prior to the date of prediction.
Furthermore, highly correlated features within the feature set are omitted in order to reduce feature redundancies.Specifically, we make a correlation matrix and remove one feature in the pair of features whose correlation is higher than 0.95. Figure 1 shows an example correlation plot for a subset of features.
We can see that features such as different commodity indices exhibit strong pairwise correlations, so we only need to preserve one or two such indices.
Finally, before feature selection, the stock outcome is converted from continuous, first-differenced values to binary labels.Values greater than or equal to 0 are converted to 1 to represent a rise in price, and negative values are converted to 0 to represent a fall in price.

Models and Methodology
The dynABE we propose is based on principles of ensemble learning.There are two key variations we make to a conventional ensemble model.First of all, we use domain knowledge to make different feature groups, or "advisors," as described in the previous section.Each advisor has its own ensemble of base models.In addition, we dynamically combine the predictions of all the advisors in the validation phase, following an online update strategy we develop.Additional optimizations including an ensemble-based feature selection, stabilizing prediction results through sampling, and incorporation of "decay rate" and "diversity bias" in the online update strategy are also implemented.Here we give a detailed description of dynABE.We first introduce our feature selection method, followed by the descriptions of our base models and base model ensembles.Then we discuss our online update strategy and motivation, as well as some additional optimizations.Figure 2 is an overview of dynABE, and Figure 3 illustrates the specific steps for creating the models for a certain advisor's data.

Feature Selection
Our feature selection step is also an ensemble of individual feature selection methods.This type of hybrid feature selection is not uncommon in literature and proves to be effective [32].There are many ways to combine different feature selection methods such as choosing the union or intersection of different selected feature sets [10].In this research, our strategy is to combine the feature ranking of each feature selection method.Specifically, the features undergo a p-value filter to remove statistically insignificant features.
Then the filtered feature set goes through an R-squared ranking, RELIEF ranking, and Random Forest Importance ranking.We finally combine the ranking of each method with an unweighted majority vote to produce the final feature ranking.Features ranked in the top 20% are selected as final features.

p-value Filter
The p-value, based on t-test, is a common metric in regression models to evaluate the significance of each feature.In our setting, the null hypothesis is that a certain feature has no contribution to the outcome.As a result, if this feature has a low p-value, the null hypothesis can be safely rejected, thus indicating that this feature does indeed contribute to the outcome.On the other hand, a very high p-value means this feature is not very important.For our model, we perform a univariate linear regression between each initial feature and the outcome, obtain the p-value of each feature, and filter out the features with p-values greater than 0.5.While by custom, the choice of such p-value thresholds is often smaller, such as 0.01 or 0.05 [33], we want to leave some space for future feature selection.Therefore, we choose a bigger p-value threshold to make this filter more tolerant.

R 2 Ranking
The first feature ranking method after the p-value filter is the R 2 ranking.In the evaluation of regression models, a common metric is the coefficient of determination, or R 2 , which is interpreted as the proportion of the variance of output observations that can be predicted from input observations [33].Intuitively, R 2 represents the "accuracy" of a regression model while taking into consideration the variance of the dataset.
Using it as a feature ranking method, we first construct a univariate regression model between each individual feature and the outcome.Then we extract the R 2 value of each model.The higher the R 2 of a univariate regression model is, the more "significant" the corresponding feature should be to the outcome.

ReliefF Ranking
The second feature ranking method is ReliefF [34], a heuristic measure of features which is an extension of the RELIEF measure proposed by Kononenko [35].In general, RELIEF favors features whose values distinguish the most in similar observations of different classes [34].Specifically, RELIEF awards "nearest hits," the case when two most similar feature vectors belong to the same class and penalizes "nearest misses," the case when two most similar feature vectors belong to different classes [34].ReliefF optimizes RELIEF by changing certain measures, such as the distance measure between two observations, but adopts the same general idea.

Random Forest Importance Ranking
The third feature ranking method is random forest importance, based on a tree-ensemble prediction model, random forest.Random forest reduces the variance of classification or regression trees through bagging many different classification and regression trees (CART) [36].At each split, random forest randomly generates a subset of input features as candidate split features.Like most tree-based methods, random forest assigns a measure of variable importance to each feature.There are two common variable importance measures: one is defined as the mean improvement in the split-criterion for a certain feature, and the other measures the predictive strength of each feature [36].We use the latter importance measure.
Specifically, it measures the mean decrease in accuracy when the value of a certain feature is being permuted.Thus, the more significant a feature is, the more decrease in accuracy we would see when its value is being permuted.We construct a random forest classifier using all the features and rank the features based on their importance measures given by the random forest classifier.

Majority Vote to Combine Feature Rankings
As a result, after the p-value filter, we obtain three feature rankings: R 2 ranking, ReliefF ranking, and random forest importance ranking.We combine the results of these three rankings using majority vote.
Because we cannot measure the effectiveness of these rankings yet, we assume all three individual ranking methods are equally effective and do not assign any weights in the majority vote.Therefore, we adopt a simple voting strategy: for any feature, we average its ranks at the three rankings to obtain its "combined rank," and whichever feature with the highest "combined rank" would be ranked as the most important feature.
It is important to point out that this method ignores the relative degree of importance for adjacently ranked features.In other words, even if the  ℎ and  + 1 ℎ feature have a big difference in their importance measure, their difference in importance is considered to be the same as the  ℎ and  + 1 ℎ feature, which may have a much smaller difference in their importance measure.Nevertheless, since all three ranking methods have very different motivations behind their importance measures, no simple normalization strategy is able to effectively reflect the relative degree of importance.It would be a potential future optimization to come up with a more effective voting method to reflect such relative importance.

Base Models and Ensembles
With the selected feature set, we first build five base models and then combine them into three ensembles using three different ensemble methods.Unless the original paper is cited, the formulas and proofs of the models in this section are based on Hastie, Tibshirani, and Friedman's textbook, Elements of Statistical Learning [36].We also discuss the hyperparameter tuning process for each model.The five base models are introduced first, followed by descriptions of the ensemble methods.

Linear Regression
Linear regression with elastic net regularization is used as the first base model.Elastic net regularization is a weighted combination of L1 and L2 regularization.The objective function is: where , the regularization parameter, is greater than 0, and , the relative strength of L2 regularization compared to L1, is between 0 and 1.We first grid search possible values of  from 0 to 1, incrementing by 0.1 at each step.With a fixed  at each step, we then tune  and evaluate on a 10-fold cross-validation using mean squared error (MSE) to obtain the optimal  for this certain .An example plot of the tuning process for  is shown in Figure 4, and an example tuning process  when  is fixed is shown in Figure 5.For better visualization, Figure 4 increments  by 0.01 at each step instead of 0.1 that we use in actual tuning.

Logistic Regression
Logistic regression is the second base model, which is an extension of linear regression fitted on logistic functions so that the model outputs the probability for classification problems.For this research, logistic regression with two classes is considered.The logistic function in matrix form, parameterized by , is expressed as ℎ  () = 1 1+ −   .The model gives the probability of an observation resulting in class 1 or 0: The parameters, , are estimated by maximum likelihood with the addition of elastic net regularization.
Therefore, the objective function is: Because logistic regression has the same hyperparameters as linear regression,  and  are tuned through grid search in the exact same way.
Both linear regression and logistic regression are relatively simple models compared to popular ones in the field.We incorporate them as base models nevertheless for two reasons.First of all, the key assumption of ensemble learning is that the combination of weak classifiers can boost the prediction performance, so regardless of how weak linear and logistic regressions seem, as long as they are nontrivial (i.e.performs better than random guessing), they are worth to be incorporated as base models.In addition, because linear and logistic regressions are simpler than other complex base models, they are likely to make very different predictions compared to the complex models, an appealing feature which adds to the diversity of our ensemble.

Support Vector Machine
Support vector machine (SVM) is the third base model, which is based on support vector classifiers (SVC).
SVC maximizes the margin the two classes are from a separating hyperplane.Consider a feature space   ∈ ℝ  , in which all the points belong to either of the two classes,   ∈ {−1, 1}.Then a hyperplane can be defined as () =    +  0 = 0, where  is a unit vector orthogonal to the hyperplane.We use the sign of the distance from any point  to the hyperplane as the classification rule.In addition, in cases where the points are not perfectly separable by a hyperplane, we further include slack variables,  = ( 1 , … ,   ), to tolerate misclassifications of some points.There is a constraint on the degree of error tolerance: ≤ , and the larger  is, the more likely that the SVC can avoid overfitting at the cost of reducing accuracy.Therefore, as we denote the margin to be M, the optimization objective is: The margin M is maximized with a Lagrange multiplier.
In fact, in the Lagrangian expression, the solution of SVC depends only on the dot products of pairs of points (  and   ).Therefore, SVM takes advantage of this by replacing the dot product of   and   with the inner product 〈ℎ(  ), ℎ(  )〉 in the Lagrangian, where ℎ(  ) and ℎ(  ) are non-linear transformations of   and   .Therefore, SVM expands the feature space into higher dimensions.Using the kernel method [37], SVM does the operations in an implicit feature space without having to express the explicit form of ℎ(  ) and ℎ(  ).This method is computationally cheaper than explicit feature space expansions.Common kernels include linear, polynomial, and radial basis.
We choose the kernel to be radial basis, which defines 〈ℎ(  ), ℎ(  )〉 =  −| −   | .Therefore, the two important hyperparameters to tune are , otherwise known as cost, and , the coefficient in the radial basis function.We tune these two hyperparameters using grid search. is in the range of 2 0 to 2 9   incrementing exponentially by a factor of 2 each step, and  is in the range of 0 to 0.02, incrementing by 0.01 at each step.

Extreme Gradient Boosting (XGBoost)
XGBoost is the fourth base model, which is an ensemble method using classification and regression trees (CART) based on gradient boosting developed by Chen et al. [38].The basic idea of CART is to partition an  − 1 dimensional feature space into different regions  = { 1 , … ,   } based on split points on each feature.For example, in a two-dimensional feature space, one split on each feature, done in order, can produce three regions at maximum.Each region is assigned with a constant, which will be the prediction value for any observations that fall into that region.Therefore, a CART model is formulated as , where   is the constant assigned to region   , and  is the identity function.The algorithm of CART starts from an empty tree and makes one best split in the feature space each time by iterating over all possible splits.Regularization is further done on a completely grown tree (i.e. one that makes the maximum number of splits) to collapse inefficient splits, a process called "tree-pruning" which avoids overfitting.
Gradient boosting is based on an ensemble of CARTs.This is an additive training method that can be illustrated as a series of steps: Gradient boosting "greedily" reduces its error by setting the negative gradient of the ensemble's error to be the target of the next model being added.In that way, the ensemble always grows in the direction that reduces its error most effectively.XGBoost is an algorithm of gradient boosting optimized to compute extremely fast.
There is a variety of important hyperparameters to tune for XGBoost.For this research, we specifically focus on tuning 8 hyperparameters: the learning rate ("eta"), minimum sum of instance weights ("min_child_weight"), maximum depth of a tree ("max_depth"), row subsample rate ("subsample"), column subsample rate ("colsample_bytree"), L1 and L2 regularization terms on weights ("alpha" and "lambda"), and minimum loss reduction ("gamma").The learning rate measures how big of a step each boosting round should make towards reducing the error along the gradient.Minimum sum of instance weights prevents a tree from making further splits if the new region has too small a sum of instance weights, which happens when very few observations fall into that newly split region.Maximum depth of a tree controls overfitting by restricting the maximum number of splits each tree should make.Row subsample rate and column subsample rate control what percentage of observations (subsample) and features (column subsample) each tree should use-a smaller percentage creates perturbations to the data which might help the model escape local minimums of the loss function.L1 and L2 regularizations are terms imposed on leaf weights for each tree.Minimum loss reduction controls overfitting by imposing the minimum loss reduction when making a new split-splits that reduce the loss too little will not be made.Because there are so many hyperparameters, grid searching through all possible combinations is not realistic.Therefore, we adopt the random search strategy [39], which is especially useful when the relative importance of each hyperparameter is unknown in advance.We first fix the learning rate to be relatively high, 0.1 in our case, for faster tuning.Then we random search through all other hyperparameters for 400 times, each time with 500 maximum boost rounds and evaluated on a 10-fold cross-validation.After these hyperparameters are tuned, we finally reduce the learning rate to 0.05, increase the maximum number of boost rounds to 1000, and obtain the best number of boost rounds from evaluation on a 10-fold cross-validation to obtain the final XGBoost model.

Rotation Forest
Rotation forest, another ensemble method, is the final base model.Rotation forest was originally proposed by Rodríguez et al. [40] to complement existing ensemble strategies.According to the authors, popular ensemble strategies either increase base model accuracy while sacrificing base model diversity, such as boosting methods, or increase base model diversity while sacrificing base model accuracy, such as random forest [40].In contrast, rotation forest is claimed to preserve base model accuracy and diversity at the same time.
Similar to XGBoost, rotation forest also uses CART as base models.The original feature set is first randomly split into K subsets.Each subset undergoes a principal component analysis (PCA), and all principal components are kept as the new features for this subset, hence the "rotation" of features.The new rotated features obtained from each subset are combined to form a new complete feature set for base classifier D1.This process is repeated L times, each time with a different subset split and thus a different rotated feature set to train a different base classifier Di.The final prediction averaged over all base classifiers D1,…, DL.As described in the previous section, since CART makes predictions based on the cutoffs it makes on each feature, a rotated feature set can dramatically change the model.Therefore, the diversity of rotation forest is achieved through the random splits in creating feature subsets, a process which then generates different rotations.The original paper [40] validates rotation forest's base model diversity in greater details.In addition, unlike random forest which achieves diversity by showing each base model incomplete features, rotation forest keeps all the principal components in the rotation step, so theoretically the base model accuracy is not sacrificed.
We decide to include rotation forest not only for its above-mentioned feature of preserving diversity and accuracy, but also for its small number of hyperparameters to tune which possibly makes it more capable in avoiding overfitting compared to XGBoost.In fact, we only need to tune the number of classifiers in the ensemble and size of subset for rotation forest.In practice, we find that hyperparameter tuning of rotation forest does not affect its performance a lot, so we fix the number of classifiers to 10 and size of each feature subset to be 3.

Base Model Ensembles with Stacking
After all the base models are trained, we put them into an ensemble.Our ensemble method is stacking.In general, stacking puts the predictions of the base models as new features into another model to discover complex relationships between each base model prediction.Since the base models are already trained using all training data, we cannot directly use their training set predictions as inputs to the stacking model.Instead, we perform a 5-fold cross-validation where all base models are re-trained at each fold to make a crossvalidated training set prediction.This would be the meta-features for the training period.Since the base models have not seen the validation data, we directly use the base model validation predictions as metafeatures for the validation period.
We use XGBoost, logistic regression, and rotation forest as the stacking models, and each stacking model makes a prediction on the validation period, so each advisor has three different validation predictions.
We add another validation prediction for each advisor by averaging the three previous predictions and call it "averaged stacking."We deliberately make each advisor generate multiple stacking predictions because more stacking predictions, which will all undergo the online update procedure, provide the online update with more options to choose from.Figure 6 shows the training process of stacking.

Stabilizing Prediction Results through Bootstrap Aggregation (Bagging)
In an informal sensitivity test, we observe that slightly subsetting the training set changes the models and the test period predictions by a noticeable degree.In order to reduce the model variance, we try to stabilize prediction results through bootstrap aggregation.Bootstrap aggregation, or bagging, is a technique to reduce model variance by averaging prediction results [36].Assume our original training set Z has B bootstrap samples  *  ,  = 1, 2, … , , and we use each bootstrap sample to construct a classifier with its prediction result being  ̂ *  ().The final prediction after the bootstrap aggregation would be: .
For this study, we set the sample size to be 80% of the original training set and create 10 bootstrap samples.We use each sample to train the base and ensemble models.The final stacking predictions, which then pass on to online update, are the bootstrap aggregations of each sample's stacking predictions.
Figure 7 illustrates the bootstrap aggregation process.

Online Update with "Diversity Bias"
Using the methods described above, each advisor makes four predictions on the validation set.In our case, there are three advisors and each makes four validation predictions, so the advisors make a total of 12 predictions.Because different advisors already show varying accuracies in the training set, we do not want to treat each advisor's predictions equally in an unweighted majority vote.However, neither do we want to assign stationary weights to the advisors throughout the validation period.This is because we propose that there should not be one single dominating factor over the others throughout the entire validation period.
Instead, for instance, while macroeconomics may play the biggest role in influencing the stock prices for a certain period, changes in the metal market may dominate changes in the stock prices in the next period, and sometimes all three factors may be equally important.In addition, even different stacking methods can have changing predictive strengths during validation.Therefore, in order to reflect a dynamic relationship between the advisors and between different stacking methods in the same advisor, we propose an online update strategy to dynamically combine the 12 predictions of the three advisors.For easier illustrations, we term these 12 predictions as "agents" of the online update process.
In our online update strategy, the first important parameter is the update frequency.Assume that we fix the update frequency to be , where  is a number significantly smaller than the total number of days in the validation period.Then we update each agent's weight every  days based on previous performances.We do not want to assign weights purely based on performances in the update window, i.e. the most recent  days, but we determine the weights by performances in all previous days with a bias towards more recent days instead.In this way, the update process takes short-term patterns into account while keeping a "memory" of long-term patterns.Intuitively,  should be small enough to swiftly update the weights, yet it also should be large enough to allow the online update process to capture meaningful relationships between the advisors.
The second parameter, decay rate, determines the bias we have towards more recent days during update process we described above.Decay rate is a number between 0 and 1, where a decay rate of 0 is when we do not consider days prior to the update window at all, and where a decay rate of 1 is when we consider days prior to the update window as important as days in the update window.Decay rate exponentially reduces the relative importance based on how close a day is to the current update window.
The specific definition of decay rate in formula is illustrated later.
The third important parameter is called diversity bias, which encourages diverse predictions.Base model diversity is an important feature for a successful ensemble model.As a simple illustration, consider the case when there are three weak classifiers, each with a classification accuracy of 60% on the test set.
With a simple majority vote, the probability that at least two classifiers are correct can already be boosted to 64.8%, assuming an ideal case where all weak classifiers' predictions are independently distributed.For dynABE, because each advisor has completely different feature sets, they should theoretically make diverse predictions.Nevertheless, sometimes we want to further encourage model diversity.Therefore, diversity bias is a parameter added on top of the weights in the online update step.Intuitively, the diversity bias represents how much we want to award the case when one agent makes a correct prediction while other agents are wrong.In our online update step, the diversity bias is implemented as a "quality" measure of correct predictions: when an agent is correct on one day, the more the other agents make mistakes on that day, the higher the "quality" this correct prediction has.When the diversity bias is set to be high, the agent that makes "high quality" predictions often wins over the agent that makes the most amount of correct predictions.While we sacrifice some accuracy for diversity statistically, we observe that diversity bias can sometimes increase the accuracy in practice.
To summarize, the online update strategy updates the weights of majority vote for each agent based on previous performances, specifically determined by update frequency and decay rate.The additional diversity bias further adjusts the weights.In our implementation, the final weights are calculated by adding up an agent's "score," which reflects both its accuracy and diversity, and normalizing the weights to a 0 to 1 scale.Specifically, assume that we are currently in an online update window   of  days, specified by the update frequency.In this window, there are  agents in total,  = ( 1 ,  where  is the decay rate between 0 and 1.  exponentially decays the importance of the scores measured in older windows.  's new weight is finally assigned by normalizing the score to a 0 to 1 scale: The entire online update process is illustrated by the following algorithms:  In practice, we need to choose values for the update frequency and diversity bias.For the sake of simplicity, we fix the decay rate to be 0.8 but this hyperparameter can also be tuned to further boost the online update performance.

Results and Analysis
We test our method on three cobalt-related companies, namely Jinchuan Group, Sumimoto Metal Mining, and Zijin Mining.We evaluate dynABE on its classification performance of each advisor and the online updated performance with different hyperparameter values.Then we visualize the weight update histories to better understand the online update process.Afterward, we discuss an interesting observation of accuracy decay and our assumption behind its reason.Finally, we use the validation predictions of dynABE to adopt a naïve trading strategy to show the model's practical financial value.

Individual Advisor Classification Performances
We first look at each advisor's base and ensemble models' errors on validation sets.Since we use bootstrap sampling to stabilize the base models, we present the average errors over all 10 samples for the base models.
Table 2 shows the misclassification errors on the validation sets of all three companies.The best performances of each advisor for each company are highlighted in red.First of all, no single base model consistently outperforms the others in all three datasets, which justifies our decision to use an ensemble-based approach.In general, stacking proves to be a good performance booster and does a good job of improving the overall base model performance, such as reducing the error from 34.03% to 31.94% in Advisor 1 of Sumitomo after stacking.Nevertheless, stacking does not always outperform every single base model.This situation happens when only one base model is very strong while others are weak, such as Advisor 3 of Jinchuan for which the base model XGBoost outperforms all the stacking models.However, cases like this are hardly preventable because we never know in advance which base model or stacking model would perform the best.Even if stacking is not always best performing, it at least ensures that the performance will be relatively good compared to all the base models.
Among the three companies, while Jinchuan and Sumitomo's accuracies are on the same level, prediction accuracies for Zijin are noticeably worse than the other two companies.This means that our feature set is not suitable enough for companies that do not directly produce critical metals.We believe that adding more features related to Zijin's main metal business, namely gold, silver, copper, and nickel [41], will improve prediction accuracies for Zijin Mining.

Online Update Classification Performances and Analysis
Online update predictions are evaluated differently to take the initialization period into consideration.
Assume that the update frequency is  , we evaluate the online update performance by excluding its predictions of the first  days.This is because in the online update procedure, we assign equal weights to the advisors in the first  days since we have no knowledge of the advisors' relative strengths at all.
Therefore, in practice, we leave the first  days as the model's initialization period and start the prediction after the weights have been initialized.
Since decay rate is always fixed at 0.8, we only need to set the values of update frequency and diversity bias.Here we experiment with several common values for these two hyperparameters as a guideline.In general, one can set the update frequency between 3 to 10 and the diversity bias to be between 0 to 10.Here we experiment with update frequencies of 3, 5, and 10 and diversity biases of 0, 1, 10 and record the respective errors for each combination.For the sake of simplicity, we do not develop a hyperparameter tuning strategy for online update in this paper.Nevertheless, in order to aid future developments of tuning strategies, we also did an exhaustive hyperparameter grid search in addition to experiments with common values.Tables 3-5 show each company's online update misclassification errors first with common hyperparameter value combinations and, in the last row, with the grid searched optimal hyperparameter combinations.
With the exception of Zijin, whose optimal hyperparameter combination is way outside the normal range, the performances with common hyperparameter combinations do not differ significantly from the tuned performances.This shows the robustness of online update since it is still able to achieve good performances even with imperfect hyperparameter tuning.
We visualize the hyperparameter tuning process with a bubble plot.Bigger and brighter bubbles represent higher accuracies, corresponding to the legend.Figures 8-10 are the hyperparameter grid search plots for all three companies.The tuning range for Zijin Mining is bigger than that for Jinchuan and Sumitomo so the bubbles are much denser.We briefly summarize some patterns for good hyperparameter combinations observed from the figures.For Jinchuan, the patterns are the most obvious as high accuracy bubbles are usually in the upper right portion of the plot.This means that a high diversity bias combined with a big update frequency is likely to yield good results.On the other hand, low diversity bias with small update frequency, i.e. the lower left portion of the plot, should be avoided.Sumitomo is not as sensitive to different hyperparameter combinations, and as long as the diversity bias is not too high, such as between 0 and 1, accuracies are high regardless of update frequency.We later show that Sumitomo also does not benefit much from online update, so this might be why different hyperparameter combinations do not affect Sumitomo's performance dramatically.
Last but not least, Zijin's optimal hyperparameter combinations are found in a more extreme range than the other two companies, so we show a more exhaustive tuning plot.Zijin generally favors very high diversity biases, mostly above 20, coupled with relatively big update frequencies.It is not enough to establish a universal hyperparameter tuning rule from patterns we observe from only three case studies.Future work will focus on developing a hyperparameter tuning strategy using intuitions we gained from the experiments above.To summarize the performance improvements achieved by online update, we compare the stacking validation errors with the optimal online update validation errors achieved with the hyperparameter combinations found in grid search.Because one can never constantly pick the best hyperparameter combinations, this is meant to show the expected maximum performance boost from online update.One can get a sense of the average performance boost from the common value experiments instead.Table 6 shows the expected maximum performance boost from stacking to online update.As described before, even though these are expected maximum performance improvements from online update, they are not very different from average improvements achieved with common hyperparameter combinations as shown in Tables 3-5.The optimal online update outperforms all stacking predictions from three advisors for all the companies.Specifically, Jinchuan and Zijin both benefit significantly from online update.However, online update does not improve Sumitomo's best stacking predictions as much, where its best stacking error is 31.67%and the best online update error is 31.61%.This might explain why Sumitomo is less sensitive to different hyperparameter combinations during grid search in the previous experiment.
We believe that Sumitomo benefits less from online update because its Advisor 2 is significantly weaker than the other two advisors, so it cannot contribute much to compensating the other two advisors' mistakes during online update.
Overall, online update demonstrates to improve the performance by smartly combining each advisor's predictions.It also does not rely heavily on hyperparameter tuning, although developing a tuning strategy is still beneficial.

Weight Update Histories of Advisors
In order to better understand what is going on during online update, we visualize the each advisor's weight changes with each company's optimal hyperparameter combinations.Because each advisor makes four different predictions of the validation period based on four different stacking methods, and all four predictions participate in online update, we first plot the weight histories of all four agents for the three    Sumitomo has the most balanced weight update history in terms of stacking methods because different stacking method predictions from the same advisor generally follow the same update trends, and no single stacking method consistently gets bigger weights than the others.In contrast, both Jinchuan and Zijin have one stacking method, namely rotation forest stacking, that consistently gets favored with big weights over the other three.Especially for Zijin, online update seems to almost ignore the other stacking methods and exclusively consider rotation forest stackings of the three advisors.
In order to examine the weight update balance in terms of advisors, we consolidate the above plots by combining weights of different stacking methods that belong to the same advisor into one line.Figures    In terms of advisors, Jinchuan has the most balanced weight update history because none of the three advisors consistently receives bigger weights than the other two.Both Sumitomo and Zijin have poor balance.Zijin has the most severe advisor imbalance as Advisor 3 always receives the biggest weights, and Advisor 2 the smallest, throughout the validation period.In addition, consistent with previous assumptions, because Sumitomo's Advisor 2 is much weaker than the other two advisors, it receives significantly small weights throughout the validation period.
Visualizing the weight histories allow us to understand the online update process better.While it is ideal when both the stacking method balances and advisor balances are good, which means that every stacking method in every advisor contributes equally to online update, we see that online update is still effective enough to always favor high performing stacking methods or advisors in order to remedy the imbalanced performances.

Accuracy Gain and Decay over Time in Online Update
We further experiment with changing the dates of validation and observing its effect on classification accuracy.We carry out the following experiment: a dynABE model trained on the training set starts with the first day of the validation set, performs online update, and records the classification accuracy for the first day; then we add one more day and record the classification accuracy for the first two days; we repeat this process until we include all days of the validation period.Interestingly, we observe a universal pattern of a steady accuracy gain at first, sometimes followed by a steady accuracy decay after the highest accuracy is reached most obviously in Sumitomo.Here we make an educated guess for reasons behind this pattern, but this is an intriguing phenomenon worthy of formal studies in the future.The only variable in affecting the accuracy is the dates of validation.Therefore, we guess that the initial accuracy gain as the dates of validation get further into the future is a sign of the online update process gradually learning more accurate relationships between the advisors.This is because not only does our online update strategy learns short-term patterns, i.e. patterns it observes in the update window alone, it also keeps a "memory" of long-term patterns, i.e. patterns it observes from all previous days.Therefore, it is reasonable that as the validation dates get further into the future, the online update process learns a better pattern between the agents because it has seen more historical data and gained more "experience."The online update process keeps improving itself and creates the initial accuracy gain.On the other hand, we believe that the following accuracy decay in the case of Sumitomo is due to the expiration of patterns each advisor observes from its training set.We guess that stock patterns learned in the training set may gradually expire to be effective when the validation set gets too far into the future, as new patterns, previously not observed in the training set, may begin to dominate the stock trend.When this situation occurs, one should update the training set with newer data and retrain dynABE so that each advisor learns the new pattern.
This observation of accuracy gain and accuracy decay is crucial for implementing dynABE in practice.Indeed, as we show in the experiments above, deciding on the right length of the validation period can effectively improve the classification performance.A validation period too short does not give online update enough time to learn effective relationships between the advisors, yet a validation period too long risks the danger of patterns observed by each advisor expiring to be effective.

Trading Strategy Performance
Besides the evaluation of classification accuracy, we also want to show the financial value of our model intuitively.Therefore, we use the stock trend signals that dynABE generates on a naïve trading strategy.
Assume that all our assets are cash in the beginning.Every day the model receives the newest data available to it on that day and uses it to predict whether or not the stock price will rise or fall the next day.If the price is predicted to rise the next day, we use all our cash to buy shares at the closing price today.If the price is predicted to fall the next day, we sell all the shares we hold at the moment at the closing price today.We record our current asset every day as cash plus the current value of our stock shares.Then we compare the relative returns of this buy-low-sell-high strategy with the relative returns of the stock itself.In an ideal case, if the classification accuracy is high enough, even this naïve trading strategy can yield much higher returns than the stock itself.Figures 20-22 are the relative return plots of all three companies using the validation set predictions made by optimal online updates.We label the exact relative returns at the end of each line.Each company has a short weight initialization period in the beginning, represented as a flat black line, as described before.Like when showing online update improvements before, we use the optimal online update predictions for creating these trading strategies, which represent the expected optimal case.
We see that the most accurate predictions, i.e.Jinchuan, do not necessarily yield the most profitable trading strategies compared with the stock itself.This is because Jinchuan's stock price is growing rather steadily during the validation period, and our trading strategy outperforms the stock the best in terms of profits when the stock price is fluctuating up and down significantly, such as the case of Sumitomo and Zijin.Jinchuan's stock yields a relative return of 172%, ending up with 272% of the original stock price in the validation period of a year and a half.On the other hand, Jinchuan's trading strategy yields a relative return of 383%, ending up with 483% of the original investment asset.Therefore, Jinchuan's trading strategy achieves an excess return of 211%.For Sumitomo, the stock's return is 23% while the trading strategy's return is, shockingly, 500%, resulting in an excess return of 477%.For Zijin, the stock's return is 2% while the trading strategy's return is 99%, resulting in an excess return of 97%.
Our trading strategy returns are only for a rough illustration.A more sophisticated trading strategy, such as one which considers multiple stocks simultaneously, can yield higher returns.In addition, for the sake of simplicity, our trading strategy also makes assumptions that are not always possible in real life.For example, we assume that we are always able to trade at every day's closing price, which is not always the case.Stock prices may further change in practice if we actively enter the market and trade in high volumes.
One must consider these aspects if he or she wants to use the predictions of dynABE as trading signals in real life and is not guaranteed to be able to perfectly replicate these theoretical returns even if the trading signals are strictly followed.

Directions for Future Work
There are many directions that we can focus on for future improvements.First of all, since the performances of the base model are still relatively weak, we can potentially research into adding more base models that are more robust than the current ones.One particular family of models we would like to look into is variations of neural networks with multiple hidden layers, otherwise known as "deep learning."Because the degree of freedom in designing effective network structures is very high, and since the focus of this research is to provide a framework for an ensemble-based model instead of researching one single base model into great depths, we did not consider deep neural networks when designing the dynABE model.
Nevertheless, we acknowledge the potential of deep neural networks to discover latent variables and nonlinear relationship, so the incorporation of deep learning as base models is a promising direction.
Moreover, the stacking step for the base models does not yield the most satisfactory results at this point.The stacked predictions do not always outperform each individual base model, especially when one of the base models is noticeably worse than the others.Therefore, in the future, we would research into adding a pre-stacking base model evaluation that roughly assesses the base models before passing them all into the stacking step.For example, we can impose pre-stacking biases on base models and even remove certain clearly inferior base models before they are stacked.Ideally, we want the stacked predictions to almost always outperform the individual base models.
In addition, online update also has space for improvements.We currently assume a linear relationship between the advisor predictions by using a weighted majority vote to combine them.In future works, we would like to explore methods that introduce nonlinearity into combining the advisors.Moreover, while values for update frequency and decay rate make sense intuitively, choosing an appropriate diversity bias value is rather arbitrary at this point.We might want to change the expression of diversity bias in formula to make it take in more interpretable values, such as values in the range between 0 and 1.In addition, similar to a pre-stacking filter, we also want to add a pre-online-update filter to filter out clearly poorperforming advisors in order to resolve the performance imbalances we observed previously.
Last but not least, we would also like to formally investigate the curious accuracy gain and decay phenomenon which we observed when changing validation dates.Although we make the best educated guess for reasons behind it in this paper, it is worthy of further studies because once the reasons behind this phenomenon are well understood, we can dramatically increase the classification accuracy by choosing an appropriate validation length before the entire model is retrained with new data.Understanding this phenomenon may also lead to important insights into processing stock time series data in general.

Conclusion
In conclusion, by achieving a best-case misclassification error of 31.12% for Jinchuan Group and a bestcase profit of 477% relative returns for Sumitomo Metal Mining, dynABE demonstrates its potency for stock trend prediction and its profitability.Even though we only investigate critical metal companies in this paper, dynABE can be used for stock prediction of any company, provided that a well-researched feature set is collected.The advantages of dynABE for stock prediction lie in the fact that it exploits domain knowledge to utilize specialized data, diversifies feature sets by creating advisor groups, incorporates ensemble learning extensively in both feature selection and modeling, and is able to adapt to market changes dynamically with its novel and effective online update strategy.
The various analyses done on the final predictions gain us insights into how dynABE works in practice, giving online update hyperparameter tuning intuitions and visualizing weight histories that lead to observations of weight imbalances.In addition, they also allow us to observe the interesting phenomenon of accuracy gain and decay, which is worthy of future investigations.
We hope that the ideas of extensively using ensemble learning, creating advisors, and using ideas of decay rate and diversity bias in developing an effective online update strategy can help future researchers deal more effectively with other similar types of noisy time-series data.Indeed, dynABE is just an ensemble learning framework in essence, and it is open to numerous flexible changes to potentially adapt to tasks other than stock prediction.
addition, most current methods for stock prediction rely entirely on the training period and are static after the initial training.Therefore, they lack the flexibility to update themselves and are likely to miss out important features during the validation period.This makes them especially vulnerable to the dynamic feature of the stock market-the market's changes in price patterns may render a previously robust prediction strategy suddenly less accurate.For example, assume that the model learns from the training period that oil prices are the dominating factor in predicting oil producers' stock prices.If the model relies entirely on the training period, it will assign big weights to oil prices and ignore other factors.However, during the validation period, this pattern may change and alternative factors, such as the environmental implications of oil mining, may rise to become the dominating ones.This model will make inaccurate predictions because it ignores such potentially important factors that are not apparent during the training period.In other words, such model biases a few strong performing factors without considering all possible factors.

Figure 1 :
Figure 1: Correlation matrix of a sample set of features.Darker colors represent higher correlations, corresponding to the legend on the right.

Figure 3 :
Figure 3: Structure of dynABE for one advisor group.

Figure 4 :
Figure 4: Example tuning process of , while  is fixed.

Figure 5 :
Figure 5: Example tuning process of , while  is fixed.

Figure 9 :
Figure 9: Online update hyperparameter grid search for Sumitomo.
advisors, totaling in 12 different weight history trend lines.These plots tend to get messy, but we can get a general sense of the patterns after grouping the lines based on their corresponding advisors and stacking methods.Figures 11-13 are the complete weight history plots for all three companies.The x-axes are the epochs.Each epoch means one weight update.

Figure 12 :
Figure 12: Complete weight history of Sumitomo.

14- 16
are the consolidated version of the weight history plots.

Figure 14 :
Figure 14: Consolidated weight history of Jinchuan in terms of advisors.

Figure 15 :
Figure 15: Consolidated weight history of Sumitomo in terms of advisors.

Figure 16 :
Figure 16: Consolidated weight history of Zijin in terms of advisors.

Figures 17 -
19 are the accuracy history plots of this experiment for all three companies.In order to better observe a trend, outliers are removed and an additional smoothed trend line is plotted.

Figure 20 :
Figure 20: Trading strategy returns and stock returns of Jinchuan.

Figure 21 :
Figure 21: Trading strategy returns and stock returns of Sumitomo.

Figure 22 :
Figure 22: Trading strategy returns and stock returns of Zijin.

Table 1 :
Table 2 summarizes the related works.Their respective accuracies are not comparable, thus not shown, because they all use different datasets.Summary of related works.
denotes all advisors excluding   , and  is the diversity bias.Therefore, if agent   makes a correct prediction on the  ℎ day, the more the other agents are correct on that day, the higher ∑ ( − , ) is, and the smaller the score of   will be increased.After this online update window is over, denote the accumulated score for   on the last day of the window to be   .Then   's final score of the update window,      , is calculated as: 2 , … ,   ).Then the agent   's score on the  ℎ day,   , is updated in the following fashion until the online update window is over:

Table 2 :
Validation errors of each advisor for all three companies.

Table 3 :
Online update experiments with Jinchuan.

Table 4 :
Online update experiments with Sumitomo.

Table 5 :
Online update experiments with Zijin.

Table 6 :
Expected maximum online update performance improvements.