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

ML Lab Manual (Vim)

The document is a lab manual for a Machine Learning course at Vivekananda Institute of Management, detailing the setup and installation of Python, essential libraries like NumPy, pandas, and scikit-learn. It includes instructions for loading datasets, visualizing data, handling missing data, and implementing various machine learning algorithms such as k-NN, linear regression, and decision trees. The manual serves as a comprehensive guide for students to learn and apply machine learning techniques using Python.

Uploaded by

adarshgowda018
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)
14 views13 pages

ML Lab Manual (Vim)

The document is a lab manual for a Machine Learning course at Vivekananda Institute of Management, detailing the setup and installation of Python, essential libraries like NumPy, pandas, and scikit-learn. It includes instructions for loading datasets, visualizing data, handling missing data, and implementing various machine learning algorithms such as k-NN, linear regression, and decision trees. The manual serves as a comprehensive guide for students to learn and apply machine learning techniques using Python.

Uploaded by

adarshgowda018
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

VIVEKANANDA INSTITUTE OF MANAGEMENT

RAJAJINAGAR BANGALORE
MACHINE LEARNING LAB MANUAL.
6TH SEM BCA

Prepared by: NIHARIKA


Under the guidance of Girish Sir
1.Install and set up Python and essential libraries like NumPy and pandas.
a)Installing Python:
i)Download Python:-
Go to the official Python website download the latest version suitable for your operating
system (Windows, macOS, or Linux).
ii)Install Python:-
For Windows: Download python software and install it.
iii)Verify Installation:-
• Open a command prompt (Windows)
• python --version
b)Pip upgrade: Using pip:
• Pip is Python's package manager.
• It usually comes installed with Python.
• Open a terminal/command prompt.
Py –m install pip –upgrade pip
c)Install NumPy :
pip install numpy
press Enter. This command will download and install NumPy.
d)Install pandas:
pip install pandas
press Enter. This command will download and install pandas.
e)Verify installations:
Open a IDLE

OUTPUT:
2) Introduce scikit-learn as a machine learning library.
• Scikit-learn (Sklearn) is the most useful and robust library for machine learning in
Python.
• It provides a selection of efficient tools for machine learning and statistical modeling
including classification, regression, clustering and dimensionality reduction via a
consistence interface in Python.
• This library, which is largely written in Python, is built upon NumPy, pandas,SciPy and
Matplotlib.
Installation
If you already installed NumPy and Scipy, the following are the two easiest ways to
install scikit-learn –
Using pip
The following command can be used to install scikit-learn via pip
pip install scikit-learn

Features
Rather than focusing on loading, manipulating and summarizing data , Scikit-learn
library is focused on modeling the data. Some of the most popular groups of models
provided by Sklearn are as follows .
Supervised Learning algorithms − Almost all the popular supervised learning
algorithms, like Linear Regression, Support Vector Machine (SVM), Decision Tree etc.,
are the part of scikit-learn.
Unsupervised Learning algorithms − On the other hand, it also has all the popular
unsupervised learning algorithms from clustering, factor analysis, PCA (Principal
Component Analysis) to unsupervised neural networks.
Clustering − This model is used for grouping unlabeled data.
Cross Validation − It is used to check the accuracy of supervised models on unseen
data.
3) Install and set up scikit-learn and other necessary tools.
Pip upgrade:
Using pip:
• Pip is Python's package manager.
• It usually comes installed with Python.
• Open a terminal/command prompt.
Py –m install pip - -upgrade pip
a)Install NumPy :-
pip install numpy
press Enter. This command will download and install NumPy.
b)Install pandas:-
pip install pandas
press Enter. This command will download and install pandas.
c)Install matplotlib:-
pip install matplotlib
press Enter. This command will download and install matplotlib.
d)Install scipy:-
pip install scipy press Enter. This command will download and install scipy
e)Install scikit-learn(sklearn):-
pip install scikit-learn
press Enter. This command will download and install scikit-learn
Verify installations:
Open a IDLE
OUTPUT:
4. Write a program to Load and explore the dataset of .CSV and excel files using pandas.
OUTPUT:

5. Write a program to Visualize the dataset to gain insights using Matplotlib or Seaborn by
plotting scatter plots, and bar charts.
OUTPUT:

6. Write a program to Handle missing data, encode categorical variables, and perform
feature scaling.
OUTPUT:

7. Write a program to implement a k-Nearest Neighbours (k-NN) classifier using scikit-learn


and Train the classifier on the dataset and evaluate its performance.
OUTPUT:

8. Write a program to implement a linear regression model for regression tasks and Train
the model on a dataset with continuous target variables.
OUTPUT:

9. Write a program to implement a decision tree classifier using scikit-learn and visualize the
decision tree and understand its splits.
OUTPUT:

10. Write a program to Implement K-Means clustering and Visualize clusters.


OUTPUT:

You might also like