0% found this document useful (0 votes)
31 views2 pages

Case Study 3

The document discusses using a support vector machine for binary classification on college data to predict if a college is private or public. It covers loading and preprocessing the data, fitting a linear SVM and observing accuracy, preprocessing with standard scaling and refitting, and using grid search to find the best hyperparameters for a nonlinear SVM.

Uploaded by

mahesh Kumar
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)
31 views2 pages

Case Study 3

The document discusses using a support vector machine for binary classification on college data to predict if a college is private or public. It covers loading and preprocessing the data, fitting a linear SVM and observing accuracy, preprocessing with standard scaling and refitting, and using grid search to find the best hyperparameters for a nonlinear SVM.

Uploaded by

mahesh Kumar
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/ 2

PYTHON certification training

Module 9: Supervised Learning- 2


Case Study

© Brain4ce Education Solutions Pvt. Ltd.


Module 9 – Supervised Learning - 2

Case Study

Objective:

• Employ SVM from scikit learn for binary classification.


• Impact of preprocessing data and hyper paramter search using grid search.

Questions:

1. Load the data from “college.csv” that has attributes collected about private and
public colleges for a particular year. We will try to predict the private/public
status of the college from other attributes.

2. Use LabelEncoder to encode the target variable in to numerical form and split
the data such that 20% of the data is set aside for testing.

3. Fit a linear svm from scikit learn and observe the accuracy.
[Hint: Use Linear SVC]

4. Preprocess the data using StandardScalar and fit the same model again and
observe the change in accuracy.
[Hint: Refer to scikitlearn’s preprocessing methods]

5. Use scikit learn’s gridsearch to select the best hyperparameter for a non-linear
SVM, identify the model with best score and its parameters.
[Hint: Refer to model_selection module of Scikit learn]

©Brain4ce Education Solutions Pvt. Ltd Page 1

You might also like