---
name: "tpot"
section: "1"
platform: "linux"
package: "python3-tpot"
version: "0.11.7+dfsg-1"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/tpot"
---

# tpot(1)

Automated Machine Learning tool

## NAME

tpot - Automated Machine Learning tool

## DESCRIPTION

usage: tpot \[-h\] \[-is INPUT\_SEPARATOR\] \[-target TARGET\_NAME\]

-

  \[-mode {classification,regression}\] \[-o OUTPUT\_FILE\] \[-g GENERATIONS\] \[-p POPULATION\_SIZE\] \[-os OFFSPRING\_SIZE\] \[-mr MUTATION\_RATE\] \[-xr CROSSOVER\_RATE\] \[-scoring SCORING\_FN\] \[-cv NUM\_CV\_FOLDS\] \[-sub SUBSAMPLE\] \[-njobs NUM\_JOBS\] \[-maxtime MAX\_TIME\_MINS\] \[-maxeval MAX\_EVAL\_MINS\] \[-s RANDOM\_STATE\] \[-config CONFIG\_FILE\] \[-template TEMPLATE\] \[-memory MEMORY\] \[-cf CHECKPOINT\_FOLDER\] \[-es EARLY\_STOP\] \[-v {0,1,2,3}\] \[-log LOG\] \[--version\] INPUT\_FILE

A Python tool that automatically creates and optimizes machine learning pipelines using genetic programming.

### positional arguments:

- INPUT\_FILE

  Data file to use in the TPOT optimization process. Ensure that the class label column is labeled as "class".

### optional arguments:

- **-h**, **--help**

  Show this help message and exit.

- **-is** INPUT\_SEPARATOR

  Character used to separate columns in the input file.

- **-target** TARGET\_NAME

  Name of the target column in the input file.

- **-mode** {classification,regression}

  Whether TPOT is being used for a supervised classification or regression problem.

- **-o** OUTPUT\_FILE

  File to export the code for the final optimized pipeline.

- **-g** GENERATIONS

  Number of iterations to run the pipeline optimization process. It must be a positive number or None. If None, the parameter max\_time\_mins must be defined as the runtime limit. Generally, TPOT will work better when you give it more generations (and therefore time) to optimize the pipeline. TPOT will evaluate POPULATION\_SIZE + GENERATIONS x OFFSPRING\_SIZE pipelines in total.

- **-p** POPULATION\_SIZE

  Number of individuals to retain in the GP population every generation. Generally, TPOT will work better when you give it more individuals (and therefore time) to optimize the pipeline. TPOT will evaluate POPULATION\_SIZE + GENERATIONS x OFFSPRING\_SIZE pipelines in total.

- **-os** OFFSPRING\_SIZE

  Number of offspring to produce in each GP generation. By default,OFFSPRING\_SIZE = POPULATION\_SIZE.

- **-mr** MUTATION\_RATE

  GP mutation rate in the range \[0.0, 1.0\]. This tells the GP algorithm how many pipelines to apply random changes to every generation. We recommend using the default parameter unless you understand how the mutation rate affects GP algorithms.

- **-xr** CROSSOVER\_RATE

  GP crossover rate in the range \[0.0, 1.0\]. This tells the GP algorithm how many pipelines to "breed" every generation. We recommend using the default parameter unless you understand how the crossover rate affects GP algorithms.

- **-scoring** SCORING\_FN

  Function used to evaluate the quality of a given pipeline for the problem. By default, accuracy is used for classification problems and mean squared error (mse) is used for regression problems. Note: If you wrote your own function, set this argument to mymodule.myfunctionand TPOT will import your module and take the function from there.TPOT will assume the module can be imported from the current workdir.TPOT assumes that any function with "error" or "loss" in the name is meant to be minimized, whereas any other functions will be maximized. Offers the same options as cross\_val\_score: accuracy, adjusted\_rand\_score, average\_precision, f1, f1\_macro, f1\_micro, f1\_samples, f1\_weighted, neg\_log\_loss, neg\_mean\_absolute\_error, neg\_mean\_squared\_error, neg\_median\_absolute\_error, precision, precision\_macro, precision\_micro, precision\_samples, precision\_weighted, r2, recall, recall\_macro, recall\_micro, recall\_samples, recall\_weighted, roc\_auc

- **-cv** NUM\_CV\_FOLDS

  Number of folds to evaluate each pipeline over in stratified k-fold cross-validation during the TPOT optimization process.

- **-sub** SUBSAMPLE

  Subsample ratio of the training instance. Setting it to 0.5 means that TPOT will use a random subsample of half of training data for the pipeline optimization process.

- **-njobs** NUM\_JOBS

  Number of CPUs for evaluating pipelines in parallel during the TPOT optimization process. Assigning this to **-1** will use as many cores as available on the computer. For n\_jobs below **-1**, (n\_cpus + 1 + n\_jobs) are used. Thus for n\_jobs = **-2**, all CPUs but one are used.

- **-maxtime** MAX\_TIME\_MINS

  How many minutes TPOT has to optimize the pipeline. If not None, this setting will allow TPOT to run until max\_time\_mins minutes elapsed and then stop. TPOT will stop earlier if generationsis set and all generations are already evaluated.

- **-maxeval** MAX\_EVAL\_MINS

  How many minutes TPOT has to evaluate a single pipeline. Setting this parameter to higher values will allow TPOT to explore more complex pipelines but will also allow TPOT to run longer.

- **-s** RANDOM\_STATE

  Random number generator seed for reproducibility. Set this seed if you want your TPOT run to be reproducible with the same seed and data set in the future.

- **-config** CONFIG\_FILE

  Configuration file for customizing the operators and parameters that TPOT uses in the optimization process. Must be a Python module containing a dict export named "tpot\_config" or the name of built-in configuration.

- **-template** TEMPLATE

  Template of predefined pipeline structure. The option is for specifying a desired structurefor the machine learning pipeline evaluated in TPOT. So far this option only supportslinear pipeline structure. Each step in the pipeline should be a main class of operators(Selector, Transformer, Classifier or Regressor) or a specific operator(e.g. SelectPercentile) defined in TPOT operator configuration. If one step is a main class,TPOT will randomly assign all subclass operators (subclasses of SelectorMixin,TransformerMixin, ClassifierMixin or RegressorMixin in scikit-learn) to that step.Steps in the template are delimited by "-", e.g. "SelectPercentile-Transformer-Classifier".By default value of template is None, TPOT generates tree-based pipeline randomly.

- **-memory** MEMORY

  Path of a directory for pipeline caching or "auto" for using a temporary caching directory during the optimization process. If supplied, pipelines will cache each transformer after fitting them. This feature is used to avoid repeated computation by transformers within a pipeline if the parameters and input data are identical with another fitted pipeline during optimization process.

- **-cf** CHECKPOINT\_FOLDER

  If supplied, a folder in which tpot will periodically save the best pipeline so far while optimizing. This is useful in multiple cases: sudden death before tpot could save an optimized pipeline, progress tracking, grabbing a pipeline while it's still optimizing etc.

- **-es** EARLY\_STOP

  How many generations TPOT checks whether there is no improvement in optimization process. End optimization process if there is no improvement in the set number of generations.

- **-v** {0,1,2,3}

  How much information TPOT communicates while it is running: 0 = none, 1 = minimal, 2 = high, 3 = all. A setting of 2 or higher will add a progress bar during the optimization procedure.

- **-log** LOG

  Save progress content to a file

- **--version**

  Show the TPOT version number and exit.
