Get configspace
This file is part of the TPOT library.
The current version of TPOT was developed at Cedars-Sinai by: - 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) - Gabriel Ketron (gabriel.ketron@cshs.org) - Miguel E. Hernandez (miguel.e.hernandez@cshs.org) - Jason Moore (moorejh28@gmail.com)
The original version of TPOT was primarily developed at the University of Pennsylvania by: - Randal S. Olson (rso@randalolson.com) - Weixuan Fu (weixuanf@upenn.edu) - Daniel Angell (dpa34@drexel.edu) - Jason Moore (moorejh28@gmail.com) - and many more generous open-source contributors
TPOT is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
TPOT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with TPOT. If not, see http://www.gnu.org/licenses/.
get_configspace(name, n_classes=3, n_samples=1000, n_features=100, random_state=None, n_jobs=1)
¶
This function returns the ConfigSpace.ConfigurationSpace with the hyperparameter ranges for the given scikit-learn method. It also uses the n_classes, n_samples, n_features, and random_state to set the hyperparameters that depend on these values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The str name of the scikit-learn method for which to create the ConfigurationSpace. (e.g. 'RandomForestClassifier' for sklearn.ensemble.RandomForestClassifier) |
required |
n_classes |
int
|
The number of classes in the target variable. Default is 3. |
3
|
n_samples |
int
|
The number of samples in the dataset. Default is 1000. |
1000
|
n_features |
int
|
The number of features in the dataset. Default is 100. |
100
|
random_state |
int
|
The random_state to use in the ConfigurationSpace. Default is None. If None, the random_state hyperparameter is not included in the ConfigurationSpace. Use this to set the random state for the individual methods if you want to ensure reproducibility. |
None
|
n_jobs |
int(default=1)
|
Sets the n_jobs parameter for estimators that have it. Default is 1. |
1
|
Source code in tpot/config/get_configspace.py
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 476 477 478 479 480 481 482 483 484 485 |
|
get_node(name, n_classes=3, n_samples=100, n_features=100, random_state=None, base_node=EstimatorNode, n_jobs=1)
¶
Helper function for get_search_space. Returns a single EstimatorNode for the given scikit-learn method. Also includes special cases for nodes that require custom parsing of the hyperparameters or methods that wrap other methods.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str or list
|
The name of the scikit-learn method or group of methods for which to create the search space. - str: The name of the scikit-learn method. (e.g. 'RandomForestClassifier' for sklearn.ensemble.RandomForestClassifier) Alternatively, the name of a group of methods. (e.g. 'classifiers' for all classifiers). - list: A list of scikit-learn method names. (e.g. ['RandomForestClassifier', 'ExtraTreesClassifier']) |
required |
n_classes |
int(default=3)
|
The number of classes in the target variable. |
3
|
n_samples |
int(default=1000)
|
The number of samples in the dataset. |
100
|
n_features |
int(default=100)
|
The number of features in the dataset. |
100
|
random_state |
int(default=None)
|
A fixed random_state to pass through to all methods that have a random_state hyperparameter. |
None
|
return_choice_pipeline |
bool(default=True)
|
If False, returns a list of TPOT.search_spaces.nodes.EstimatorNode objects. If True, returns a single TPOT.search_spaces.pipelines.ChoicePipeline that includes and samples from all EstimatorNodes. |
required |
base_node |
The SearchSpace to pass the configuration space to. If you want to experiment with custom mutation/crossover operators, you can pass a custom SearchSpace node here. |
EstimatorNode
|
|
n_jobs |
int(default=1)
|
Sets the n_jobs parameter for estimators that have it. Default is 1. |
1
|
Returns:
Type | Description |
---|---|
Returns an SearchSpace object that can be optimized by TPOT.
|
|
Source code in tpot/config/get_configspace.py
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 654 655 656 657 658 659 660 661 662 663 |
|
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)
¶
Returns a TPOT search space for a given scikit-learn method or group of methods.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str or list
|
The name of the scikit-learn method or group of methods for which to create the search space. - str: The name of the scikit-learn method. (e.g. 'RandomForestClassifier' for sklearn.ensemble.RandomForestClassifier) Alternatively, the name of a group of methods. (e.g. 'classifiers' for all classifiers). - list: A list of scikit-learn method names. (e.g. ['RandomForestClassifier', 'ExtraTreesClassifier']) |
required |
n_classes |
int(default=3)
|
The number of classes in the target variable. |
3
|
n_samples |
int(default=1000)
|
The number of samples in the dataset. |
1000
|
n_features |
int(default=100)
|
The number of features in the dataset. |
100
|
random_state |
int(default=None)
|
A fixed random_state to pass through to all methods that have a random_state hyperparameter. |
None
|
return_choice_pipeline |
bool(default=True)
|
If False, returns a list of TPOT.search_spaces.nodes.EstimatorNode objects. If True, returns a single TPOT.search_spaces.pipelines.ChoicePipeline that includes and samples from all EstimatorNodes. |
True
|
base_node |
The SearchSpace to pass the configuration space to. If you want to experiment with custom mutation/crossover operators, you can pass a custom SearchSpace node here. |
EstimatorNode
|
|
n_jobs |
int(default=1)
|
Sets the n_jobs parameter for estimators that have it. Default is 1. |
1
|
Returns:
Type | Description |
---|---|
Returns an SearchSpace object that can be optimized by TPOT.
|
|