获取配置空间
该文件是TPOT库的一部分。
当前版本的TPOT是由以下人员在Cedars-Sinai开发的: - Pedro Henrique Ribeiro (https://github.com/perib, https://www.linkedin.com/in/pedro-ribeiro/) - Anil Saini (anil.saini@cshs.org) - Jose Hernandez (jgh9094@gmail.com) - Jay Moran (jay.moran@cshs.org) - Nicholas Matsumoto (nicholas.matsumoto@cshs.org) - Hyunjun Choi (hyunjun.choi@cshs.org) - Miguel E. Hernandez (miguel.e.hernandez@cshs.org) - Jason Moore (moorejh28@gmail.com)
TPOT的原始版本主要由宾夕法尼亚大学的以下人员开发: - Randal S. Olson (rso@randalolson.com) - Weixuan Fu (weixuanf@upenn.edu) - Daniel Angell (dpa34@drexel.edu) - Jason Moore (moorejh28@gmail.com) - 以及许多慷慨的开源贡献者
TPOT 是免费软件:您可以根据自由软件基金会发布的 GNU 宽通用公共许可证的条款重新分发和/或修改它,许可证的版本可以是第 3 版,或者(根据您的选择)任何以后的版本。
TPOT 的发布是希望它能有用, 但没有任何保证;甚至没有对 适销性或特定用途适用性的暗示保证。更多详情请参阅 GNU 较宽松通用公共许可证。
您应该已经收到了一份GNU较宽松通用公共许可证的副本,随TPOT一起提供。如果没有,请参见http://www.gnu.org/licenses/。
get_configspace(name, n_classes=3, n_samples=1000, n_features=100, random_state=None, n_jobs=1)
¶
此函数返回ConfigSpace.ConfigurationSpace,其中包含给定scikit-learn方法的超参数范围。它还使用n_classes、n_samples、n_features和random_state来设置依赖于这些值的超参数。
参数:
| 名称 | 类型 | 描述 | 默认值 |
|---|---|---|---|
name |
str
|
用于创建ConfigurationSpace的scikit-learn方法的字符串名称。(例如,'RandomForestClassifier' 对应 sklearn.ensemble.RandomForestClassifier) |
required |
n_classes |
int
|
目标变量中的类别数量。默认值为3。 |
3
|
n_samples |
int
|
数据集中的样本数量。默认值为1000。 |
1000
|
n_features |
int
|
数据集中的特征数量。默认值为100。 |
100
|
random_state |
int
|
在ConfigurationSpace中使用的random_state。默认值为None。 如果为None,则ConfigurationSpace中不包含random_state超参数。 如果您希望确保可重复性,请使用此选项为各个方法设置随机状态。 |
None
|
n_jobs |
int(default=1)
|
设置具有该参数的估计器的n_jobs参数。默认值为1。 |
1
|
Source code in tpot2/config/get_configspace.py
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 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
get_node(name, n_classes=3, n_samples=100, n_features=100, random_state=None, base_node=EstimatorNode, n_jobs=1)
¶
用于get_search_space的辅助函数。返回给定scikit-learn方法的单个EstimatorNode。还包括需要自定义解析超参数或包装其他方法的节点的特殊情况。
参数:
| 名称 | 类型 | 描述 | 默认值 |
|---|---|---|---|
name |
str or list
|
要为其创建搜索空间的scikit-learn方法或方法组的名称。 - str: scikit-learn方法的名称。(例如,'RandomForestClassifier' 对应 sklearn.ensemble.RandomForestClassifier) 或者,方法组的名称。(例如,'classifiers' 对应所有分类器)。 - list: scikit-learn方法名称的列表。(例如,['RandomForestClassifier', 'ExtraTreesClassifier']) |
required |
n_classes |
int(default=3)
|
目标变量中的类别数量。 |
3
|
n_samples |
int(default=1000)
|
数据集中的样本数量。 |
100
|
n_features |
int(default=100)
|
数据集中的特征数量。 |
100
|
random_state |
int(default=None)
|
一个固定的random_state,传递给所有具有random_state超参数的方法。 |
None
|
return_choice_pipeline |
bool(default=True)
|
如果为False,返回一个TPOT2.search_spaces.nodes.EstimatorNode对象的列表。 如果为True,返回一个包含所有EstimatorNode并从中采样的单个TPOT2.search_spaces.pipelines.ChoicePipeline。 |
required |
base_node |
用于传递配置空间的SearchSpace。如果你想尝试自定义的变异/交叉操作符,可以在这里传递一个自定义的SearchSpace节点。 |
EstimatorNode
|
|
n_jobs |
int(default=1)
|
设置具有该参数的估计器的n_jobs参数。默认值为1。 |
1
|
返回:
| 类型 | 描述 |
|---|---|
返回一个可以由TPOT优化的SearchSpace对象。
|
|
Source code in tpot2/config/get_configspace.py
550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 | |
get_search_space(name, n_classes=3, n_samples=1000, n_features=100, random_state=None, return_choice_pipeline=True, base_node=EstimatorNode, n_jobs=1)
¶
返回给定scikit-learn方法或方法组的TPOT搜索空间。
参数:
| 名称 | 类型 | 描述 | 默认值 |
|---|---|---|---|
name |
str or list
|
要为其创建搜索空间的scikit-learn方法或方法组的名称。 - str: scikit-learn方法的名称。(例如,'RandomForestClassifier' 对应 sklearn.ensemble.RandomForestClassifier) 或者,方法组的名称。(例如,'classifiers' 对应所有分类器)。 - list: scikit-learn方法名称的列表。(例如,['RandomForestClassifier', 'ExtraTreesClassifier']) |
required |
n_classes |
int(default=3)
|
目标变量中的类别数量。 |
3
|
n_samples |
int(default=1000)
|
数据集中的样本数量。 |
1000
|
n_features |
int(default=100)
|
数据集中的特征数量。 |
100
|
random_state |
int(default=None)
|
一个固定的random_state,传递给所有具有random_state超参数的方法。 |
None
|
return_choice_pipeline |
bool(default=True)
|
如果为False,返回一个TPOT2.search_spaces.nodes.EstimatorNode对象的列表。 如果为True,返回一个包含所有EstimatorNode并从中采样的TPOT2.search_spaces.pipelines.ChoicePipeline。 |
True
|
base_node |
用于传递配置空间的SearchSpace。如果你想尝试自定义的变异/交叉操作符,可以在这里传递一个自定义的SearchSpace节点。 |
EstimatorNode
|
|
n_jobs |
int(default=1)
|
设置具有该参数的估计器的n_jobs参数。默认值为1。 |
1
|
返回:
| 类型 | 描述 |
|---|---|
返回一个可以由TPOT优化的SearchSpace对象。
|
|