TPOT(1)

๐Ÿ“ฆ version 0.11.7, in ubuntu jammy

โœจ NAME โœจ

tpot โ€” the Automated Machine Learning tool, bestie ๐Ÿ’–


๐ŸŽ€ DESCRIPTION ๐ŸŽ€

okay so first things first, here's the vibe of how you actually call this thing:

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

so tpot is a Python tool that automatically creates and optimizes machine learning pipelines using genetic programming. it's giving "let the algorithm do your homework" and honestly? iconic. ๐Ÿงฌโœจ

๐Ÿซถ positional arguments

  • INPUT_FILE โ€” the data file you're running through the TPOT optimization process. heads up: make sure the class label column is labeled as "class". no cap, that one trips people up.

๐Ÿ’… optional arguments

  • -h, --help โ€” show this help message and dip. โœŒ๏ธ
  • -is INPUT_SEPARATOR โ€” the character used to separate columns in the input file.
  • -target TARGET_NAME โ€” the 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 โ€” the file you want the code for the final optimized pipeline exported to. ๐ŸŽ
  • -g GENERATIONS โ€” number of iterations to run the pipeline optimization process. it must be a positive number or None. if it's None, then the parameter max_time_mins must be defined as the runtime limit. generally, TPOT works better when you give it more generations (and therefore more time) to optimize the pipeline. for the math girlies: 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 works better when you give it more individuals (and therefore more time) to optimize the pipeline. same formula as above, she's consistent: 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 genuinely understand how the mutation rate affects GP algorithms. like, respectfully, don't freestyle this one.
  • -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. again: we recommend using the default parameter unless you actually understand how the crossover rate affects GP algorithms. ๐Ÿ’€
  • -scoring SCORING_FN โ€” the 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.myfunction and TPOT will import your module and take the function from there. TPOT will assume the module can be imported from the current workdir. TPOT also 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. yes that's the whole list, we don't gatekeep. ๐Ÿ‘‘
  • -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 TPOT will use a random subsample of half of the training data for the pipeline optimization process.
  • -njobs NUM_JOBS โ€” number of CPUs for evaluating pipelines in parallel during the TPOT optimization process. assign it to -1 and it'll use as many cores as available on the computer. for n_jobs below -1, (n_cpus + 1 + n_jobs) are used. so for n_jobs = -2, all CPUs but one are used. parallel queen energy. โšก
  • -maxtime MAX_TIME_MINS โ€” how many minutes TPOT has to optimize the pipeline. if not None, this setting lets TPOT run until max_time_mins minutes have elapsed and then stop. TPOT will stop earlier if generations is 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 let TPOT explore more complex pipelines, but it will also let TPOT run longer. tradeoffs, babe.
  • -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. future you says thank you. ๐Ÿซถ
  • -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 a built-in configuration.
  • -template TEMPLATE โ€” template of predefined pipeline structure. this option is for specifying a desired structure for the machine learning pipeline evaluated in TPOT. so far this option only supports linear 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 the 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 the value of template is None, and TPOT generates a 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 the optimization process. she remembers so you don't have to. ๐Ÿง 
  • -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. basically a save point. ๐ŸŽฎ
  • -es EARLY_STOP โ€” how many generations TPOT checks whether there is no improvement in the optimization process. ends the optimization process if there is no improvement in the set number of generations. if she's not growing, she's going. ๐Ÿ’…
  • -v {0,1,2,3} โ€” how much information TPOT communicates while it's 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.

fr fr reminder: every flag above does exactly what it says and nothing more. don't invent extra behaviour for them, bestie, the manual said what it said. ๐Ÿ™ˆ

and that's the whole page, mwah. this was tpot version 0.11.7+dfsg, dated January 2021, page TPOT(1) of the User Commands manual โ€” thanks for reading to the end, you ate that. ๐Ÿ’–โœจ๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from