반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
Tags
- broscoding
- classification
- web 개발
- vscode
- 자료구조
- 머신러닝
- html
- CES 2O21 참가
- cudnn
- web 용어
- C언어
- 재귀함수
- pycharm
- bccard
- mglearn
- inorder
- web
- CES 2O21 참여
- tensorflow
- web 사진
- KNeighborsClassifier
- 대이터
- postorder
- 웹 용어
- paragraph
- 결합전문기관
- discrete_scatter
- Keras
- java역사
- 데이터전문기관
Archives
- Today
- Total
bro's coding
sklearn.feature_extraction.text.CountVectorizer.stop_words적용 본문
[AI]/python.sklearn
sklearn.feature_extraction.text.CountVectorizer.stop_words적용
givemebro 2020. 4. 28. 10:33반응형
# Stop_words 적용
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.naive_bayes import BernoulliNB
num_of_words=[]
scores_BernoulliNB=[]
vect=CountVectorizer(stop_words='english')
vect.fit(text_train)
num_of_words.append(len(vect.get_feature_names()))
X_train=vect.transform(text_train)
X_test=vect.transform(text_test)
model=BernoulliNB()
model.fit(X_train,y_train)
scores_BernoulliNB.append(model.score(X_test,y_test))
display(num_of_words,scores_BernoulliNB)
[75600]
[0.8172]
반응형
'[AI] > python.sklearn' 카테고리의 다른 글
sklearn.feature_extraction.text.CountVectorizer.ngram.LogisticRegression.2단어들만 출력 (0) | 2020.04.28 |
---|---|
sklearn.feature_extraction.text.CountVectorizer.ngram_range적용 (0) | 2020.04.28 |
sklearn.feature_extraction.text.TfidfTransformer.LogisticRegression적용 (0) | 2020.04.28 |
sklearn.feature_extraction.text.TfidfTransformer (0) | 2020.04.28 |
sklearn.feature_extraction.text.CountVectorizer.max_df변화 관찰 (0) | 2020.04.28 |
sklearn.feature_extraction.text.CountVectorizer.min_df변화 관찰 (0) | 2020.04.28 |
sklearn.textdata.BernoulliNB적용 (0) | 2020.04.28 |
sklearn.textdata.LogisticRegression적용 (0) | 2020.04.27 |
Comments