Professional Documents
Culture Documents
Prerequisites:
• Basic knowledge of Python programming language.
• Anaconda installed on your computer.
1
Fundamentals of Machine Learning
NumPy
NumPy supports large, multi-dimensional arrays and matrices and mathematical
functions to operate on these arrays.
# Importing NumPy Library
import numpy as np
Matplotlib
Matplotlib is a plotting library for creating static, animated, and interactive visualizations
in Python.
# Importing Matplotlib Library
import matplotlib.pyplot as plt
Lab Tasks:
Task 1: Load a Dataset
Load the 'Iris' dataset from the UCI Machine Learning Repository.
# Loading Iris Dataset
url = "https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.dat
a"
column_names = ["sepal_length", "sepal_width", "petal_length", "petal_width",
"class"]
iris = pd.read_csv(url, names=column_names)
2
Fundamentals of Machine Learning
3
Fundamentals of Machine Learning
Exercises:
1. Exercise 1: Analyze the correlation matrix and scatter plot matrix. Answer the
following questions: a. Is there a relationship between 'sepal_length' and
'sepal_width'? b. Is the relationship between 'petal_length' and 'petal_width'
positive or negative? c. Which pair of variables has the strongest relationship?
2. Exercise 2: Create a scatter plot for 'petal_length' and 'petal_width'. Based on
the plot, hypothesize whether there is any association between the two variables
and whether the association is positive or negative.
3. Exercise 3: Load another dataset of your choice and perform similar operations
and visualizations to understand the relationships between the variables. Answer
questions about the relationships between the variables based on the
visualizations.
Submission:
Submit the Jupyter notebook containing all the executed cells along with the outputs and
your answers to the exercise questions.