training
def dehb_target_function(config, budget, X, y, seed=None, default_budget=MAX_ESTIMATORS, cv=5, scoring=('r2'))
#
Target function to run while training an xgboost model.
PARAMETER | DESCRIPTION |
---|---|
config |
The configuration to use for the XGBoost model
TYPE:
|
budget |
The number of estimators to use for the XGBoost model |
X |
The data to train on
TYPE:
|
y |
The target to train on
TYPE:
|
seed |
The seed to use for the XGBoost model
TYPE:
|
default_budget |
The default budget to use if budget is None
TYPE:
|
cv |
The number of folds to use for cross validation
TYPE:
|
scoring |
The scoring metrics to use for cross validation |
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
The result of the target function |
Source code in src/mfpbench/pd1/surrogate/training.py
def find_xgboost_surrogate(X, y, *, cv=5, seed=None, opt_time=30.0, output_path=None, n_workers=1)
#
Find the best XGBoost surrogate for the given data.
PARAMETER | DESCRIPTION |
---|---|
X |
The data to train on
TYPE:
|
y |
The target to train on
TYPE:
|
cv |
The number of folds to use for cross validation
TYPE:
|
seed |
The seed to use for the XGBoost model
TYPE:
|
opt_time |
The time to spend optimizing the surrogate
TYPE:
|
output_path |
The path to save the results to
TYPE:
|
n_workers |
The number of workers to use for DEHB
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
XGBRegressor
|
The trained XGBoost model |
Source code in src/mfpbench/pd1/surrogate/training.py
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 165 166 167 168 169 170 171 |
|