| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- web 용어
- CES 2O21 참가
- inorder
- Keras
- web 사진
- KNeighborsClassifier
- bccard
- paragraph
- classification
- 대이터
- web 개발
- pycharm
- postorder
- broscoding
- C언어
- 웹 용어
- tensorflow
- html
- vscode
- cudnn
- 재귀함수
- 자료구조
- 머신러닝
- CES 2O21 참여
- 결합전문기관
- mglearn
- 데이터전문기관
- discrete_scatter
- java역사
- web
- Today
- Total
목록전체 글 (690)
bro's coding
머신러닝의 분류 1. 지도 학습(supervised learning) -회귀(regression) -분류(classification) 아이리스 같은거 2. 비지도학습(unsupervised learning) -군집(clustering) -특성 분석 이름이 없는데 분류하는것 공룡뼈를 가지고 구분해내는것? 아무 근거가 없는데 분류해야함 -구분 기준은 명찰이 있는지 없는지! 세개로 구분하면 회기, 분류, 군집 데이터를 보고 판단하는것이 아니라 해결 방법이 정해 졌을 때 판단 가능 몸무게를 예측 하라고 했는데 몸무게가 주어짐 : 지도 학습 몸무게를 예측 하라고 했는데 몸무게 없음 : 비지도 학습 몸무게는 정확한 값을 예측이니까 : 회기 이거나 저거냐 일 때는 : 분류 http://solarisailab.com/..
from sklearn.model_selection import train_test_split X_train,X_test,y_train,y_test=train_test_split(iris.data,iris.target,shuffle=False) # shuffle=False : 섞지 않겠다 # 기본 75% / 25% np.bincount(y_test) array([ 0, 0, 38], dtype=int64) from sklearn.model_selection import train_test_split X_train,X_test,y_train,y_test=train_test_split(iris.data,iris.target,shuffle=True) # shuffle=True : 섞겠다 # 기본 75% / 2..
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 (150, 4) iris.feature_names ['sepal length (cm)', 'sepal width (cm)', 'petal length (cm)', 'petal width (cm)'] iris.target_names array(['setosa', 'versicolor', 'virginica'], dtype='
https://broscoding.tistory.com/112 머신러닝.수치근사법 import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import make_blobs data,label=make_blobs(n_samples=500,centers=[[0,0]]) data plt.hlines([0],-10,10,linestyles=':') plt.vlines(.. broscoding.tistory.com X=np.random.randn(500)*5 # 곱하는 수의 절댓값이 커질수록 직선에 가까워진다. y=X+np.random.randn(500) # 곱하는 수에 따라 회전(기울기 개념) pred_y=2*X # 기울기를 변경해 가며 ..
import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import make_blobs data,label=make_blobs(n_samples=500,centers=[[0,0]]) data plt.hlines([0],-10,10,linestyles=':') plt.vlines([0],-10,10,linestyles=':') plt.scatter(data[:,0],data[:,1],alpha=0.3) plt.axis('scaled') data=data*[3,1] plt.hlines([0],-10,10,linestyles=':') plt.vlines([0],-10,10,linestyles=':') plt.scatter(data[:,..
#기울기 : coef(각각의 차원에 대한 기울기) #y절편 : intercept_ # ex: #coef의 결과 : a, b, c #intercept_의 결과 : d # data:XYZ # aX+bY+cZ=d # 각 데이터의 기울기( 가중치 ) : a, b, c # target의 높이 : d -기울기 : coef(각각의 차원에 대한 기울기) -y절편 : intercept_ ex: coef의 결과 : a, b, c intercept_의 결과 : d data:XYZ aX+bY+cZ=d # 각 데이터의 기울기( 가중치 ) : a, b, c # target의 높이 : d model.coef_ array([-0.21027133, 0.22877721, 0.52608818]) a=-0.21027133, b=0.2287..
- 비용함수는 예측한 값과 실제 값과의 차이를 수치화하는 방법(함수)이다. - 위의 결과에서 예측값인 평균값과 실제 데이터의 값들과의 차이로 계산
stochastic gradient descent rng=np.arange(mm-2,mm+2,0.1) plt.plot(rng,((data-rng.reshape(-1,1))**2).mean(axis=1)) plt.vlines([mm],11,15,linestyles=':') plt.ylabel=('MSE') plt.xlabel=('prediction') # 평균일 때, 오차가 가장 작고 # 평균과 멀어지면 오차는 증가한다.
#MAE(절댓값 에러) (np.abs(data-data.mean())).mean() #MSE(제곱 에러) (((data-data.mean())**2)).mean() #RMSE(제곱->루트 에러) np.sqrt((((data-data.mean())**2)).mean())
dist_table=np.array([[(((data[i]-data[j])**2).sum())**0.5 for j in range(150)]for i in range(150)]) array([[0. , 0.53851648, 0.50990195, ..., 4.45982062, 4.65080638, 4.14004831], [0.53851648, 0. , 0.3 , ..., 4.49888875, 4.71805044, 4.15331193], [0.50990195, 0.3 , 0. , ..., 4.66154481, 4.84871117, 4.29883705], ..., [4.45982062, 4.49888875, 4.66154481, ..., 0. , 0.6164414 , 0.64031242], [4.6508063..