Learning machine learning using Scikit-learn under Windows--Installation and configuration

Source: Internet
Author: User

Environment construction process is very troublesome ... But finally is ready, first give some of the process of reference to the more important information (find Microsoft's machine learning materials is a personal experience, without any reference):

1. If the online various numpy, scipy and so on package installation tutorial trouble, go directly to: Microsoft Machine Learning Server to download and install, the way may encounter some problems, mainly PowerShell permissions issues, can go to Microsoft Official documents: PowerShell executes policy issues to find a solution. There may still be a problem with the ability to successfully run PowerShell scripts:

Unable to load file: "...", the file "..." was not digitally signed, and the script could not be run on the current system.

Now let's not worry, find the PowerShell script, right-click Properties. You may see a phrase like "the script may not be running on the current system", and a check box next to the unlock script (seemingly called this) is selected. Then, run PowerShell as an administrator and execute the script to run successfully:

Then wait until the download is complete. As for why download this one can be, the above link has mentioned:

In fact, the version should be the latest edition, so, after the use of anaconda and then according to their own needs to install a variety of packages and so on.

To GitHub scikit-learn Download Scikit-learn, installation methods and so on the link inside, I will not say more.

2. Install it in accordance with other methods on the Internet.

This is to go online to check the information, find a way, I give some information that may be useful:

http://scikit-learn.org/stable/index.htmlhttps://www.anaconda.com/download/#windowshttps://www.scipy.org/ install.htmlhttps://pypi.python.org/pypi/piphttps://pypi.python.org/pypi/numpyhttp://www.numpy.org/http:// blog.csdn.net/m53931422/article/details/42489897

If it's all done, you can test it:

Run cmd in the directory where the Sklearn file is stored, type the command:

Pytest Sklearn

Then enter, if there are no missing hints and some errors should be no problem, or use cmd to open python, type:

Import Sklearn

Then enter, if there is no problem, just a career change, it means no problem.

Several other packages can also be detected using the method above.

To view the version of the package that you installed, you can use the following command:

1. If there is pip.exe:

PIP List

2.Anaconda:

Conda List

  

The entire installation and configuration process I have said so much, this process can fail many times ... But in order to learn more things, still have to be patient step by stage test and find the reason.

Note: I use Windows 10, and maybe my solution does not apply in all cases.

Here is my first example of machine learning:

#参考博客: Http://www.cnblogs.com/magle/p/5878967.htmlimport numpy as Npimport matplotlib.pyplot as Pltfrom sklearn import linear_model# X is the 10x10 Hilbert MatrixX = 1. /(Np.arange (1, one) + np.arange (0, ten) [:, Np.newaxis]) y = np.ones (10) ################################################# ############################### Compute Pathsn_alphas = 200alphas = Np.logspace ( -10,-2, N_alphas) CLF = Linear_model. Ridge (fit_intercept=false) coefs = []for A in Alphas:    clf.set_params (alpha=a)    clf.fit (X, y)    coefs.append ( clf.coef_) ################################################################################ Display resultsax = PLT.GCA () ax.set_color_cycle ([' B ', ' R ', ' G ', ' C ', ' k ', ' y ', ' m ']) Ax.plot (Alphas, Coefs) ax.set_xscale (' log ') Ax.set_xlim (Ax.get_xlim () [:: -1])  # reverse Axisplt.xlabel (' alpha ') Plt.ylabel (' Weights ') plt.title (' Ridge coefficients as a function of the regularization ') Plt.axis (' Tight ') plt.show ()

Operation Result:

I wanted to write with Pycharm, but I couldn't import those bags, so I figured out how to use Pycharm to write machine learning-python.

Finally, through these several explorations learn to find that if you encounter difficulties in learning, the first time to find official documents and some related papers can better save time and solve problems.

--------------------------------------Update 2018-01-01 20:03:17--------------------------------------

Then we looked at the following PowerShell for some execution of the script related things, to find a good article, although the official documents are described, but there are not too many test cases, so want to put the link here:

Http://www.pstips.net/powershell-scripts-signature.html

  

  

Learning machine learning using Scikit-learn under Windows--Installation and configuration

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.