This project focuses on building a Machine Learning model to classify comments into different categories using Natural Language Processing (NLP) techniques and feature engineering.
The notebook performs:
- Data preprocessing
- Exploratory Data Analysis (EDA)
- Feature engineering
- Text vectorization using TF-IDF
- Model training and evaluation
- Prediction generation
The project combines both textual features and structured metadata features to improve prediction performance.
- Handling missing values
- Cleaning and preparing text data
- Encoding categorical variables
- Date-time feature extraction
- Target distribution visualization
- Word count distribution
- Correlation heatmaps
- Feature vs target analysis
- Word count
- Character count
- Punctuation count
- TF-IDF word features
- Character-level TF-IDF
- Race
- Religion
- Gender
- Disability
- Upvotes / Downvotes
- Date & Time based features
- Python
- Pandas
- NumPy
- Matplotlib
- Seaborn
- Scikit-learn
- TF-IDF Vectorization
- Jupyter Notebook
- Load datasets
- Perform EDA
- Handle missing values
- Extract date features
- Create text-based features
- Encode categorical features
- Apply TF-IDF vectorization
- Train machine learning model
- Evaluate model performance
- Generate predictions
The project uses:
train.csvtest.csvSample.csv
The dataset contains:
- User comments
- Categorical demographic features
- Voting-related features
- Labels for classification
The notebook includes multiple visualizations such as:
- Target Distribution Plot
- Word Count Histogram
- Boxplots
- Correlation Heatmaps
These visualizations help understand:
- Class imbalance
- Feature importance
- Relationships between variables
- Text behavior patterns
.
├── notebook.ipynb
├── train.csv
├── test.csv
├── Sample.csv
└── README.mdgit clone <your-github-repo-link>
cd <repo-name>pip install pandas numpy matplotlib seaborn scikit-learnOpen Jupyter Notebook:
jupyter notebookThen run the notebook step-by-step.
TF-IDF converts text comments into numerical vectors while preserving word importance.
Additional numerical features are extracted from comments and timestamps to improve model learning.
Categorical columns are transformed into numerical format for machine learning compatibility.
Through this project, I learned:
- Natural Language Processing basics
- Text preprocessing techniques
- Feature engineering strategies
- Data visualization
- Machine learning workflow
- Model evaluation techniques
- Apply deep learning models
- Use transformer-based NLP models
- Improve text cleaning pipeline
- Hyperparameter tuning
- Deploy model using Flask or FastAPI
Aditya Kumar
If you found this project useful, feel free to star the repository.