# Sentiment Analysis of Nepali Sentences Model Building

In this blogging series, we discussed different approaches and concepts of sentiment analysis of Nepali sentences. Preprocessing, Vectorization is an important part. In this article, we make a model using siket learn. Naive Bayes algorithm is used, to Sentiment Analysis of Nepali Sentences Model Building series of discussion.

##### Train Test

The first phase of the Sentiment Analysis of Nepali Sentences Model Building is train test split. In the Machine Learning process, some data are used to train model to recognize patterns. In this project, I used 80/20 i.e eighty percent data used to train model and 20 percent data used to make tests.

##### Build Model

Model building is a process of train or taught machine learning models through the algorithm. In this project, I used the Naive Bayes(Gaussian Naive Bayes) algorithm to train/build the model. Naive Bayes is a probability-based model. It makes some decisions based on a higher probability result.

After train the model we save our model using a python pickle file. Pickel file is an object file that contains the non-readable character. Pickel file prevent repeated computation for model building on each run. In machine learning model computation is highly expensive and time-consuming. We need to save the model after training for further computation like a prediction.

In this project I used Naive Bayes model to make model but after vectorized the data we can use any of the classification algorithm.SVM , Decision Tree and many more can be used.

##### Confusion matrix

Confusion matrix is table contains our model accuracy. Generally, in the confusion matrix, we calculate three-parameter.

##### Precision

Precision is the ratio of correctly predicted positive observations to the total predicted positive observations.

Precision = TP/TP+FP

##### Recall

Recall is the ratio of correctly predicted positive observations to the all observations in actual class – yes.

Recall = TP/TP+FN

##### FScore

F1 Score is the weighted average of Precision and Recall.

F1 Score = 2*(Recall * Precision) / (Recall + Precision)