Pandas: 데이터 분석 및 조작 라이브러리
Matplotlib: 데이터 시각화 라이브러리
Seaborn: 더 높은 수준의 데이터 시각화 라이브러리
WordCloud: 텍스트 데이터 시각화
re: 정규 표현식을 이용한 함수 제공(pre-process strings)
CountVectorizer: text를 벡터로 변환
GridSearchCV: 하이퍼파라미터 튜닝
RandomForestClassifier: 분류를 위한 ML 알고리즘
Accuracy Score: 분류와 총합 예시
Precision Score: 올바르게 예측/ 전체 postive instances
Recall score: 올바르게 예측/ 전체 instances
RocCurve: a plot of true positive rate against false positive rate
Classification Report: precision, recall and f1 score 내용
Confusion Matrix: 분류 모델을 표로 묘사
New function
정규식 활용: 알파벳이 아닌 문자 제거
소문자로 전환: Good -> good
Stopwords 제거
lemmatization
text representation in the form of a bag of words
단어 발생 총 횟수를 묘사한다
Scikit-learn에서 CountVectorizer 사용
Ngram: 띄워쓰기 개념
Estimator or model: RandomForestClassifier이용
parameters: 하이퍼파라미터 이름과 값 모음
cv: signifies cross -validation folds
return_train_score: 다양한 모델의 훈련 값 return
n_jons: run paralley
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from wordcloud import WordCloud
import re
from matplotlib import style,rcParams
style.use('seaborn-white')
rcParams['figure.figsize'] = 10,5
import warnings
warnings.filterwarnings('ignore')
import nltk
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import GridSearchCV
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score,precision_score,recall_score,confusion_matrix,roc_curve,classification_report
from scikitplot.metrics import plot_confusion_matrix