일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- bccard
- vscode
- web 사진
- postorder
- 결합전문기관
- classification
- pycharm
- 데이터전문기관
- inorder
- KNeighborsClassifier
- mglearn
- web
- CES 2O21 참여
- C언어
- 웹 용어
- tensorflow
- web 개발
- 재귀함수
- 자료구조
- html
- broscoding
- web 용어
- 머신러닝
- cudnn
- discrete_scatter
- paragraph
- CES 2O21 참가
- Keras
- java역사
- 대이터
- Today
- Total
목록분류 전체보기 (689)
bro's coding

1 iris data에서 속성 : SL,SW에 대해 (col : 0, 1) 꽃 별로 선형 회귀선 을 그리시오 model : linear regression https://broscoding.tistory.com/126?category=855525 1-1 iris data에서 속성 : SL,SW에 대해 (col : 0, 1) MSE,RMSE,MAE,model.score(X,y) 를 구하시오 model : linear regression https://broscoding.tistory.com/126?category=855525 2 wine data file에서 (sklearn load 아님 numpy loadtxt) winequality-red model : linear regression 을 이용해서 등급..

X=iris.data[50:,[0]] y=iris.data[50:,1] model=LinearRegression() model.fit(X,y) model.score(X,y) model.coef_, model.intercept_ # (array([0.27804192]), 1.1309015164752294) xxx=[X.min()-0.5,X.max()+0.5] yyy=model.coef_*xxx+model.intercept_ # 기울기 : w(weight)=coef_ ,절편 : b(ax+b)=intercept_ plt.scatter(X,y) plt.plot(xxx,yyy,'r:')

X=iris.data[:,:3] # 만약 X=iris.data[:,3] 이렇게 넣으면 차원이 맞지 않는다. # ex) error : x=[1,2,3] -> # sol1 ) X=[[1],[2],[3]] # sol2 ) X=iris.data[:,[2]] # sol3 ) X=iris.data[:,2].reshape(-1,1) # because : X는 2차원 형태여야 한다. y=iris.data[:,3] from sklearn.model_selection import train_test_split X_train,X_test,y_train,y_test=train_test_split(X,y) from sklearn.linear_model import LinearRegression model=LinearRegres..

# data 준비 X=iris.data y=iris.target # score 수집 scores=[] for i in range(4): col=(np.array([1,2,3])+i)%4 train_X,test_X,train_y,test_y=train_test_split(X[:,col],y) ''' print(col) [1 2 3] [2 3 0] [3 0 1] [0 1 2] ''' # model 설정(k=5) model=KNeighborsClassifier(5) # model 훈련 model.fit(train_X,train_y) # score 수집 scores.append(model.score(test_X,test_y)) # 시각적 표현 plt.plot(scores) plt.xticks([0,1,2,3])..

https://broscoding.tistory.com/114 머신러닝.iris data 불러오기 import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import load_iris iris=load_iris() iris dir(iris) ['DESCR', 'data', 'feature_names', 'target', 'target_names'] iris.data.shape.. broscoding.tistory.com https://broscoding.tistory.com/115 머신러닝.테스트데이터 뽑기 from sklearn.model_selection import train_test_split X_train,X_test,y..

# 속성 컨트롤 col1=3 col2=1 X=iris.data[:,[col1,col2]] y=iris.target test_scores=[] train_scores=[] index=range(1,30) X_train,X_test,y_train,y_test=train_test_split(X,y) for k in index: model=KNeighborsClassifier(n_neighbors=k) model.fit(X_train,y_train) test_scores.append(model.score(X_test,y_test)) train_scores.append(model.score(X_train,y_train)) #plt.title('K에 따른 score변화') plt.plot(index,test_sco..

# 속성 컨트롤 col1=0 col2=1 X=iris.data[:,[col1,col2]] y=iris.target X_train,X_test,y_train,y_test=train_test_split(X,y) model=KNeighborsClassifier(n_neighbors=3) # n_neighbors=3 model.fit(X_train,y_train) for i in range(1,10): model=KNeighborsClassifier(n_neighbors=i) # n_neighbors=i model.fit(X_train,y_train) # model 훈련 plt.figure(figsize=[10,8]) # 그래프 사이즈 mglearn.plots.plot_2d_classification(model..

import mglearn model=KNeighborsClassifier(n_neighbors=1) # n_neighbors=1 model.fit(X_train,y_train) plt.figure(figsize=[10,8]) # 그래프 사이즈 mglearn.plots.plot_2d_classification(model,X_train,fill=True,eps=0.5,alpha=0.4) # 바탕색과 관련 mglearn.discrete_scatter(X_train[:,0],X_train[:,1],y_train) # train data에 대한 산점도 #mglearn.discrete_scatter(X_test[:,0],X_test[:,1],y_test) # test data에 대한 산점도 plt.figure(f..
경계 영역을 표시하기 위해 별도의 모듈 설치 # anaconde prompt 에서 명령 pip install mglearn
머신러닝의 분류 1. 지도 학습(supervised learning) -회귀(regression) -분류(classification) 아이리스 같은거 2. 비지도학습(unsupervised learning) -군집(clustering) -특성 분석 이름이 없는데 분류하는것 공룡뼈를 가지고 구분해내는것? 아무 근거가 없는데 분류해야함 -구분 기준은 명찰이 있는지 없는지! 세개로 구분하면 회기, 분류, 군집 데이터를 보고 판단하는것이 아니라 해결 방법이 정해 졌을 때 판단 가능 몸무게를 예측 하라고 했는데 몸무게가 주어짐 : 지도 학습 몸무게를 예측 하라고 했는데 몸무게 없음 : 비지도 학습 몸무게는 정확한 값을 예측이니까 : 회기 이거나 저거냐 일 때는 : 분류 http://solarisailab.com/..