7강 - 사이킷런으로 선형 회귀 모델 만들어 보기
7강 - 사이킷런으로 선형 회귀 모델 만들어 보기 지난 시간에... 아주 큰 농어 왜 예측과 달랐을까? 50cm 농어의 이웃 # 50cm 농어의 이웃을 구합니다 distances, indexes = knr.kneighbors([[50]]) # 훈련 세트의 산점도를 그립니다 plt.scatter(train_input, train_target) # 훈련 세트 중에서 이웃 샘플만 다시 그립니다 plt.scatter(train_input[indexes], train_target[indexes], marker='D') # 50cm 농어 데이터 plt.scatter(50, 1033, marker='^') plt.show() 길이가 늘어나면 무게도 늘어나야 하는데 최근접이웃은 가장 가까이에 있는 샘플만 이웃 샘플이 ..
2021.06.17