5_gradient_boosting에서 코드에러가 납니다.

18.08.17 17:03 작성 조회수 90

0

train_X, test_X, train_y, test_id_idx = hourse_price_preprocessor.get_train_test_split_dataset(train_dataset_dir, test_dataset_dir)

에서

AttributeError Traceback (most recent call last)

in ()

----> 1 train_X, test_X, train_y, test_id_idx = hourse_price_preprocessor.get_train_test_split_dataset(train_dataset_dir, test_dataset_dir)

~\OneDrive\2018\computer\ml\code\ch13_Ensemble\hourse_price_preprocessor.py in get_train_test_split_dataset(train_dataset_filename, test_dataset_filename)

53 #Train

54 x_scaled_data = np.hstack((x_quality_scaled,x_quantitiy_scaled))

---> 55 Y_scaled_data = target_value.reshape(-1,)

56

57

C:\ProgramData\Miniconda3\lib\site-packages\pandas\core\generic.py in __getattr__(self, name)

4374 if self._info_axis._can_hold_identifiers_and_holds_name(name):

4375 return self[name]

-> 4376 return object.__getattribute__(self, name)

4377

4378 def __setattr__(self, name, value):

AttributeError: 'Series' object has no attribute 'reshape'

라고 에러납니다. Series는 reshape가 안된다네요..! preprocessor파일 따로 수정한적이 없는데 실행한 파일과 올려주신파일이 다른걸까요?

답변 1

답변을 작성해보세요.

0

기본적으로 데이터를 dir 패스에 제대로된 파일만 들어간다면 따로 에러가 안나게 설정되어 있습니다. 혹시 파일 자체를 수정하거나 다른 파일을 넣은건 아닌지 확인 부탁드리겠습니다.