Skip to main content

A Python package for supervised and unsupervised machine learning.

Project description

## pycaret pycaret is the free software and open source machine learning library for python programming language. It is built around several popular machine learning libraries in python. Its primary objective is to reduce the cycle time of hypothesis to insights by providing an easy to use high level unified API. pycaret's vision is to become defacto standard for teaching machine learning and data science. Our strength is in our easy to use unified interface for both supervised and unsupervised machine learning problems. It saves time and effort that citizen data scientists, students and researchers spent on coding or learning to code using different interfaces, so that now they can focus on business problem and value creation.

Key Features

  • Ease of Use
  • Focus on Business Problem
  • 10x efficient
  • Collaboration
  • Business Ready
  • Cloud Ready

Current Release

The current release is beta 0.0.4 (as of 23/12/2019). A full release for public is targetted to be available by 31/12/2020.

Installation

Dependencies

Please read requirements.txt for list of requirements. They are automatically installed when pycaret is installed using pip.

User Installation

The easiest way to install pycaret is using pip.

pip install pycaret

Quick Start

As of beta 0.0.4 classification, regression and nlp modules are available. Future release will be include Anamoly Detection, Association Rules, Clustering, Recommender System and Time Series.

Classification

Getting data from pycaret repository

from pycaret.datasets import get_data
juice = get_data('juice')
  1. Initializing the pycaret environment setup
exp1 = setup(juice, 'Purchase')
  1. Creating a simple logistic regression (includes fitting, CV and metric evaluation)
lr = create_model('lr')

List of available estimators:

Logistic Regression (lr)
K Nearest Neighbour (knn)
Naive Bayes (nb)
Decision Tree (dt)
Support Vector Machine - Linear (svm)
SVM Radial Function (rbfsvm)
Gaussian Process Classifier (gpc)
Multi Level Perceptron (mlp)
Ridge Classifier (ridge)
Random Forest (rf)
Quadtratic Discriminant Analysis (qda)
Adaboost (ada)
Gradient Boosting Classifier (gbc)
Linear Discriminant Analysis (lda)
Extra Trees Classifier (et)
Extreme Gradient Boosting - xgboost (xgboost)
Light Gradient Boosting - Microsoft LightGBM (lightgbm)

  1. Tuning a model using inbuilt grids.
tuned_xgb = tune_model('xgboost')
  1. Ensembling Model
dt = create_model('dt')
dt_bagging = ensemble_model(dt, method='Bagging')
dt_boosting = ensemble_model(dt, method='Boosting')
  1. Creating a voting classifier
voting_all = blend_models() #creates voting classifier for entire library

#create voting classifier for specific models
lr = create_model('lr')
svm = create_model('svm')
mlp = create_model('mlp')
xgboost = create_model('xgboost')

voting_clf2 = blend_models( [ lr, svm, mlp, xgboost ] )
  1. Stacking Models in Single Layer
#create individual classifiers
lr = create_model('lr')
svm = create_model('svm')
mlp = create_model('mlp')
xgboost = create_model('xgboost')

stacker = stack_models( [lr,svm,mlp], meta_model = xgboost )
  1. Stacking Models in Multiple Layers
#create individual classifiers
lr = create_model('lr')
svm = create_model('svm')
mlp = create_model('mlp')
gbc = create_model('gbc')
nb = create_model('nb')
lightgbm = create_model('lightgbm')
knn = create_model('knn')
xgboost = create_model('xgboost')

stacknet = create_stacknet( [ [lr,svm,mlp], [gbc, nb], [lightgbm, knn] ], meta_model = xgboost )
#meta model by default is Logistic Regression
  1. Plot Models
lr = create_model('lr')
plot_model(lr, plot='auc')

List of available plots:

Area Under the Curve (auc)
Discrimination Threshold (threshold)
Precision Recall Curve (pr)
Confusion Matrix (confusion_matrix)
Class Prediction Error (error)
Classification Report (class_report)
Decision Boundary (boundary)
Recursive Feature Selection (rfe)
Learning Curve (learning)
Manifold Learning (manifold)
Calibration Curve (calibration)
Validation Curve (vc)
Dimension Learning (dimension)
Feature Importance (feature)
Model Hyperparameter (parameter)

  1. Evaluate Model
lr = create_model('lr')
evaluate_model(lr) #displays user interface for interactive plotting
  1. Interpret Tree Based Models
xgboost = create_model('xgboost')
interpret_model(xgboost)
  1. Saving Model for Deployment
lr = create_model('lr')
save_model(lr, 'lr_23122019')
  1. Saving Entire Experiment Pipeline
save_experiment('expname1')
  1. Loading Model / Experiment
m = load_model('lr_23122019')
e = load_experiment('expname1')
  1. AutoML
aml1 = automl()

Documentation

Documentation work is in progress. They will be uploaded on our website http://www.pycaret.org as soon as they are available. (Target Availability : 21/01/2020)

Contributions

Contributions are most welcome. To make contribution please reach out moez.ali@queensu.ca

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycaret-0.0.4.tar.gz (92.2 kB view hashes)

Uploaded Source

Built Distribution

pycaret-0.0.4-py3-none-any.whl (93.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page