Python Code Demonstration
Python Code Demonstration
TECHNIQUES
UNDER SUPERVISION OF
PROF.MANOJ KUMAR TIWARI,
DIRECTOR NITIE
INSTRUCTIONS TO USE GOOGLE COLAB
1. CREATING A NOTEBOOK
4. RUN CODE
2. AUTHENTICATION
Finally, type in your code in the
If colab isn't linked with your cell and press the play button
Google account, you will to run your code
receive a pop up to sign in
with your Google account
3. CONNECTING TO
NOTEBOOK
Connect the notebook in order
to run your code
INSTRUCTIONS TO USE GOOGLE COLAB TO RUN THE
ALGORITHMS
2. LOAD DATASET
3. RUN ALGORITHMS
Progressing ahead, press the
Finally, press the play button
play button on the Dataset
on the last cell
Cell
DATA SET INFORMATION
CLASSIFICATION
CLASSIFICATION REGRESSION CLUSTERING
PERFORMING
CLASSIFICATION
Simply enter the option number to
perform classification. Furthermore,
two more options are displayed to
choose the dataset and model of the
user's choice
CLASSIFICATION REGRESSION CLUSTERING
1. LOGISTIC REGRESSION
Dataset Description (wine_alytics(logistic))
CLASSIFICATION REGRESSION CLUSTERING
2. LOGISTIC REGRESSION
Data Visualization
2. LOGISTIC REGRESSION
For wine_alytics(logistic) Dataset
Test set
CLASSIFICATION REGRESSION CLUSTERING
2. LOGISTIC REGRESSION
For SUV_Purchase Dataset
Test set
CLASSIFICATION REGRESSION CLUSTERING
2. LOGISTIC REGRESSION
For mobile_price dataset
ROC-AUC CURVE
Confusion Matrix
(entropy) Train set
Test set
CLASSIFICATION REGRESSION CLUSTERING
2. DECISION TREE
CLASSIFIER
Dataset Description (wine_alytics)
CLASSIFICATION REGRESSION CLUSTERING
Dataset - (wine_alytics)
CLASSIFICATION REGRESSION CLUSTERING
SUV_Purchase mobile_price
CLASSIFICATION REGRESSION CLUSTERING
Depth of tree = 2
Classifier = entropy
CLASSIFICATION REGRESSION CLUSTERING
3. K-NEAREST NEIGHBORS
CLASSIFICATION
CLASSIFICATION REGRESSION CLUSTERING
3. K-NEAREST NEIGHBORS
CLASSIFICATION
Each feature are Normalised so the features become range
independent.
SUV_PURCHASE
3. K-NEAREST NEIGHBORS
CLASSIFICATION
Visualization of target class
SUV_Purchase mobile_price
CLASSIFICATION REGRESSION CLUSTERING
3. K-NEAREST NEIGHBORS
CLASSIFICATION
PERFORMING
KNN
3. K-NEAREST NEIGHBORS
CLASSIFICATION
Best K
Best K
3. K-NEAREST NEIGHBORS
CLASSIFICATION
SUV_Purchase Dataset
CLASSIFICATION REGRESSION CLUSTERING
3. K-NEAREST NEIGHBORS
CLASSIFICATION
Mobile_data Dataset
CLASSIFICATION REGRESSION CLUSTERING
3. K-NEAREST NEIGHBORS
CLASSIFICATION
3. K-NEAREST NEIGHBORS
CLASSIFICATION
CHOOSING MAX K AND NUMBER OF CROSS VALIDATIONS SETS TO BE CREATED TO FIND BEST K
Best K
CLASSIFICATION REGRESSION CLUSTERING
PERFORMING
REGRESSION
Simply enter the option number to perform
regression. Furthermore, two more options
are displayed to choose the dataset and
model of the user's choice
CLASSIFICATION REGRESSION CLUSTERING
20,000
3
15,000
2
10,000
COMPARISON OF RMSE
VALUES
1
5,000
400 categorical variables. Due to this Decision Tree filters out the best
predictions through its tree-like structure
300
Steel Consumption: This dataset is slightly complicated and the target
values cannot be plotted on a single hyperplane. Hence Decision tree
200
0 16
Linear Regressor Decision Tree
CLASSIFICATION REGRESSION CLUSTERING
ANALYSIS OF
CAR SALES DATA
Data Description
Displays Data
Correlation Matrix
16
CLASSIFICATION REGRESSION CLUSTERING
K-MEANS CLUSTERING
Customer
Public Utilities
Segmentation
Public Utilities
PCA has been used for dimensionality reduction.
For k=2 and k=3, clustering visualization could be seen below.
k=2 k=3
CLASSIFICATION REGRESSION CLUSTERING
Changes in clustering of
Public Utilities Dataset
Since the coordinates of final clusters
in K-means depend on their initial
positions, we have found a different
result than the one shown in the ppt
Our Result
CLASSIFICATION REGRESSION CLUSTERING
k=3 k=4
THANK YOU
THE DATASETS CAN BE VIEWED HERE THE NOTEBOOK CAN BE VIEWED HERE