This repository contains two Python scripts demonstrating data science skills in tweet analysis. These projects were originally developed as part of Codecademy's portfolio-building exercises.
- Objective: Predict whether a tweet will go viral based on its features such as length, follower count, and retweet count.
- Techniques Used:
- Feature engineering
- Data preprocessing (scaling)
- K-Nearest Neighbors (KNN) classifier to determine optimal
kvalue.
- Libraries: pandas, numpy, scikit-learn, matplotlib
- Objective: Classify tweets' geographic origin (New York, London, or Paris) based on their text content.
- Techniques Used:
- Text preprocessing and vectorization using CountVectorizer
- Naive Bayes classification for text data.
- Libraries: pandas, scikit-learn
- These scripts showcase practical applications of data preprocessing, feature engineering, and machine learning algorithms.
- The
viral_tweets.pyscript demonstrates predictive modeling and hyperparameter tuning using KNN. - The
tweet_location.pyscript highlights text-based classification with Naive Bayes.
- Clone the repository.
- Ensure you have Python 3.6+ installed.
- Install the required libraries using
pip install -r requirements.txt. - Place the necessary JSON datasets (
random_tweets.json,new_york.json,london.json,paris.json) in the same directory as the scripts. These datasets are included in the zip file provided. - Run the scripts:
python viral_tweets.pypython tweet_location.py
These projects are part of Codecademy's data science portfolio, completed to build foundational skills in data analysis and machine learning.
Feel free to explore the scripts and reach out with any questions or suggestions!
Author: Rayan Roshan