You are on page 1of 7

University Institute of Engineering

Department of Computer Science & Engineering

Experiment:

Student Name:Harsh Thakur UID:22BCS10271


Branch: Computer Science & Engineering Section/Group:205-A
Semester:1st Date of Performance:
Subject Name:Disruptive Technology - 1
Subject Code:22ECH 102

1. Aim of the practical:PyCaret for Regression

2. Tool Used:Google colab


3. Code and Output:

(a) Install Pycaret

!pip install pycaret &> /dev/null #for installation 

print ("Pycaret installed sucessfully!!")

Output:

Pycaret installed sucessfully!!

(b) Get the version of the pycaret

from pycaret.utils import version  #getting the version

version()

Output:

2.3.10

1. Regression: Basics

1.1 Loading Dataset - Loading dataset from pycaret


University Institute of Engineering
Department of Computer Science & Engineering

from pycaret.datasets import get_data #loading datasets

# No output

1.2 Get the list of datasets available in pycaret (55)

# Internet connection is required

dataSets = get_data('index') 

Output:
University Institute of Engineering
Department of Computer Science & Engineering

1.3 Get boston dataset

bostonDataSet = get_data("boston") 

Output:

# import pandas as pd

# bostonDataSet = pd.read_csv("myFile.csv")

1.5 Run and compare the Model Performance

cm = compare_models()

Output:
University Institute of Engineering
Department of Computer Science & Engineering

1.6 Three line of code for model comparison for "Insurance" dataset

from pycaret.datasets import get_data # performing tasks on different dataset

from pycaret.regression import *

insuranceDataSet = get_data("insurance")

s = setup(data = insuranceDataSet, target='charges', silent=True)

cm = compare_models()

Output:
University Institute of Engineering
Department of Computer Science & Engineering

1.7 Three line of code for model comparison for "House" dataset

from pycaret.datasets import get_data # performing tasks on different dataset

from pycaret.regression import *

houseDataSet = get_data("house")

s = setup(data = houseDataSet, target='SalePrice', silent=True)

cm = compare_models()

Output:
University Institute of Engineering
Department of Computer Science & Engineering

5. Observations, Simulation Screen Shots and Discussions:

6. Result and Summary:

7. Additional Creative Inputs (If Any):

Learning outcomes (What I have learnt):

1.

2.

3.

4.

5.

Evaluation Grid (To be filled by Faculty):


University Institute of Engineering
Department of Computer Science & Engineering

Sr. No. Parameters Marks Obtained Maximum Marks


1. Student Performance (task 12
implementation and result evaluation)
2. Viva-Voce 10
3. Worksheet Submission (Record) 8
Signature of Faculty (with Date): Total Marks Obtained: 30

You might also like