$\color{#3B88C3}\rule{675px}{2px}$
분류 알고리즘
회귀 알고리즘
reshape() : 넘파이 배열 크기 변경 매서드, **지정할 크기=원본 크기**
reshape(-1, x) : -1은 배열의 전체 원소 개수로 채우라는 의미
test_array.reshape(2,2) = np.reshape(test_array, (2,2))
from sklearn.model_selection import train_test_split
train_input, test_input, train_target, test_target = train_test_split(perch_length, perch_weight, random_state=42)
train_input = train_input.reshape(-1,1)
test_input = test_input.reshape(-1,1)
print(train_input.shape, test_input.shape)
from sklearn.neighbors import KNeighborsRegressor
KNR= KNeighborsRegressor()
KNR.fit(train_input, train_target)