전체 글 (20) 썸네일형 리스트형 과적합 (overfitting) 체험 overfitting 체험 오버피팅된 모델의 train data와 test data에 대한 결정계수 비교 import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model from sklearn import svm x = np.random.rand(100,1) x = x * 2 - 1 #y = 4x3 - 3x2 + 2x - 1 y = 4 * x**3 - 3 * x**2 + 2 * x -1 y += np.random.randn(100,1) x_train = x[:30] y_train = y[:30] x_test = x[30:] y_test = y[30:] """ plt.subplot(1,3,1) plt.scatter(x,y.. Non-Linear Regression 비선형 회귀 import math import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model from sklearn import svm from sklearn import ensemble from sklearn import neighbors x = np.random.rand(1000,1) x = x * 20 - 10 y = np.array([math.sin(v) for v in x]) y += np.random.randn(1000) #model = linear_model.LinearRegression() #model = svm.SVR() model = ensemble.RandomForestRegressor() #m.. 머신러닝 4장: regression 머신러닝 4장 슬라이드 다운로드 이전 1 2 3 4 5 6 7 다음 목록 더보기