DataConversionWarning: A column-vector y was passed when a 1d array was expected. > PYTHON 프로그래밍

본문 바로가기

PYTHON 프로그래밍

PYTHON 프로그래밍

10. DataConversionWarning: A column-vector y was passed when a 1d array wa…

페이지 정보

작성자 관리자 댓글 0건 조회 6,854회 작성일 20-08-08 15:10

본문

10. DataConversionWarning: A column-vector y was passed when a 1d array wa…

# vi train1.py 


clf = LogisticRegression()

clf.fit(x, y)


[root@localhost api]# python3 train1.py

/usr/local/lib/python3.7/site-packages/sklearn/utils/validation.py:73: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel().


# vi train1.py

clf = LogisticRegression()
clf.fit(x, y.values.ravel())

[root@localhost api]# python3 train1.py 

에러가 없어졌을 것이다.


Copyright © LEELAB.CO.KR. All rights reserved.