Member-only story

IMDB movie review polarity using Naive Bayes Classifier

Develop a naive Bayes algorithm-based machine learning model that predicts sentiment or polarity of an IMDB movie review.

Satyam Kumar
7 min readNov 13, 2018
Photo by Hitesh Choudhary on Unsplash

Introduction:

Naive Bayes is an algorithm that uses Baye’s theorem. Baye’s theorem is a formula that calculates a probability by counting the frequency of given values or combinations of values in a data set [6]. If A represents the prior events, and B represents the dependent event then Bayes’ Theorem can be stated as in equation

Bayes Theorem:

here x if for different words in the review text, Ck is for the class label

p(Ck|x): the probability of class label given text review words x

review text(x) can be represented as {x1,x2,x3, …….. ,xn}

p(Ck|x) ∝ p(Ck|x1,x2,x3, …….. ,xn}

About IMDB movie review dataset:

Data source: https://www.kaggle.com/utathya/imdb-review-dataset

The IMDB Movie Review Dataset consists of text reviews with data frame named as ‘data’

--

--

Responses (1)