What to do if you can't use scikit grid search in Python

When I wrote the code and compiled it with the intention of using scikit-learn's grid search with python (ver 3.6.1), something got stuck and a warning came out.

↓ I wrote it in the source and got caught.

from sklearn.grid_search import GridSearchCV

↓ Warning that came out after compiling (By the way, I am doing it on Mac)

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/sklearn/cross_validation.py:
44: DeprecationWarning: 
This module was deprecated in version 0.18 in favor of the model_selection module into 
which all the refactored classes and functions are moved. 
Also note that the interface of the new CV iterators are different from that of this module. 
This module will be removed in 0.20.
  "This module will be removed in 0.20.", DeprecationWarning)
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/sklearn/grid_search.py:
43: DeprecationWarning: 
This module was deprecated in version 0.18 in favor of the model_selection module into 
which all the refactored classes and functions are moved. This module will be removed in 0.20.
  DeprecationWarning)

When the Warning is deciphered, it seems that it was deleted when the module version went up from "0.18" to "0.20"? After trying various things with a kettle, I was able to use it safely by playing with the description of the python source.

from sklearn.model_selection import GridSearchCV

If you stumble in a similar place, please try it!

Recommended Posts

What to do if you can't use scikit grid search in Python
What to do if you can't use the trash in Lubuntu 18.04.
What to do if you can't log in as root
What to do if you can't use WiFi on Linux
How to install and use pyenv, what to do if you can't switch python versions
What to do if you can't hit the arrow keys in the Python interactive console
What to do if you can't install pyaudio with pip #Python
What to do if you get a minus zero in Python
What to do if you can't pipenv shell
What to do if you can't find PDO in Laravel or CakePHP
What to do if you can't install with pip in babun environment
What to do if you can't pip install mysqlclient
What to do when you can't bind CaboCha to Python
What to do if you get "Python not configured." Using PyDev in Eclipse
What to do if ʻarguments [0] .scrollIntoView ();` fails in python selenium
What to do if you get "coverage unknown" in Coveralls
What to do if you can't sort files with subscripts
What to do if you get `No kernel for language python found` in Hydrogen
What to do if you get an error when importing matplotlib in Python (Mac)
What to do if you run python in IntelliJ and end with an error
What to do if you can't build your project with Maven
What to do if you get Swagger-codegen in python and Import Error: No module named
What to do if you can't find well with grep's -f option
What to do if pipreqs results in UnicodeDecodeError
What to do if you couldn't send an email to Yahoo with Python.
What to do if you get lost in file reference with FileNotFoundError
What to do if you get angry in TensorFlow v2 without attribute'app'
What to do if No Python documentation found for ... appears in pydoc
If you want to count words in Python, it's convenient to use Counter.
What to do to get google spreadsheet in python
What happens if you do "import A, B as C" in Python?
After all, what should I use to do type comparisons in Python?
What to do if you get angry with "Value Error: unknown local: UTF-8" in python manage.py syncdb
[Python] What to do if you get a ModuleNotFoundError when importing pandas using Jupyter Notebook in Anaconda
[Python] What to do if an error occurs in pip (pyinstaller, pyautogui, etc.)
What to do if you get a "No versions found" error in pipenv
What to do if a Unicode Encode Error occurs in Sublime Text Python
What to do if you get an error when installing python with pyenv
What to do if pip install fails in Xcode 5.1
No module named What to do if you get'libs.resources'
ModuleNotFoundError: No module What to do if you get'tensorflow.contrib'
% And str.format () in Python. Which one do you use?
What to do if a UnicodeDecodeError occurs in pip
What to do if you get an OpenSSL error when installing Python 2 with pyenv
What to do if the Microsoft Store opens even if you run python on Windows
What to do if the print command itself causes an error in Maya python
What to do if you get "(35,'SSL connect error')" in pycurl (one of them)
What to do if the progress bar is not displayed in tqdm of python
What to do if Python IntelliSense is not displayed in VS Code on Windows
What to do if Sort imports get stuck in VS Code's Python Extension (around 2020/09)
What to do if you don't want to use Japanese column names when using ortoolpy.logistics_network
What to do if Python does not switch from the System version in pyenv
What to do if you get the error RuntimeError: Python is not installed as a framework when trying to use matplitlib and pylab in Python 3.3
Why do you add a main ()-if statement in Python?
[Python version] Why can't you do object-oriented development in Java?
What to do if you are addicted to Windows character code
If you write TinderBot in Python, she can do it
What to do if pip gives a DistributionError in Homebrew
What to do if a 0xC0000005 error occurs in tf.train.start_queue_runners ()
[Road to intermediate Python] Use if statement in list comprehension
What to do when "SSL: CERTIFICATE_VERIFY_FAILED _ssl.c: 1056" appears in Python