- Naive Bayes (Manually Coded) for training and test with both categorical and textual data.
- GaussianNB from sklearn package.
- Decision Tree (Manually Coded) for categorical variables. Pyvis used for visualization.
- scikit-learn Decision Tree implementation with manual encodings. Graphviz used for visualization.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #### 1. Sign up at GitHub.com ################################################ | |
| ## If you do not have a GitHub account, sign up here: | |
| ## https://github.com/join | |
| # ---------------------------------------------------------------------------- | |
| #### 2. Install git ########################################################## | |
| ## If you do not have git installed, please do so: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Print iterations progress | |
| def printProgressBar (iteration, total, prefix = '', suffix = '', decimals = 1, length = 100, fill = '█', printEnd = "\r"): | |
| """ | |
| Source - https://stackoverflow.com/a/34325723/9573439 | |
| Call in a loop to create terminal progress bar | |
| @params: | |
| iteration - Required : current iteration (Int) | |
| total - Required : total iterations (Int) | |
| prefix - Optional : prefix string (Str) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import traceback | |
| from collections import defaultdict | |
| import matplotlib.pyplot as plt | |
| import nltk | |
| from flair.data import Sentence | |
| from flair.models import TextClassifier | |
| from nltk import word_tokenize | |
| from nltk.sentiment.vader import SentimentIntensityAnalyzer | |
| from transformers import pipeline |