PyCaret Official
Searchโ€ฆ
๐Ÿ’ก
Functions
This page lists all the functions of PyCaret

Select the tab
๐Ÿ‘‡
โ€‹

Initialize
Train
Optimize
Analyze
Deploy
Others

โ€‹setupโ€‹

This function initializes the experiment in PyCaret and prepares the transformation pipeline based on all the parameters passed in the function. The setup function must be called before executing any other function. It only requires two parameters: data and target. All the other parameters are optional. Learn More.โ€‹

โ€‹compare_modelsโ€‹

This function trains and evaluates the performance of all the models available in the model library using cross-validation. The output of this function is a scoring grid with average cross-validated scores. Learn More.โ€‹
โ€‹

โ€‹create_model

This function trains and evaluates the performance of a given model using cross-validation. The output of this function is a scoring grid with cross-validated scores along with mean and standard deviation. Learn More.โ€‹

โ€‹tune_modelโ€‹

This function tunes the hyperparameters of a given model. The output of this function is a scoring grid with cross-validated scores of the best model. Search spaces are pre-defined with the flexibility to provide your own. The search algorithm can be random, bayesian, and a few others with the ability to scale on large clusters. Learn More. โ€‹
โ€‹

โ€‹ensemble_modelโ€‹

This function ensembles a given model. The output of this function is a scoring grid with cross-validated scores of the ensembled model. Two methods Bagging or Boosting can be used for ensembling. Learn More.
โ€‹

โ€‹blend_modelsโ€‹

This function trains a Soft Voting / Majority Rule classifier for given models in a list. The output of this function is a scoring grid with cross-validated scores of a Voting Classifier or Regressor. Learn More.โ€‹
โ€‹

โ€‹stack_modelsโ€‹

This function trains a meta-model over given models in a list. The output of this function is a scoring grid with cross-validated scores of a Stacking Classifier or Regressor. Learn More.โ€‹
โ€‹

โ€‹optimize_thresholdโ€‹

This function optimizes the probability threshold for a given model. It iterates over performance metrics at different probability thresholds and returns a plot with performance metrics on the y-axis and threshold on the x-axis. Learn More.โ€‹
โ€‹

โ€‹calibrate_modelโ€‹

This function calibrates the probability of a given model using isotonic or logistic regression. The output of this function is a scoring grid with cross-validated scores of calibrated classifier. Learn More.โ€‹

โ€‹plot_modelโ€‹

This function analyzes the performance of a trained model on the hold-out set. It may require re-training the model in certain cases. Learn More.โ€‹
โ€‹

โ€‹evaluate_modelโ€‹

This function uses ipywidgets to display a basic user interface for analyzing the performance of a trained model. Learn More.โ€‹
โ€‹

โ€‹interpret_modelโ€‹

This function analyzes the predictions generated from a trained model. Most plots in this function are implemented based on the SHAP (Shapley Additive exPlanations). Learn More.โ€‹
โ€‹

โ€‹dashboardโ€‹

This function generates the interactive dashboard for a trained model. The dashboard is implemented using the ExplainerDashboard project. Learn More.โ€‹
โ€‹

โ€‹deep_checkโ€‹

This function runs a full suite check over a trained model using the deepchecks library. This function is in experimental mode. Learn More.
โ€‹

โ€‹edaโ€‹

This function generates automated Exploratory Data Analysis (EDA) using the AutoViz project. Fully interactive and exportable. Learn More.โ€‹
โ€‹

โ€‹check_fairnessโ€‹

This function provides fairness-related metrics between different groups in the dataset for a given model. There are many approaches to evaluate fairness but this function uses the approach known as group fairness, which asks: which groups of individuals are at risk for experiencing harm. Learn More.โ€‹

โ€‹

โ€‹get_leaderboardโ€‹

This function returns the leaderboard of all models trained in the current setup. Learn More.โ€‹
โ€‹

โ€‹assign_modelโ€‹

This function assigns labels to the training dataset using the trained model. It is only available for unsupervised modules. Learn More.โ€‹

โ€‹predict_modelโ€‹

This function generates the label using a trained model. When unseen data is not passed, it predicts the label and score on the holdout set. Learn More.โ€‹
โ€‹

โ€‹finalize_modelโ€‹

This function refits a given model on the entire dataset. Learn More. โ€‹

โ€‹

โ€‹save_modelโ€‹

This function saves the ML pipeline as a pickle file for later use. Learn More.โ€‹

โ€‹

โ€‹load_modelโ€‹

This function loads a previously saved pipeline. Learn More.โ€‹
โ€‹

โ€‹save_configโ€‹

This function saves all the global variables to a pickle file, allowing to later resume without rerunning the setup function. Learn More.โ€‹
โ€‹

โ€‹load_config

This function loads global variables from a pickle file into Python. Learn More.โ€‹
โ€‹

โ€‹deploy_modelโ€‹

This function deploys the entire ML pipeline on the cloud. Learn More.โ€‹

โ€‹

โ€‹convert_modelโ€‹

This function transpiles the trained machine learning model's decision function in different programming languages such as Python, C, Java, Go, C#, etc. Learn More.โ€‹

โ€‹

โ€‹create_apiโ€‹

This function takes an input model and creates a POST API for inference. It only creates the API and doesn't run it automatically. To run the API, you must run the Python file using !python. Learn More.โ€‹

โ€‹

โ€‹create_dockerโ€‹

This function creates a Dockerfile and requirements.txt for deploying API. Learn More.โ€‹

โ€‹

โ€‹create_appโ€‹

This function creates a basic gradio app for inference. Learn More.โ€‹

โ€‹pullโ€‹

Returns the last printed scoring grid. Use pull function after any training function to get the metrics in pandas.DataFrame. Learn More.โ€‹
โ€‹

โ€‹modelsโ€‹

Return a table containing all the models available in the imported module of the model library. Learn More.โ€‹

โ€‹

โ€‹get_configโ€‹

This function retrieves the global variables created by the setup function. Learn More.โ€‹

โ€‹

โ€‹set_configโ€‹

This function resets the global variables. Learn More.โ€‹
โ€‹

โ€‹get_metricsโ€‹

Returns the table of all available metrics used for cross-validation. Learn More.โ€‹
โ€‹

โ€‹add_metricโ€‹

Adds a custom metric to the metric container for cross-validation. Learn More.โ€‹
โ€‹

โ€‹remove_metricโ€‹

Removes a custom metric from the metric container. Learn More.โ€‹
โ€‹

โ€‹automlโ€‹

This function returns the best model from all the models in the current setup. Learn More.โ€‹

โ€‹

โ€‹get_logsโ€‹

Returns a table of experiment logs. Only works when log_experiment = True when initializing the setup function. Learn More.โ€‹

โ€‹

โ€‹get_system_logsโ€‹

Read and print logs.log file from the currently active directory. Learn More.โ€‹
โ€‹
Export as PDF
Copy link
Edit on GitHub