GithubHelp home page GithubHelp logo

pbrebner / text-classifier-with-scikit-learn Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.71 MB

Classification of IMDB Reviews dataset and News Group dataset using Logistic Regression, Decision Trees, Support Vector Machines, Ada Boost and Random Forest. Methods and Accuracy of each model were compared and reported

Jupyter Notebook 100.00%
machine-learning machine-learning-algorithms logisitic-regression decision-trees support-vector-machines ada-boost-classifier random-forest pipeline

text-classifier-with-scikit-learn's Introduction

Text Classifier with Scikit-Learn

Classification of Textual Data using the following machine learning models: Logistic Regression, Decision Trees, Support Vector Machines, Ada Boost, and Random Forest. The project goal is to determine whine machine learning algorithm performs the best and text classification/sentiment analysis.

writeup.pdf: The main report of the project

Datasets

Two textual datasets were used to test the machine learning algorithms

20 NewsGroups Dataset

The 20 Newsgroups dataset is a collection of approximately 20,000 newsgroup documents, partitioned (nearly) evenly across 20 different newsgroups.

Supervised learning algorithms will require a category label for each document in the training set. In this case the category is the name of the newsgroup which also happens to be the name of the folder holding the individual documents.

IMDB_Reviews Dataset

The IMDB Review dataset contains movie reviews along with associated binary sentiment polarity labels.The main dataset contains 50,000 reviews split evenly between a train and test set (25,000 each). The distribution of positive and negative labels are balanced.

In the entire dataset, no more than 30 movie reviews are allowed for the same movie. This is because reviews for the same movie tend to have correlation. Further, the train and test sets contain a disjoint set of movies, so no significant performance is obtained by memorizing movie-unique terms and their associated with observed labels.

For the train/test set a negative review has a score <= 4 out of 10 and a positive review has a score >= 7 out of 10. Reviews with a more neutral score were not included in the dataset.

Jupyter Notebook Files:

  1. NewsGroup Dataset.ipynb : Loading, Text Preprocessing, and Multi-Class Classification of the 20 NewsGroup Dataset
  2. IMDB_Reviews_Dataset_tfidf: Loading, tect Preprocessing (Unigram with no text normalization) and Classification of the IMDB Dataset
  3. IMDB_Reviews_Dataset_tfidf_stemming: Loading, Text Preprocessing (Unigram with Stemming) and Classifcation of IMDB Dataset
  4. IMDB_Reviews_Dataset_tfidf_lemming: Loading, Text Preprocessing (Unigram with Lemmatization) and Classifcation of IMDB Dataset
  5. IMDB_Reviews_Dataset_tfidf_bigram: Loading, text Preprocessing (Bigram with no text normalization) and Classifcation of IMDB Dataset

Each Jupyter Notebook file will download/load the respective dataset and run through the required text preprocessing and classifcation models. The IMDB Dataset jupyter notebook files are all the same except for the preprocessing technique used before classification. The IMDB_Reviews_Dataset_tfidf uses the same preprocessing techniques as the NewsGroup Dataset jupyter notebook file.

Please read writeup.pdf for full results and discussion. You can download the PDF to view it: Download PDF.

text-classifier-with-scikit-learn's People

Contributors

pbrebner avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.