반응형
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
- web
- broscoding
- paragraph
- tensorflow
- java역사
- CES 2O21 참가
- web 사진
- pycharm
- C언어
- 자료구조
- vscode
- 데이터전문기관
- discrete_scatter
- mglearn
- 웹 용어
- bccard
- 머신러닝
- cudnn
- postorder
- html
- web 용어
- CES 2O21 참여
- inorder
- KNeighborsClassifier
- classification
- 대이터
- web 개발
- 재귀함수
- 결합전문기관
- Keras
Archives
- Today
- Total
bro's coding
sklearn.model_selection.cross_val_score.KFold 본문
반응형
from sklearn.model_selection import KFold
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import cross_val_score
from sklearn.datasets import load_iris
iris=load_iris()
kfold=KFold(3) # shuffle = False
from sklearn.model_selection import KFold
kfold=KFold(3) # shuffle = False
socres1=cross_val_score(LogisticRegression(),iris.data,iris.target,cv=kfold)
socres1
# array([0., 0., 0.])
shuffle을 적용하지 않아 세 조각으로 자른게 각 각의 꽃을 자른 모양이라 score이 0이 나온다.
kfold=KFold(3,shuffle = True)
socres1=cross_val_score(LogisticRegression(),iris.data,iris.target,cv=kfold)
socres1
# array([0.98, 0.92, 0.98])
반응형
'[AI] > python.sklearn' 카테고리의 다른 글
sklearn.metrics.confusion_matrix(판정표) (0) | 2020.04.24 |
---|---|
sklearn.model_selection.cross_val_score.LeaveOneOut (0) | 2020.04.24 |
sklearn.cross_val_score.models (0) | 2020.04.24 |
sklearn.model_selection.cross_val_score.StratifiedKFold (0) | 2020.04.24 |
sklearn.model_selection.cross_val_score (0) | 2020.04.24 |
sklearn.manifold. TSNE (0) | 2020.04.23 |
sklearn.neighbors.KNeighborsClassifier.mnist (0) | 2020.04.23 |
sklearn.PCA(2)를 이용한 digit data visualization (0) | 2020.04.23 |
Comments