Lazy Classification is a machine learning project that focuses on predicting whether a student is lazy or not based on their performance in Math, Physics, and Chemistry subjects.
The project utilizes various machine learning algorithms to perform classification on the given dataset. The code performs the following steps:
-
Importing Libraries: Necessary libraries such as pandas, numpy, seaborn, scikit-learn, and matplotlib are imported.
-
Reading the Dataset: The dataset, named "Student.csv", is read into a pandas DataFrame.
-
Data Preprocessing: Null values are removed from the dataset.
-
Data Visualization: The distribution of marks in the subjects (Maths, Physics, and Chemistry) is visualized using histograms. Outliers are identified using box plots.
-
Data Splitting: The dataset is split into training and testing sets.
-
Feature Scaling: Numerical features are scaled using StandardScaler.
-
Model Training: Several classification algorithms are trained on the training data, including Logistic Regression, Naive Bayes, Support Vector Machines (SVM), K-Nearest Neighbor (KNN), and Decision Tree.
-
Model Evaluation: The trained models are evaluated by calculating accuracy scores and confusion matrices on the testing data.
-
Decision Tree Pruning: The Decision Tree model is pruned using cost complexity pruning, and the optimal alpha value is chosen based on validation scores.
-
Model Saving: The trained Decision Tree model is saved using pickle.
-
Model Loading and Prediction: The saved model is loaded, and predictions are made on new data.
-
Install the required libraries mentioned in the
requirements.txt
file. -
Ensure that the dataset file, "Student.csv", is in the same directory.
-
Run the code in a Python environment, such as Jupyter Notebook or any Python IDE.
-
The trained models can be evaluated, and predictions can be made on new data.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or suggestions, please feel free to reach out to me at [email protected].