[go: up one dir, main page]

0% found this document useful (0 votes)
32 views13 pages

dt3 The Same As Possible To Get To

The document describes an experiment conducted using PyCaret library in Python. It discusses loading and exploring a diabetes dataset, building classification models and evaluating model performance using various plots.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views13 pages

dt3 The Same As Possible To Get To

The document describes an experiment conducted using PyCaret library in Python. It discusses loading and exploring a diabetes dataset, building classification models and evaluating model performance using various plots.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

University Institute of Engineering

Department of Computer Science & Engineering

Experiment: 3

Student Name: AMIT K. SINGH UID:22BIS70065


Student Name: ANKIT VERMA UID:22BIS70087
Student Name: SWARIT KASHYAP UID:22BIS70066
Student Name: RAJVEER SHARMA UID:22BIS70100
Branch: Computer Science & Engineering Section/Group: 120/B
Semester: 1ST Date of Performance: 07/10/22
Subject Name: DISRUPTIVE TECHNOLOGY
Subject Code: 22ECH-102

1. Aim of the practical: Explore, visualize, transform and summarize input


datasets for building Classification/regression/prediction models.

2. Tool Used: GOOGLE COLABORATORY, INTERNET CONNECTION, LAPTOP.

3. Basic Concept/ Command Description:

(1). Knowledge of pycaret


(2). Knowledge of opensource python libraries
(3). Uses of matplotlib
(4). Knowledge of file handling.
University Institute of Engineering
Department of Computer Science & Engineering

4. Code:

#Installing Pycaret

!pip install pycaret


print ("Pycaret installed successfully")

#Getting version of the pycaret


from pycaret.utils import version
version()

#Classification
#Loading dataset from pycaret
from pycaret.datasets import get_data
#No output
#Getting the list of datasets available in pycaret (55)

dataSets = get_data('index')
#Getting diabetes dataset
diabetesDataSet = get_data("diabetes") # Serial No. is 7

#Read data from file


import pandas as pd
diabetesDataSet = pd.read_csv("/content/diabetes_exp3.csv")
diabetesDataSet.columns

#Get the statistical summary of the dataset

diabetesDataSet.describe()
diabetesDataSet.info()

#print the type of dataset

#print("type(diabetesDataSet)-->",type(diabetesDataSet))
University Institute of Engineering
Department of Computer Science & Engineering

#Get the dimension of the dataset

print("diabetesDataSet.shape -->", diabetesDataSet.shape)


print("Rows -->", diabetesDataSet.shape[0]) ##axis 0---row
print("Columns -->", diabetesDataSet.shape[1]) ###column

#To Show top 5 rows and bottom 5 of the dataset

diabetesDataSet.head()
diabetesDataSet.tail()

#Accessing data from dataset - Part 1 (using loc - Column Names)

### Accessing data from dataset - Part 1 (using loc - Column Names)

diabetesDataSet.loc[:, ['Diabetes pedigree function','Age (years)']]

#Accessing data from dataset - Part 2 (using iloc - Column Names)

diabetesDataSet.iloc[20:30, 1:5]

#Bar graph
import matplotlib.pyplot as plt

x= diabetesDataSet['Diabetes pedigree function']


y= diabetesDataSet['Age (years)']

plt.bar(x,y, color="g")
plt.xlabel("Diabetes pedigree function")
plt.ylabel("Age (years)")
plt.title("bar graph for DIABETES DATASET")
plt.show()

#Scatter plot
import matplotlib.pyplot as plt

x= diabetesDataSet['Diabetes pedigree function']


y= diabetesDataSet['Age (years)']

plt.scatter(x,y, marker = "*", color="r")


plt.show()
University Institute of Engineering
Department of Computer Science & Engineering

#Subplot
import matplotlib.pyplot as plt

x= diabetesDataSet['Diabetes pedigree function']


y= diabetesDataSet['Age (years)']

plt.scatter(x,y, marker = "+", color="r")

a= diabetesDataSet['Number of times pregnant']


b= diabetesDataSet['Diabetes pedigree function']

plt.barh (a,b, color="c")


plt.show()

5. Observations, Simulation Screen Shots and Discussions:


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

6. Result and Summary:


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

7. Additional Creative Inputs (If Any):

Learning outcomes (What I have learnt):

 Getting Data: How to import data from PyCaret repository


 Setting up Environment: How to setup an experiment in PyCaret and get started with building
regression models
 Create Model: How to create a model, perform cross validation and evaluate regression
metrics
 Tune Model: How to automatically tune the hyperparameters of a regression model
 Plot Model: How to analyze model performance using various plots
 Finalize Model: How to finalize the best model at the end of the experiment
 Predict Model: How to make prediction on new / unseen data
 Save / Load Model: How to save / load a model for future use

Evaluation Grid (To be filled by Faculty):


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