PYTHON 프로그래밍

본문 바로가기
사이트 내 전체검색


PYTHON 프로그래밍
PYTHON 프로그래밍

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

페이지 정보

작성자 관리자 댓글 0건 조회 3,801회 작성일 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 

에러가 없어졌을 것이다.

댓글목록

등록된 댓글이 없습니다.


개인정보취급방침 서비스이용약관 모바일 버전으로 보기 상단으로

TEL. 063-469-4551 FAX. 063-469-4560 전북 군산시 대학로 558
군산대학교 컴퓨터정보공학과

Copyright © www.leelab.co.kr. All rights reserved.