TwoStageTrAdaBoostR2
contains two main classes that are written in scikit-learn
style and the structure is as follows: Stage2_TrAdaBoostR2
|
__init__
|fit
|_stage2_adaboostR2
|predict
TwoStageTrAdaBoostR2
|
__init__
|fit
|_twostage_adaboostR2
|_beta_binary_search
|predict
Stage2_TrAdaBoostR2
is a revised version of AdaBoostRegressor
in sklearn
package with the revision that the weights of certain data (source data) are never modified as discussed in Pardoe's paper. This class serves as the second stage of the Two-Stage TrAdaBoost.R2 algorithm.TwoStageTrAdaBoostR2
is the main class that implements the whole two stages of the transfer learning algorithm.sklearn
style, it is adaptable to any regressors in the sklearn
packages, e.g., DecisionTreeRegressor.TwoStageTrAdaBoostR2
Specify the settings of the algorithm including {base_estimator, sample_size, n_estimators, steps, fold, learning_rate, loss, random_state}. Some of these settings are the same with AdaBoostRegressor
in sklearn
package. The following settings are unique to the TwoStageTrAdaBoostR2
:
TwoStageTrAdaBoostR2.fit
The inputs of the fit
function include {X, y, sample_weight}
TwoStageTrAdaBoostR2.predict
Predicting function for the predictions of test input area X_test.
Simply import TwoStageTrAdaBoostR2
, and it is ready to use (refer to 'example1.py').