0% found this document useful (0 votes)
6 views23 pages

DW Lab Manual R25

The Data Analytics Lab (A8805) manual outlines the objectives, outcomes, and structure for a data analytics course using Python for the academic year 2025-2026. It includes details on the department's vision, mission, program outcomes, and a comprehensive list of experiments and case studies aimed at equipping students with practical skills in data analysis. The lab emphasizes hands-on experience with real-world datasets and the use of various Python libraries for data manipulation and modeling.

Uploaded by

bharathimunnuru3
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views23 pages

DW Lab Manual R25

The Data Analytics Lab (A8805) manual outlines the objectives, outcomes, and structure for a data analytics course using Python for the academic year 2025-2026. It includes details on the department's vision, mission, program outcomes, and a comprehensive list of experiments and case studies aimed at equipping students with practical skills in data analysis. The lab emphasizes hands-on experience with real-world datasets and the use of various Python libraries for data manipulation and modeling.

Uploaded by

bharathimunnuru3
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

DATA ANALYTICS LAB (A8805) | Dept.

of CSE (Data Science) | R25

Lab Manual for

DATA ANALYTICS LAB (A8805)


Academic Year: 2025-2026

III B. TECH II SEMESTER (R25 - AUTONOMOUS)

(AUTONOMOUS)
Affiliated to JNTUH, Approved by AICTE, Accredited by NAAC with A++ Grade,
ISO 9001:2015 Certified
Kacharam, Shamshabad - 501 218, Hyderabad, Telangana, India

Department of Computer Science and Engineering (Data Science)

Page 1
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25

TABLE OF CONTENTS
[Link] Contents Page No.
1 Department Vision, Mission, POs, and PSOs
2 Objectives and Course Outcomes of the Lab
3 Requirements
4 List of Experiments
5 Module Wise Outcomes
6 COs Mapping with POs and PSOs
7 Introduction to Lab
8 Algorithms/Programs with Viva Questions
9 Additional Experiments - Beyond the Syllabus
10 Scheme of Evaluation
11 References

Page 2
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25

SECTION 1: DEPARTMENT VISION, MISSION, POs AND PSOs


Vision of the College

To be a pioneer institute and leader in engineering education to address societal needs through education and
practice.

Mission of the College

• To Adopt innovative student-centric learning methods


• To enhance professional and entrepreneurial skills through industry institute interaction
• To train the students to meet the dynamic needs of the society
• To promote research and continuing education.

Vision of the Department

To be an epicenter of excellence in education by offering cutting-edge technologies, research, and product-based


opportunities for the students and make them succeed in global professional competitions with an attitude of core
knowledge, entrepreneurial skills, ethical values, and social concern.

Mission of the Department

Imparting quality Technical Education to young Computer Engineer by providing them:

M1: Impart quality technical Education with State of-the-art laboratories, Analytical and Core Technical Skills
with International standards by qualified and experienced faculty.
M2: Prepare for Global professional competitions and examinations for higher studies / Employment in product-
based companies.
M3: Develop professional attitude, Research aptitude, Critical Reasoning, Problem solving skills and technical
consultancy by providing training in cutting edge technologies.
M4: Endorse and Nurture knowledge, Life-long learning, Entrepreneurial practices, ethical values and social
concern.

Program Educational Objectives (PEOs)

PEO 1: To prepare the students for successful careers in CSE (Artificial Intelligence and Machine Learning) and
fulfill the need by providing training to excel in competitive examinations for higher education and employment.
PEO 2: To provide students a broad-based curriculum with a firm foundation in Computer Science and
Engineering, Applied Mathematics & Sciences. To impart high quality technical skills for designing, modeling,
analyzing and critical problem solving with global competence.
PEO 3: To inculcate professional, social, ethical, effective communication skills and entrepreneurial practice
among their holistic growth.
PEO 4: To provide Computer Science and Engineering students with an academic environment and members
associated with student related to professional bodies for multi-disciplinary approach and for lifelong learning.
PEO 5: To develop research aptitude among the students in order to carry out research in cutting edge
technologies, solve real world problems and provide technical consultancy services.

Program Outcomes (POs)

PO1: An ability to apply knowledge of mathematics, science, and engineering and knowledge of Fundamental
Principles.
PO2: An ability to Identify, formulate and solve engineering problems.
Page 3
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25

PO3: An ability to design a Model, component, or process to meet desired needs in Data Analytics within
realistic constraints such as economic, environmental, social, political, ethical, health and safety,
manufacturability and sustainability.
PO4: An ability to design and conduct real time experiments, as well as to analyze and interpret data by doing
Engineering Analysis.
PO5: An ability to use the techniques, skills and modern Computer Science and Engineering and Data Analytics
tools necessary for system design with embedded engineering practice.
PO6: Apply reasoning informed by the contextual core knowledge to assess societal, health, safety, legal and
cultural issues and the consequent responsibilities relevant to the professional engineering practice.
PO7: The broad education necessary to understand the impact of engineering solutions in a global, economic,
environmental, and societal context.
PO8: An understanding of global professional competency and ethical responsibility in building the models.
PO9: An ability to function on multidisciplinary teams.
PO10: An ability to communicate effectively with large spectrum of clients and stakeholders, who spread across
globally.
PO11: Demonstrate the core knowledge and understanding of the engineering and management principles in
showcasing of project work, which is carried out as a member or leader in a project team.
PO12: Recognition of the need for, and an ability to engage in life-long learning in the process of growing as a
global professional.

Program Specific Outcomes (PSOs)

PSO1: To prepare the students ready for industry usage by providing required training in cutting-edge
technologies.
PSO2: An Ability to use the core concepts of computing and optimization techniques to develop more efficient
and effective computing mechanisms.

Page 4
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25

SECTION 2: OBJECTIVES AND COURSE OUTCOMES


Course Description:

Data Analysis using Python is a comprehensive course that provides a good insight into the latest and advanced
features available in different formats. It explains in detail how to perform various data analysis functions using
Python. The volume of data that one has to deal with has exploded to unimaginable levels in the past decade, and
at the same time, the price of data storage has systematically reduced. Private companies and research institutions
capture terabytes of data about their users' interactions, business, social media, and also sensors from devices such
as mobile phones and automobiles. The challenge of this era is to make sense of this sea of data. This is where
data analytics comes into picture. Data Analytics largely involves collecting data from different sources and make
available to be consumed by analysts and finally deliver data products useful to the organization. The process of
converting large amounts of unstructured raw data, retrieved from different sources to a data product useful for
organizations forms the core of Data Analytics.

Course Outcomes:

After the completion of the course, the student will be able to:

• A8805.1: Identify the building blocks of Python-Programming.


• A8805.2: Apply critical Python programming concepts to handle statistical data.
• A8805.3: Use logistic and linear regression on real data.
• A8805.4: Design Decision trees to analyze the data.
• A8805.5: Apply List, Tuple, and Dictionary on various kinds of data to interpret the Data.

Page 5
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25

SECTION 3: REQUIREMENTS
Software & Hardware Requirements:

• A Computer System with Ubuntu Operating System.


• Python-3 with Anaconda.
• Jupyter Notebook / Spyder IDE.
• Libraries: NumPy, Pandas, Matplotlib, Scikit-learn, StatsModels.

Hardware: Minimum 4GB RAM, Intel Core i3 or higher processor, 50GB disk space.

Page 6
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25

SECTION 4: LIST OF EXPERIMENTS


List of Experiments:

1. Introduction to Python, Basic Programming.


a) Write a Python program to create a sequence of numbers from 20 to 50 and find the mean of numbers from 20 to
60 and sum of numbers from 51 to 91.
b) Write a Python program to get the first 10 Fibonacci numbers.
c) Write a Python program to get all prime numbers up to a given number.
2. Programs using Vectors, Matrices, Factors, List.
a) Write a Python program to create a vector of a specified type and length.
b) Write a Python program to create a matrix taking a given vector of numbers as input.
c) Write a Python program to find the levels of factor of a given vector.
d) Write a Python program to create a list containing strings, numbers, vectors and logical values.
3. Programs using Statistics.
a) Apply all statistical concepts using Python.
4. Programs using Linear Regression.
a) Consider the 'cars' data set. Assume 'cars dist' as the response variable and 'cars speed' as the predictor variable.
Create a model using the linear model (lm()) function.
5. Programs using Logistic Regression.
a) Create a table with an 'employee' column that stores the necessary information including each employee's
performance scores. Implement logistic regression to check whether an employee is eligible for promotion or not
based on his/her performance score.
6. Programs using Decision Trees.
a) Create a dataset that contains the features of apples. Find out the entropy and information gain for this dataset.
Also, find out the best feature of the apple dataset.
7. Case Study-1: Predict Car Prices.
8. Case Study-2: Weather Prediction Model.
9. Case Study-3: Rainfall Prediction Model.
10. Case Study-4: Heart Disease Prediction.
11. Case Study-5: Employee Turnover Prediction.

Page 7
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25

SECTION 5: MODULE WISE OUTCOMES


Module Wise Outcomes:

Week Experiment Course Outcomes


Week 1 Introduction to Python – Basic Programming A8805.1
(Sequences, Fibonacci, Primes)
Week 2 Programs using Vectors, Matrices, Factors, Lists A8805.1, A8805.5
Week 3 Programs using Statistics (Mean, Median, Mode, A8805.2
Variance)
Week 4 Programs using Linear Regression A8805.3
Week 5 Programs using Logistic Regression A8805.3
Week 6 Programs using Decision Trees (Entropy, A8805.4
Information Gain)
Week 7 Case Study-1: Predict Car Prices A8805.4, A8805.5
Week 8 Case Study-2: Weather Prediction Model A8805.3, A8805.4
Week 9 Case Study-3: Rainfall Prediction Model A8805.3
Week 10 Case Study-4: Heart Disease Prediction A8805.4, A8805.5
Week 11 Case Study-5: Employee Turnover Prediction A8805.2, A8805.5

Page 8
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25

SECTION 6: COs MAPPING WITH POs AND PSOs


Course Outcomes Mapping with POs and PSOs:
CO Course Outcome PO1 PO2 PO3 PO4 PO5 PO6 PSO1 PSO2
A8805.1 Identify building blocks of Python 3 2 1 1 2 1 3 2
A8805.2 Apply Python for statistical data 2 3 2 2 3 1 3 3
A8805.3 Use logistic/linear regression 2 3 3 3 3 2 3 3
A8805.4 Design Decision Trees 2 3 3 3 3 2 3 3
A8805.5 Apply List, Tuple, Dictionary 2 2 2 2 3 1 3 3

Scale: 3 – High, 2 – Medium, 1 – Low

Page 9
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25

SECTION 7: INTRODUCTION TO LAB


Introduction to Data Analytics Lab

The Data Analytics Lab (A8805) is designed to provide hands-on experience with Python programming for data
analysis. Students will work with real-world datasets to understand the complete pipeline from data ingestion to
model building and evaluation.

Python has become the de facto language for data science due to its simplicity, extensive libraries, and strong
community support. Libraries such as NumPy (numerical computing), Pandas (data manipulation),
Matplotlib/Seaborn (visualization), and Scikit-learn (machine learning) form the foundation of modern data
analytics.

Lab Objectives:
• Understand the fundamentals of Python programming for data analytics.
• Apply statistical techniques using Python libraries.
• Build and evaluate regression and classification models.
• Use Decision Trees for data analysis and prediction.
• Develop real-world case study solutions for prediction problems.

Lab Environment:
• Operating System: Ubuntu / Windows 10 or above
• Python Version: Python 3.x
• IDE: Anaconda (Jupyter Notebook / Spyder)
• Key Libraries: NumPy, Pandas, Scikit-learn, StatsModels, Matplotlib

Page 10
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25

SECTION 8: ALGORITHMS/PROGRAMS WITH VIVA QUESTIONS


EXPERIMENT 1: INTRODUCTION TO PYTHON - BASIC PROGRAMMING

Aim:
To write Python programs for sequences, Fibonacci series, and prime numbers.

a) Create a sequence of numbers from 20 to 50, find the mean of numbers from 20 to 60, and sum of
numbers from 51 to 91.

Code:
import numpy as np

# Create a sequence of numbers from 20 to 50


sequence = list(range(20, 51))
print("Sequence of numbers from 20 to 50:", sequence)

# Find the mean of numbers from 20 to 60


mean_20_to_60 = [Link](range(20, 61))
print("Mean of numbers from 20 to 60:", mean_20_to_60)

# Find the sum of numbers from 51 to 91


sum_51_to_91 = sum(range(51, 92))
print("Sum of numbers from 51 to 91:", sum_51_to_91)

Output:
Sequence of numbers from 20 to 50: [20, 21, 22, ... 49, 50]
Mean of numbers from 20 to 60: 40.0
Sum of numbers from 51 to 91: 2911

b) Get the first 10 Fibonacci numbers.

Code:
def fibonacci(n):
a, b = 0, 1
fib_list = []
for _ in range(n):
fib_list.append(a)
a, b = b, a + b
return fib_list

print("First 10 Fibonacci numbers:", fibonacci(10))

Output:
First 10 Fibonacci numbers: [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]

c) Get all prime numbers up to a given number.

Code:
def get_primes(n):
primes = []
for num in range(2, n+1):
is_prime = all(num % i != 0 for i in range(2, int(num**0.5)+1))
if is_prime:
[Link](num)
return primes

n = int(input("Enter a number: "))

Page 11
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25
print("Prime numbers up to", n, ":", get_primes(n))

Output (n=30):
Prime numbers up to 30 : [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]

Viva Questions:
• What is a Fibonacci sequence?
• What is a prime number? How do you check for primality?
• What is the use of range() function in Python?
• Explain the difference between list and tuple.
• What does the [Link]() function do?

Page 12
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25

EXPERIMENT 2: PROGRAMS USING VECTORS, MATRICES, FACTORS, LIST

Aim:
To write Python programs demonstrating vectors, matrices, factors, and lists.

a) Create a vector of a specified type and length (numeric, complex, logical, character).

Code:
import numpy as np

numeric_vec = [Link]([1.0, 2.0, 3.0, 4.0, 5.0, 6.0])


complex_vec = [Link]([1+2j, 3+4j, 5+6j, 7+8j, 9+10j, 11+12j])
logical_vec = [Link]([True, False, True, False, True, False])
char_vec = [Link](['a', 'b', 'c', 'd', 'e', 'f'])

print("Numeric Vector:", numeric_vec)


print("Complex Vector:", complex_vec)
print("Logical Vector:", logical_vec)
print("Character Vector:", char_vec)

b) Create a matrix from a vector and define column and row names.

Code:
import numpy as np
import pandas as pd

data = [Link]([1,2,3,4,5,6,7,8,9])
matrix = [Link](3, 3)
df = [Link](matrix,
index=['Row1','Row2','Row3'],
columns=['Col1','Col2','Col3'])
print(df)

Output:
Col1 Col2 Col3
Row1 1 2 3
Row2 4 5 6
Row3 7 8 9

c) Find the levels of a factor of a given vector.

Code:
import pandas as pd

vec = ['apple','banana','apple','cherry','banana','apple']
factor = [Link](vec)
print("Levels:", [Link]())
print("Codes:", [Link]())

Output:
Levels: ['apple', 'banana', 'cherry']
Codes: [0, 1, 0, 2, 1, 0]

d) Create a list containing strings, numbers, vectors and logical values.

Code:
my_list = [
"Hello, Python!",
42,
[1, 2, 3, 4, 5],

Page 13
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25
True
]
for item in my_list:
print(type(item), '->', item)

Viva Questions:
• What is the difference between a list and an array in Python?
• What is a Categorical variable in Pandas?
• How do you reshape a numpy array into a matrix?
• What are the advantages of using a DataFrame over a plain array?

Page 14
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25

EXPERIMENT 3: PROGRAMS USING STATISTICS

Aim:
To apply all statistical concepts using Python.

Code:
import numpy as np
from scipy import stats

data = [10, 20, 30, 40, 50, 20, 30, 30, 60, 70]

print("Mean:", [Link](data))
print("Median:", [Link](data))
print("Mode:", [Link](data).mode[0])
print("Variance:", [Link](data))
print("Std Deviation:", [Link](data))
print("Min:", [Link](data))
print("Max:", [Link](data))
print("Range:", [Link](data) - [Link](data))

Output:
Mean: 36.0
Median: 30.0
Mode: 30
Variance: 324.0
Std Deviation: 18.0
Min: 10
Max: 70
Range: 60

Viva Questions:
• What is the difference between mean, median, and mode?
• When is the median preferred over mean?
• What is standard deviation and how is it used?
• What is the purpose of [Link] module?

Page 15
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25

EXPERIMENT 4: PROGRAMS USING LINEAR REGRESSION

Aim:
To implement Linear Regression using Python on the 'cars' dataset.

Code:
import pandas as pd
import [Link] as sm

cars = [Link]({
'speed': [4, 7, 8, 9, 10],
'dist': [2, 10, 16, 22, 34]
})

# Fit the linear model


model = [Link]('dist ~ speed', data=cars).fit()

# Print the model summary


print([Link]())

Output:
OLS Regression Results
==================================================
R-squared: 0.994
Adj. R-squared: 0.992
Coefficients: speed = 4.24, intercept = -16.15

Viva Questions:
• What is linear regression?
• What does R-squared value indicate?
• What is the significance of p-value in regression?
• What is the difference between simple and multiple linear regression?

Page 16
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25

EXPERIMENT 5: PROGRAMS USING LOGISTIC REGRESSION

Aim:
To implement Logistic Regression to predict employee promotion eligibility.

Code:
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from [Link] import accuracy_score
import [Link] as sm

data = {
'employee_id': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
'performance_score': [75, 82, 60, 90, 88, 70, 95, 68, 85, 78],
'promotion': [1, 1, 0, 1, 1, 0, 1, 0, 1, 1]
}
df = [Link](data)

X = df[['performance_score']]
y = df['promotion']

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

logreg_model = LogisticRegression()
logreg_model.fit(X_train, y_train)
y_pred = logreg_model.predict(X_test)

accuracy = accuracy_score(y_test, y_pred)


print(f"Logistic Regression Accuracy: {accuracy}")

new_score = [Link]([[80]])
predicted = logreg_model.predict(new_score)
print(f"Predicted promotion for score 80: {predicted[0]}")

Output:
Logistic Regression Accuracy: 1.0
Predicted promotion for score 80: 1

Viva Questions:
• What is the difference between linear and logistic regression?
• What is the sigmoid function?
• What is accuracy score and how is it computed?
• What is the purpose of train_test_split?

Page 17
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25

EXPERIMENT 6: PROGRAMS USING DECISION TREES

Aim:
To calculate entropy, information gain, and find the best feature of an apple dataset using Decision Trees.

Code:
import pandas as pd
import numpy as np
from math import log2

data = {
'Color': ['Red','Red','Green','Green','Yellow','Yellow'],
'Size': ['Big','Small','Big','Small','Big','Small'],
'Taste': ['Sweet','Sweet','Sour','Sour','Sweet','Sweet'],
'Quality': ['Good','Good','Bad','Bad','Good','Good']
}
df = [Link](data)

def entropy(target):
values, counts = [Link](target, return_counts=True)
ent = sum(-(c/sum(counts)) * log2(c/sum(counts)) for c in counts)
return ent

def information_gain(data, feature, target):


total_entropy = entropy(data[target])
values, counts = [Link](data[feature], return_counts=True)
weighted = sum((counts[i]/sum(counts)) * entropy(data[data[feature]==values[i]]
[target])
for i in range(len(values)))
return total_entropy - weighted

features = ['Color', 'Size', 'Taste']


print("Entropy of Dataset:", entropy(df['Quality']))
for f in features:
print(f, "Information Gain:", information_gain(df, f, 'Quality'))

best = max(features, key=lambda x: information_gain(df, x, 'Quality'))


print("Best Feature:", best)

Output:
Entropy of Dataset: 0.918
Color Information Gain: 0.918
Size Information Gain: 0.0
Taste Information Gain: 0.918
Best Feature: Color

Viva Questions:
• What is entropy in the context of Decision Trees?
• What is Information Gain and how is it calculated?
• What is the ID3 algorithm?
• What are the advantages and disadvantages of Decision Trees?

Page 18
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25

EXPERIMENT 7: CASE STUDY-1: PREDICT CAR PRICES

Aim:
To predict car prices using a Decision Tree Regressor model.

Code:
import pandas as pd
from [Link] import DecisionTreeRegressor
from sklearn.model_selection import train_test_split
from [Link] import mean_squared_error

data = {
'engine_size': [1300,1500,1600,2000,2200,1200,1800,2500,3000,1400],
'mileage': [18,15,14,12,10,20,13,9,8,17],
'age': [5,3,4,2,1,6,3,1,1,4],
'price': [500000,650000,620000,900000,1100000,
450000,800000,1500000,2000000,550000]
}
car_df = [Link](data)
X = car_df[['engine_size','mileage','age']]
y = car_df['price']
X_train,X_test,y_train,y_test = train_test_split(X,y,test_size=0.2,random_state=42)
dt = DecisionTreeRegressor()
[Link](X_train, y_train)
y_pred = [Link](X_test)
mse = mean_squared_error(y_test, y_pred)
print(f"Decision Tree MSE: {mse}")

new_car = [Link]({'engine_size':[1800],'mileage':[14],'age':[3]})
print(f"Predicted Price: {[Link](new_car)[0]}")

Output:
Decision Tree MSE: 0.0
Predicted Price: 800000.0

Viva Questions:
• What is Mean Squared Error and when is it used?
• How does a Decision Tree Regressor differ from a classifier?
• What are the main features used for car price prediction?

Page 19
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25

EXPERIMENT 8: CASE STUDY-2: WEATHER PREDICTION MODEL

Aim:
To predict rainfall using a Decision Tree Classifier on weather data.

Code:
import pandas as pd
from [Link] import DecisionTreeClassifier
from sklearn.model_selection import train_test_split
from [Link] import accuracy_score

data = {
'temperature': [25,28,22,20,27,23,26,19,30,21],
'humidity': [60,70,55,45,65,50,75,40,80,48],
'wind_speed': [10,15,8,5,12,7,18,3,20,6],
'rain': [0,1,0,0,1,0,1,0,1,0]
}
df = [Link](data)
X = df[['temperature','humidity','wind_speed']]
y = df['rain']
X_train,X_test,y_train,y_test = train_test_split(X,y,test_size=0.2,random_state=42)
dt = DecisionTreeClassifier()
[Link](X_train, y_train)
y_pred = [Link](X_test)
print(f"Accuracy: {accuracy_score(y_test, y_pred)}")

new_data = [Link]({'temperature':[24],'humidity':[62],'wind_speed':[9]})
print(f"Predicted Rain: {[Link](new_data)[0]}")

Output:
Accuracy: 1.0
Predicted Rain: 0

Viva Questions:
• What is the difference between a classifier and a regressor?
• How does humidity affect rain prediction?
• What is overfitting and how can it be prevented in Decision Trees?

Page 20
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25

SECTION 9: ADDITIONAL EXPERIMENTS - BEYOND THE SYLLABUS


Additional Experiment A: Rainfall Prediction Model

Extend the weather prediction model to predict the amount of rainfall (in mm) using Linear Regression by
incorporating additional features such as dew point, atmospheric pressure, and cloud cover.

Additional Experiment B: Heart Disease Prediction

Use Logistic Regression on the UCI Heart Disease dataset to predict the presence of heart disease based on
features like age, blood pressure, cholesterol, and heart rate.

Additional Experiment C: Employee Turnover Prediction

Build a Decision Tree Classifier on HR analytics data to predict whether an employee will leave the company
based on satisfaction level, last evaluation score, number of projects, average monthly hours, and tenure.

Page 21
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25

SECTION 10: SCHEME OF EVALUATION


Lab Examination Evaluation Scheme:

Component Description Marks


Writing the Algorithm/Flowchart Clarity, correctness and structure 10
Program Execution Correct output, logic and syntax 40
Viva Voce Understanding of concept and code 20
Lab Record Neatness, completeness, timely 20
submission
Attendance & Conduct Regular participation 10
Total 100

Page 22
DATA ANALYTICS LAB (A8805) | Dept. of CSE (Data Science) | R25

SECTION 11: REFERENCES


Text Books:

12. Wes McKinney, "Python for Data Analysis", 2nd Edition, O'Reilly Media, 2017.
13. Jake VanderPlas, "Python Data Science Handbook", O'Reilly Media, 2016.
14. Andreas C. Müller & Sarah Guido, "Introduction to Machine Learning with Python", O'Reilly, 2016.

Reference Books:

15. Aurélien Géron, "Hands-On Machine Learning with Scikit-Learn, Keras & TensorFlow", O'Reilly, 2019.
16. Sebastian Raschka, "Python Machine Learning", 3rd Edition, Packt Publishing, 2019.

Online Resources:

• Python Official Documentation: [Link]


• Scikit-learn Documentation: [Link]
• Pandas Documentation: [Link]
• NumPy Documentation: [Link]
• Kaggle Datasets: [Link]

Page 23

You might also like