Applying AutoML (Part-3) with TPOT

Also, Check out our Article on:

TPOT Pipeline includes

How does TPOT work?

Why TPOT is Time-Consuming?

Advantages

Disadvantages

Python Implementation

→ Installing Library

!pip install tpot

→ Importing Library

import pandas as pd
from sklearn.model_selection import train_test_split
import tpot
from tpot import TPOTClassifier

→ Reading data

data = pd.read_csv("/content/sonar_csv.csv")

→ Splitting data into Train and Test sets

data['Class'].replace(['Rock','Mine'], [0,1], inplace = True)
x = data.drop('Class',axis = 1)
y = data['Class']
x_train,x_test,y_train,y_test = train_test_split(x,y,test_size = 0.2)

→ Fitting it to TPOT

%%timetpot = TPOTClassifier(verbosity=2,generations=20)tpot.fit(x_train, y_train)

→ Evaluating TPOT

tpot.score(x_test, y_test)

→ Exporting .py file

tpot.export("Sonar_data.py")

Also, Check out our Article on:

Visit us on https://www.insaid.co/

--

--

--

One of India’s leading institutions providing world-class Data Science & AI programs for working professionals with a mission to groom Data leaders of tomorrow!

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Human centered analytics

Animating bar graphs

Interactive dashboad using Python

Airbnb Seattle Data Analysis

How Git + DVC (Data version Control) help in Data and Model Management

Linear Regression in Fuel Consumption

(B.O.O.K.$) Kimball’s Data Warehouse Toolkit Classics, 3 Volume Set FOR ANY DEVICE

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
INSAID

INSAID

One of India’s leading institutions providing world-class Data Science & AI programs for working professionals with a mission to groom Data leaders of tomorrow!

More from Medium

Noun-phrase frequency analysis on Spark dataframes

Did Stacking Improve My PySpark Churn Prediction Model?

Customer Segmentation using K-Means

Regression in RAPIDS vs Sklearn