반응형
train_test_split
함수를 사용하고 다음과 같이 작성하려고합니다.
from sklearn.model_selection import train_test_split
그리고 이것은
ImportError: No module named model_selection
왜? 그리고 극복하는 방법?
해결 방법
from sklearn.cross_validation import train_test_split
그러나 이제는 model_selection
모듈에 있습니다.
from sklearn.model_selection import train_test_split
따라서 최신 버전이 필요합니다.
버전 0.18
이상으로 업그레이드하려면 다음을 수행하십시오.
pip install -U scikit-learn
(또는 Python 버전에 따라 pip3
). 다른 방법으로 설치했다면, 예를 들어 Anaconda를 사용할 때 다른 방법으로 업데이트해야합니다.
참조 페이지 https://stackoverflow.com/questions/40704484
반응형
'파이썬' 카테고리의 다른 글
파이썬으로 파일 읽기 (0) | 2020.10.26 |
---|---|
파이썬 Tensorflow 백엔드가있는 Keras가 CPU 또는 GPU를 마음대로 사용하도록 강요받을 수 있습니까? (0) | 2020.10.26 |
파이썬 Generating an ascending list of numbers of arbitrary length in python (0) | 2020.10.26 |
파이썬 목록에서 목록을 압축하는 방법 (0) | 2020.10.26 |
파이썬 Python - How to convert JSON File to Dataframe (0) | 2020.10.25 |
댓글