과적합 (1) 썸네일형 리스트형 과적합 (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.. 이전 1 다음