This repository contains the tasks I completed during my remote internship in Data Analytics / Data Science at CodeAlpha. It showcases my work, learning, and practical implementation of data analysis and machine learning concepts using Python.
The purpose of this repository is to organize and present all internship tasks in a clear and professional way. Each task includes the problem statement, objective, tools used, implementation steps, results, and key learning outcomes.
During this internship, I worked on practical data science tasks involving:
- Data loading and exploration
- Data cleaning and preprocessing
- Exploratory Data Analysis
- Data visualization
- Machine learning model training
- Model evaluation
- Classification and prediction
- Jupyter Notebook documentation
- Python
- Jupyter Notebook
- Pandas
- NumPy
- Matplotlib
- Scikit-learn
- GitHub
Use measurements of Iris flowers to train a machine learning model that classifies the flower species as:
- Setosa
- Versicolor
- Virginica
The Iris dataset was loaded using Scikit-learn. It contains flower measurements such as:
- Sepal length
- Sepal width
- Petal length
- Petal width
- Loaded the Iris dataset using Scikit-learn
- Converted the dataset into a Pandas DataFrame
- Explored the dataset using basic statistics
- Visualized feature relationships
- Split the data into training and testing sets
- Trained a classification model
- Evaluated model performance using accuracy, confusion matrix, and classification report
- Tested the model on new flower measurements
- Logistic Regression
The model successfully classified Iris flower species based on flower measurements and achieved strong accuracy on the test data.
This task helped me understand basic supervised machine learning classification concepts, including features, target labels, train-test split, model training, prediction, and evaluation.
This project uses two CSV files:
Unemployment in India.csvUnemployment_Rate_upto_11_2020.csv
The main columns analyzed are:
- Region
- Date
- Estimated Unemployment Rate (%)
- Estimated Employed
- Estimated Labour Participation Rate (%)
- Area, where available
- Region group, longitude, and latitude, where available
The Jupyter Notebook follows these seven steps:
- Understand the dataset.
- Clean the dataset.
- Explore the data.
- Visualize unemployment trends.
- Analyze the Covid-19 impact.
- Identify patterns and trends.
- Present final insights.
| Metric | Result |
|---|---|
| Average unemployment before Covid | 9.51% |
| Average unemployment during early Covid lockdown shock | 24.26% |
| Average unemployment after early shock | 11.90% |
| Peak unemployment month | May 2020 |
| Peak monthly unemployment rate | 24.88% |
| Average urban unemployment | 13.17% |
| Average rural unemployment | 10.32% |
| region | unemployment_rate |
|---|---|
| Tripura | 28.3504 |
| Haryana | 26.2832 |
| Jharkhand | 20.585 |
| Bihar | 18.9182 |
| Himachal Pradesh | 18.5404 |
| region | unemployment_rate |
|---|---|
| Gujarat | 6.66393 |
| Uttarakhand | 6.58296 |
| Assam | 6.42808 |
| Odisha | 5.65786 |
| Meghalaya | 4.79889 |
| region | unemployment_rate |
|---|---|
| Puducherry | 75.4167 |
| Jharkhand | 57.1175 |
| Bihar | 47.2475 |
| Tamil Nadu | 40.855 |
| Haryana | 40.295 |
The dataset shows a strong unemployment spike around April and May 2020. This suggests that the early Covid-19 lockdown period had a major effect on unemployment in India.
The analysis also shows that urban unemployment was generally higher than rural unemployment in this dataset. Some regions were affected much more strongly than others, which means regional policy responses are important.
This project was completed as Task 3 of the CodeAlpha Data Science Internship.
The goal of this project is to build a machine learning model that predicts the selling price of a used car based on features such as present price, age, mileage, fuel type, transmission, ownership history, seller type, and brand.
- Load and understand the used-car dataset
- Clean the data and check for missing values and duplicate rows
- Perform exploratory data analysis
- Create useful features such as
Car_AgeandBrand - Study the correlation between numerical features
- Remove redundant and highly correlated features
- Prepare numerical and categorical variables for machine learning
- Train and compare multiple regression models
- Evaluate the models using suitable regression metrics
- Tune the best-performing model
- Analyze feature importance and prediction errors
- Save the trained model for future predictions
The dataset used in this project is the Car Price Prediction β Used Cars dataset available on Kaggle.
Kaggle dataset path used in the notebook:
/kaggle/input/datasets/vijayaadithyanvg/car-price-predictionused-cars/car data.csv| Column | Description |
|---|---|
Car_Name |
Name or model of the car |
Year |
Manufacturing year |
Selling_Price |
Price at which the car was sold |
Present_Price |
Current showroom or market price |
Driven_kms |
Total kilometres driven |
Fuel_Type |
Petrol, Diesel, or CNG |
Selling_type |
Dealer or Individual |
Transmission |
Manual or Automatic |
Owner |
Number or category of previous owners |
The target variable is:
Selling_Price
The dataset is loaded using Pandas and inspected using:
head()shapeinfo()describe()
The notebook performs the following cleaning steps:
- Removes duplicate rows
- Checks missing values
- Removes unnecessary spaces from text columns
- Converts numerical columns to the correct data type
- Handles invalid negative values
- Removes rows with a missing target value
Two additional features are created:
Car_Age = Reference_Year - YearCar_Age is more meaningful for prediction than the original manufacturing year.
The first word of Car_Name is extracted and used as the car brand.
Example:
Maruti Swift -> maruti
Honda City -> honda
Toyota Corolla -> toyota
The notebook includes visualizations for:
- Selling price distribution
- Present price versus selling price
- Car age versus selling price
- Kilometres driven versus selling price
- Median selling price by fuel type
- Median selling price by seller type
- Median selling price by transmission type
A numerical correlation matrix is created to study relationships between features.
Highly correlated features are identified using a threshold of:
0.90Year is removed because it contains the same information as Car_Age.
A Scikit-learn preprocessing pipeline is used.
- Missing-value imputation using the median
- Feature standardization using
StandardScaler
- Missing-value imputation using the most frequent category
- One-hot encoding using
OneHotEncoder
Using a pipeline helps prevent data leakage.
The following regression models are trained and compared:
- Linear Regression
- Ridge Regression
- Lasso Regression
- Random Forest Regressor
- Extra Trees Regressor
- Gradient Boosting Regressor
The models are evaluated using:
- MAE β Mean Absolute Error
- RMSE β Root Mean Squared Error
- RΒ² Score
- 5-Fold Cross-Validation
Lower MAE and RMSE values indicate better performance, while a higher RΒ² score indicates a stronger model.
The best tree-based model is selected and tuned using:
RandomizedSearchCVThis improves model performance by testing different combinations of parameters.
The final model is analyzed using:
- Actual versus predicted values
- Residual plots
- Residual distribution
- Largest prediction errors
Permutation feature importance is used to determine which features contribute most to the model's predictions.
The trained model and project outputs are saved as:
car_price_prediction_model.joblib
car_price_model_comparison.csv
car_price_test_predictions.csv
car_price_feature_importance.csv
The dataset covers a limited time period, so it is better to describe the patterns as monthly trends rather than strong long-term seasonal trends. A true seasonal analysis usually requires multiple years of data.