回归器
基类: TPOTEstimator
Source code in tpot2/tpot_estimator/templates/tpottemplates.py
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 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | |
__init__(search_space='linear', scorers=['neg_mean_squared_error'], scorers_weights=[1], cv=10, other_objective_functions=[], other_objective_functions_weights=[], objective_function_names=None, bigger_is_better=True, categorical_features=None, memory=None, preprocessing=False, max_time_mins=60, max_eval_time_mins=10, n_jobs=1, validation_strategy='none', validation_fraction=0.2, early_stop=None, warm_start=False, periodic_checkpoint_folder=None, verbose=2, memory_limit=None, client=None, random_state=None, allow_inner_regressors=None, **tpotestimator_kwargs)
¶
一个使用遗传编程优化回归管道的sklearn基础估计器。 有关更多参数,请参见TPOTEstimator类。
参数:
| 名称 | 类型 | 描述 | 默认值 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
search_space |
(String, SearchSpace)
|
Note that TPOT MDR may be slow to run because the feature selection routines are computationally expensive, especially on large datasets. | - SearchSpace : The search space to use for the optimization. This should be an instance of a SearchSpace. The search space to use for the optimization. This should be an instance of a SearchSpace. TPOT2 has groups of search spaces found in the following folders, tpot2.search_spaces.nodes for the nodes in the pipeline and tpot2.search_spaces.pipelines for the pipeline structure. |
'linear'
|
||||||||||||
scorers |
(list, scorer)
|
用于交叉验证过程的评分器或评分器列表。 参见 https://scikit-learn.org/stable/modules/model_evaluation.html |
['neg_mean_squared_error']
|
||||||||||||
scorers_weights |
list
|
在优化过程中应用于评分器的权重列表。 |
[1]
|
||||||||||||
classification |
bool
|
如果为True,问题被视为分类问题。如果为False,问题被视为回归问题。 用于确定交叉验证策略。 |
required | ||||||||||||
cv |
(int, cross - validator)
|
|
10
|
||||||||||||
other_objective_functions |
list
|
应用于管道的其他目标函数列表。该函数接受一个参数用于graphpipeline估计器,并返回单个分数或分数列表。 |
[]
|
||||||||||||
other_objective_functions_weights |
list
|
应用于其他目标函数的权重列表。 |
[]
|
||||||||||||
objective_function_names |
list
|
应用于目标函数的名称列表。如果为None,将使用目标函数的名称。 |
None
|
||||||||||||
bigger_is_better |
bool
|
如果为True,则目标函数被最大化。如果为False,则目标函数被最小化。使用负权重来反转方向。 |
True
|
||||||||||||
categorical_features |
list or None
|
在预处理步骤中输入和/或进行独热编码的分类列。仅在预处理不为False时使用。 |
None
|
||||||||||||
categorical_features |
在预处理步骤中输入和/或进行独热编码的分类列。仅在预处理不为False时使用。 - None : 如果为None,TPOT2将自动使用pandas数据框中的对象列作为预处理中的独热编码对象。 - 分类特征列表。如果X是数据框,这应该是列名的列表。如果X是numpy数组,这应该是列索引的列表 |
None
|
|||||||||||||
memory |
如果提供,管道将在调用fit后使用joblib.Memory缓存每个转换器。此功能用于在优化过程中避免计算与另一个已拟合管道参数和输入数据相同的拟合转换器。 - 字符串 'auto': TPOT 使用临时目录进行内存缓存,并在关闭时清理它。 - 缓存目录的字符串路径 TPOT 使用提供的目录进行内存缓存,TPOT 不会在关闭时清理缓存目录。如果目录不存在,TPOT 将创建它。 - Memory 对象: TPOT 使用 joblib.Memory 的实例进行内存缓存, 并且 TPOT 不会在关闭时清理缓存目录。 - None: TPOT 不使用内存缓存。 |
None
|
|||||||||||||
preprocessing |
(bool or BaseEstimator / Pipeline)
|
实验性 一个将在交叉验证前用于预处理数据的管道。请注意,这些步骤的参数未进行优化。将它们添加到搜索空间中以进行优化。 - bool : 如果为True,将使用默认的预处理管道,包括插补和独热编码。 - Pipeline : 如果提供了管道的实例,将使用该管道作为预处理管道。 |
False
|
||||||||||||
max_time_mins |
float
|
运行优化的最大时间。如果为none或inf,将运行到世代结束。 |
float("inf")
|
||||||||||||
max_eval_time_mins |
float
|
评估单个个体的最大时间。如果为none或inf,则每次评估没有时间限制。 |
60*5
|
||||||||||||
n_jobs |
int
|
并行运行的进程数。 |
1
|
||||||||||||
validation_strategy |
str
|
实验性 用于从种群中选择最终管道的验证策略。TPOT2 可能会过度拟合交叉验证分数。可以使用第二个验证集来选择最终管道。 - 'auto' : 根据数据集形状自动确定验证策略。 - 'reshuffled' : 使用相同的数据进行交叉验证和最终验证,但使用不同的折叠分割。这是小数据集的默认设置。 - 'split' : 使用单独的验证集进行最终验证。数据将根据 validation_fraction 进行分割。这是中等数据集的默认设置。 - 'none' : 不使用单独的验证集进行最终验证。根据原始交叉验证分数进行选择。这是大数据集的默认设置。 |
'none'
|
||||||||||||
validation_fraction |
float
|
实验性 当validation_strategy为'split'时,用于验证集的数据集比例。必须在0到1之间。 |
0.2
|
||||||||||||
early_stop |
int
|
在提前停止之前,没有改进的代数。所有目标必须在容差范围内收敛才能触发此操作。通常,5-20的值是合适的。 |
None
|
||||||||||||
warm_start |
bool
|
如果为True,将从上次运行的最后一世代继续进化算法。 |
False
|
||||||||||||
periodic_checkpoint_folder |
str
|
用于定期保存种群的文件夹。如果为None,则不会进行定期保存。 如果提供了,训练将从此检查点恢复。 |
None
|
||||||||||||
verbose |
int
|
在优化过程中打印多少信息。较高的值包括较低值的信息。 0. 无 1. 进度条
|
1
|
||||||||||||
memory_limit |
str
|
每个作业的内存限制。有关更多信息,请参阅 Dask LocalCluster 文档。 |
None
|
||||||||||||
client |
Client
|
用于并行化的dask客户端。如果不为None,这将覆盖n_jobs和memory_limit参数。如果为None,将创建一个新的客户端,其中num_workers=n_jobs且memory_limit=memory_limit。 |
None
|
||||||||||||
random_state |
(int, None)
|
用于实验可重复性的种子。该值将传递给 numpy.random.default_rng() 以创建生成器实例,并传递给其他类
|
None
|
||||||||||||
allow_inner_regressors |
bool
|
如果为True,搜索空间将包括集成回归器。 |
True
|
属性:
| 名称 | 类型 | 描述 |
|---|---|---|
fitted_pipeline_ |
GraphPipeline
|
一个继承自sklearn BaseEstimator的GraphPipeline的拟合实例。这是在传递给fit的完整X, y上拟合的。 |
evaluated_individuals |
A pandas data frame containing data for all evaluated individuals in the run.
|
Columns: - objective functions : The first few columns correspond to the passed in scorers and objective functions - Parents : A tuple containing the indexes of the pipelines used to generate the pipeline of that row. If NaN, this pipeline was generated randomly in the initial population. - Variation_Function : Which variation function was used to mutate or crossover the parents. If NaN, this pipeline was generated randomly in the initial population. - Individual : The internal representation of the individual that is used during the evolutionary algorithm. This is not an sklearn BaseEstimator. - Generation : The generation the pipeline first appeared. - Pareto_Front : The nondominated front that this pipeline belongs to. 0 means that its scores is not strictly dominated by any other individual. To save on computational time, the best frontier is updated iteratively each generation. The pipelines with the 0th pareto front do represent the exact best frontier. However, the pipelines with pareto front >= 1 are only in reference to the other pipelines in the final population. All other pipelines are set to NaN. - Instance : The unfitted GraphPipeline BaseEstimator. - validation objective functions : Objective function scores evaluated on the validation set. - Validation_Pareto_Front : The full pareto front calculated on the validation set. This is calculated for all pipelines with Pareto_Front equal to 0. Unlike the Pareto_Front which only calculates the frontier and the final population, the Validation Pareto Front is calculated for all pipelines tested on the validation set. |
pareto_front |
与评估个体相同的pandas数据框,但仅包含前沿帕累托前沿管道。
|
|
Source code in tpot2/tpot_estimator/templates/tpottemplates.py
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 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | |