Python assignment
MCS – 405
1. Using Pandas, load a CSV dataset and compute mean, median, and standard
deviation. Explain why these measures are important.
2. Write a Python program to clean a dataset (handle missing values and
duplicates).Why is data cleaning necessary before analysis?
3. Perform basic EDA using Matplotlib or [Link] histogram and boxplot.
What insights can you derive?
4. Explain [Link] a Python program to generate a correlation matrix
and interpret results.
5. Using NumPy, implement mean and variance [Link] with built-
in functions.
6. Real Estate Price Prediction (Regression Focus)
Dataset: California Housing Prices (Kaggle)
Problem Statement: A real estate investment firm wants to build an automated tool to
predict the median house value in any given district in California based on local
demographics and geographical data.
Tasks:
i. GitHub Setup: Create a new repository and initialize a [Link].
ii. Data Operations: Load the dataset using Pandas. Handle missing values.
iii. Exploratory Data Analysis (EDA): Plot a histogram for median_house_value.
Create a correlation heatmap to see which features (like median_income) correlate
most strongly with house price.
iv. Modeling: Split the data into Training and Testing sets. Train on these models
using Scikit-Learn.
Linear Regression
Ridge/Lasso
XGBoost
v. Evaluation: Calculate the error of the model's predictions. Choose which one
performed best?
RMSE, MAE
Expected Deliverable: A Jupyter Notebook with commented code and a
Markdown conclusion explaining which feature impacts house prices the most.
Learning Outcomes
Regression techniques
Feature engineering
Real-world dataset handling
7. Retail Customer Segmentation (Unsupervised Learning Focus)
Dataset: E-Commerce Data / Online Retail (Kaggle)
Problem Statement: An online retail store wants to launch targeted marketing
campaigns. Since they have no labels for "good" or "bad" customers, they need a data
scientist to find hidden groups (clusters) of similar buyers based on their purchasing
history.
Tasks:
i. Heavy Data Cleaning: Remove cancelled orders (invoice numbers starting with
'C') and drop rows where the CustomerID is missing (Null).
ii. Feature Engineering (RFM): Use [Link]() to calculate three new features
for each customer:
a. Recency: Days since last purchase.
b. Frequency: Total number of purchases.
c. Monetary: Total money spent.
iii. Clustering: Apply the K-Means Clustering algorithm to group customers into 3 to
5 distinct segments.
iv. Data Visualization (2D/3D plots)
v. Business Insight:
High-value customers
Target groups
Expected Deliverable: A Markdown report outlining the specific marketing
strategy the business should use for each of the discovered customer clusters.
Learning Outcomes
Unsupervised learning
Data visualization