ML Lab 09 Manual - Introduction To Scikit Learn
ML Lab 09 Manual - Introduction To Scikit Learn
Machine Learning
Introduction
This laboratory exercise will focus on the Scikit Learn (or SKLearn) library for
machine learning implementations in python. Scikit Learn contains many useful
functions for fitting models using various machine learning techniques such as
linear regression, logistic regression, decision trees, support vector machines, k-
means clustering, anomaly detection and more.
Objectives
Lab Conduct
Machine Learning
Theory
Scikit Learn is a python library that contains a wide arsenal of functions
pertaining to machine learning. It also contains its own datasets for trying out
the machine learning algorithms. Scikit learns API interface can be divided into
three types: estimator, predictor and transformer. The estimators are used to
fit the model in accordance with some algorithm. The predictors use the fitted
model to make prediction on test features. The transformers are used for the
conversion of data.
Machine Learning
Download a dataset containing at least 5 feature columns and a label column
containing continuous data. Use functions from Sci-kit learn to train a model
using linear regression. You will need to split your dataset into training and test
portions. Vary the step size and regularization parameters to get at least 6 plots
of the training loss and test loss. Lastly, save the weights of the best trained
model and use them to make at least five predictions.
Provide the codes and all of the relevant screenshots of your work. Also, give
brief explanation of the functions you are using in your codes.
Machine Learning
loss (vs. epochs), precision (vs. epochs) and recall (vs. epochs). Additionally,
plot the precision-recall plots for each trained model.
Lastly, save the weights of the best trained model and use them to make at least
five predictions. Make a scatter plot for each of your prediction. For this, you
will need to show the all of the dataset examples with their labeled classes.
Your prediction must be shown as a distinct point in the scatter plots.
Provide the code and all of the relevant screenshots of your work. Also, give
brief explanation of the functions you are using in your codes.
Machine Learning
For each of the above, perform clustering from k = 2 to K clusters (K is up to
your choice). For each combination case, make at least 3 cluster plots. Also,
make a graph of cost vs. K for all of the 3 combination cases. Use the elbow
method to determine the best number of clusters in each case.
Provide the code and all of the relevant screenshots of your work. Also, give
brief explanation of the functions you are using in your codes.
Machine Learning