upgrade to dev version of scikit-learn on Anaconda

2019-02-06 14:41发布

I'm using python through Anaconda, and would like to use a new feature (http://scikit-learn.org/dev/modules/neural_networks_supervised.html) in scikit-learn that's currently only available in the development version 0.18.dev0.

However, doing the classical conda update doesn't seem to work, as conda doesn't list any dev packages. What would be the simplest way to install a development version into my Anaconda? (For what it's worth, I'm using 64-bit windows 7.)

3条回答
爷的心禁止访问
2楼-- · 2019-02-06 14:57

You can only use conda to install a package if someone has built and made available binaries for the package. Some packages publish nightly builds that would allow this, but scikit-learn is not one of them.

To install the bleeding-edge version in one command, you could use pip; e.g.:

$ conda install pip
$ pip install git+git://github.com/scikit-learn/scikit-learn.git

but keep in mind that this requires compiling all the C extensions within the library, and so it will fail if your system is not set up for that.

查看更多
【Aperson】
3楼-- · 2019-02-06 15:07

You should build your own scikit-learn package on Anaconda. I did it in about 10 mins (repo)(package). The conda tutorial on how to build packages was helpful. There are probably more ways than one to do this, but I just downloaded the scikit-learn github repo, dropped it into a new repo, added a directory that housed my conda recipe, and then built the package from the recipe which pointed to the source code I just downloaded.

查看更多
虎瘦雄心在
4楼-- · 2019-02-06 15:18

I had scikit-learn 0.17 which did not have MLPClassifier. I just did a conda update like below:

conda update scikit-learn

conda takes care of updating all dependent packages and after the update it works!

查看更多
登录 后发表回答