반응형
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 |
Tags
- 머신러닝
- 데이터전문기관
- 대이터
- classification
- postorder
- web
- 결합전문기관
- KNeighborsClassifier
- web 개발
- 웹 용어
- Keras
- 자료구조
- CES 2O21 참가
- web 사진
- java역사
- pycharm
- html
- CES 2O21 참여
- broscoding
- web 용어
- tensorflow
- cudnn
- vscode
- C언어
- paragraph
- bccard
- discrete_scatter
- 재귀함수
- inorder
- mglearn
Archives
- Today
- Total
bro's coding
sklearn.kernel 기법 기초 본문
반응형
https://broscoding.tistory.com/145
머신러닝.make_circles 사용하기
import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.datasets import make_circles X,y=make_circles(factor=0.5,noise=0.1) # factor = R2/R1, noise= std) plt.scatter(X[:,..
broscoding.tistory.com
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.datasets import make_circles
X,y=make_circles(factor=0.5,noise=0.1) # factor = R2/R1, noise= std)
plt.scatter(X[:,0],X[:,1],c=y)
plt.colorbar()
from sklearn.linear_model import LogisticRegression
model=LogisticRegression(C=10000)
model.fit(X,y)
model.score(X,y)
# 0.52
import mglearn
mglearn.plots.plot_2d_classification(model,X,y)
mglearn.discrete_scatter(X[:,0],X[:,1],y)
r=np.sqrt((X**2).sum(axis=1)).reshape(-1,1)
model=LogisticRegression(C=10000)
model.fit(r,y)
model.score(r,y)
# 1.0
-model.intercept_/model.coef_
# array([[0.72796165]])
반응형
'[AI] > python.sklearn' 카테고리의 다른 글
sklearn.svm.SVC.decision bounds (0) | 2020.04.17 |
---|---|
sklearn.svm.SVC and normalization(breast cancer) (0) | 2020.04.16 |
sklearn.svm.SVC(kernel 기법) (0) | 2020.04.16 |
sklearn.svm.LinearSVC.kernel 기법(타원형 데이터) (0) | 2020.04.16 |
머신러닝.make_circles 사용하기 (0) | 2020.04.16 |
머신러닝.상관계수 구하기 (0) | 2020.04.16 |
머신러닝.Pearson correlation coefficient(피어슨 상관 계수) (0) | 2020.04.14 |
머신러닝.linearSVM(class:3) (0) | 2020.04.14 |
Comments