0% found this document useful (0 votes)
4 views

AIML Lab Assignment-1 Set 2

The document outlines a lab assignment for B.Tech students in the 4th semester focused on implementing linear and polynomial regression models using an advertising dataset. Students are instructed to explore the data, prepare it for modeling, implement regression models using scikit-learn, evaluate their performance, and visualize the results. Additional practice questions are provided for further exploration of concepts such as feature scaling and correlation analysis.

Uploaded by

itsprabal26
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

AIML Lab Assignment-1 Set 2

The document outlines a lab assignment for B.Tech students in the 4th semester focused on implementing linear and polynomial regression models using an advertising dataset. Students are instructed to explore the data, prepare it for modeling, implement regression models using scikit-learn, evaluate their performance, and visualize the results. Additional practice questions are provided for further exploration of concepts such as feature scaling and correlation analysis.

Uploaded by

itsprabal26
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

School of Computer Science Engineering and Technology

Course - B.Tech. Semester – 4th


Course Code - CSET301 Course Name - AIML
Year - 2025 Semester - Even

Max. Marks: 2

LAB ASSIGNMENT # 1 SET - 2

Objective
To provide hands-on experience to students in implementing and applying linear and polynomial
regression models and evaluating their performance.

Task Instructions

• Data set download

• Advertising Dataset: Predicting sales based on advertising channels.

• URL: https://www.statlearning.com/s/Advertising.csv

• Data Exploration

• Load the dataset into a DataFrame df.


• Print statistical values (mean, median, standard deviation, etc.) and the shape of the
data.

• Data Preparation:

• Separate the features into X and Y and print the shape.

• Split the dataset into training ‘df_train’ and testing ‘df_test’ set.

• Model Implementation using scikit-learn:

• Linear Regression: Implement a model to predict sales.


• Polynomial Regression: Apply polynomial regression with degrees 2, 3, and 4.
School of Computer Science Engineering and Technology

• Performance Evaluation:

• Evaluate the performance of the implemented model using MSE, RMSE, MAE,
and R2 Score, etc.

• Visualization:
• Plot the regression line for both linear and polynomial regression models to compare
fits visually.

Additional Practice Questions (Not evaluated):

• Perform feature scaling (normalization, standardization) and observe accuracy variations.


• Train models using different train-test splits (60-40, 70-30, 90-10 etc.) and compare results.
• Shuffle training samples using different random seed values and observe model performance.
• Perform correlation analysis between features and target variables. Visualize using a heatmap.

You might also like