Selectors
AbstractPredictor
Abstract base class for all predictors.
Methods
fit(X, Y) Fit the model to the data. predict(X) Predict using the model. save(file_path) Save the model to a file. load(file_path) Load the model from a file.
Source code in asf/predictors/abstract_predictor.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
__init__()
Initialize the predictor.
Source code in asf/predictors/abstract_predictor.py
20 21 22 23 24 |
|
fit(X, Y)
Fit the model to the data.
Parameters
X : array-like Training data. Y : array-like Target values.
Source code in asf/predictors/abstract_predictor.py
26 27 28 29 30 31 32 33 34 35 36 37 |
|
load(file_path)
Load the model from a file.
Parameters
file_path : str Path to the file from which the model will be loaded.
Source code in asf/predictors/abstract_predictor.py
66 67 68 69 70 71 72 73 74 75 |
|
predict(X)
Predict using the model.
Parameters
X : array-like Data to predict on.
Returns
array-like Predicted values.
Source code in asf/predictors/abstract_predictor.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|
save(file_path)
Save the model to a file.
Parameters
file_path : str Path to the file where the model will be saved.
Source code in asf/predictors/abstract_predictor.py
55 56 57 58 59 60 61 62 63 64 |
|
EPMRandomForest
Bases: ForestRegressor
, AbstractPredictor
Implementation of random forest as done in the paper "Algorithm runtime prediction: Methods & evaluation" by Hutter, Xu, Hoos, and Leyton-Brown (2014).
Methods
fit(X, Y) Fit the model to the data. predict(X) Predict using the model. save(file_path) Save the model to a file. load(file_path) Load the model from a file.
Source code in asf/predictors/epm_random_forest.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
fit(X, y, sample_weight=None)
Fit the model to the data.
Parameters
X : array-like Training data. y : array-like Target values.
Source code in asf/predictors/epm_random_forest.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
|
load(file_path)
Load the model from a file.
Parameters
file_path : str Path to the file from which the model will be loaded.
Returns
EPMRandomForest The loaded model.
Source code in asf/predictors/epm_random_forest.py
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
predict(X)
Predict using the model.
Parameters
X : array-like Data to predict on.
Returns
array-like Predicted values.
Source code in asf/predictors/epm_random_forest.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
save(file_path)
Save the model to a file.
Parameters
file_path : str Path to the file where the model will be saved.
Source code in asf/predictors/epm_random_forest.py
135 136 137 138 139 140 141 142 143 144 145 146 |
|
SklearnWrapper
Bases: AbstractSelector
A generic wrapper for scikit-learn models.
This class allows scikit-learn models to be used with the ASF framework.
Methods
fit(X, Y) Fit the model to the data. predict(X) Predict using the model. save(file_path) Save the model to a file. load(file_path) Load the model from a file.
Source code in asf/predictors/sklearn_wrapper.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|
__init__(model_class)
Initialize the wrapper with a scikit-learn model.
Parameters
model_class : ClassifierMixin An instance of a scikit-learn model.
Source code in asf/predictors/sklearn_wrapper.py
23 24 25 26 27 28 29 30 31 32 |
|
fit(X, Y)
Fit the model to the data.
Parameters
X : array-like Training data. Y : array-like Target values.
Source code in asf/predictors/sklearn_wrapper.py
34 35 36 37 38 39 40 41 42 43 44 45 |
|
load(file_path)
Load the model from a file.
Parameters
file_path : str Path to the file from which the model will be loaded.
Returns
SklearnWrapper The loaded model.
Source code in asf/predictors/sklearn_wrapper.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|
predict(X)
Predict using the model.
Parameters
X : array-like Data to predict on.
Returns
array-like Predicted values.
Source code in asf/predictors/sklearn_wrapper.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
save(file_path)
Save the model to a file.
Parameters
file_path : str Path to the file where the model will be saved.
Source code in asf/predictors/sklearn_wrapper.py
63 64 65 66 67 68 69 70 71 72 73 74 |
|