使用 Python 开始你的机器学习之旅
机器学习 ML Python

> 
> 机器学习是你的简历中必需的一门技能。我们简要概括一下使用 Python 来进行机器学习的一些步骤。
> 
> 
> 


![Get started with machine learning using Python](/data/attachment/album/201706/07/091219dd15wiwukzlubid0.png "Get started with machine learning using Python")


你想知道如何开始机器学习吗？在这篇文章中，我将简要概括一下使用 [Python](https://opensource.com/article/17/2/3-top-machine-learning-libraries-python) 来开始机器学习的一些步骤。Python 是一门流行的开源程序设计语言，也是在人工智能及其它相关科学领域中最常用的语言之一。机器学习简称 ML，是人工智能的一个分支，它是利用算法从数据中进行学习，然后作出预测。机器学习有助于帮助我们预测我们周围的世界。


从无人驾驶汽车到股市预测，再到在线学习，机器学习通过预测来进行自我提高的方法几乎被用在了每一个领域。由于机器学习的实际运用，目前它已经成为就业市场上最有需求的技能之一。另外，使用 Python 来开始机器学习很简单，因为有大量的在线资源，以及许多可用的 [Python 机器学习库](https://opensource.com/article/17/2/3-top-machine-learning-libraries-python)。


你需要如何开始使用 Python 进行机器学习呢？让我们来总结一下这个过程。


### 提高你的 Python 技能


由于 Python 在工业界和科学界都非常受欢迎，因此你不难找到 Python 的学习资源。如果你是一个从未接触过 Python 的新手，你可以利用在线资源，比如课程、书籍和视频来学习 Python。比如下面列举的一些资源：


* [Python 学习之路](https://learnpythonthehardway.org/book/)
* [Google 开发者 Python 课程（视频）](https://www.youtube.com/playlist?list=PLfZeRfzhgQzTMgwFVezQbnpc1ck0I6CQl)
* [Google 的 Python 课堂](https://developers.google.com/edu/python/)


### 安装 Anaconda


下一步是安装 [Anacona](https://opensource.com/tags/javascript?src=programming_resource_menu)。有了 Anaconda ，你将可以开始使用 Python 来探索机器学习的世界了。Anaconda 的默认安装库包含了进行机器学习所需要的工具。


### 基本的机器学习技能


有了一些基本的 Python 编程技能，你就可以开始学习一些基本的机器学习技能了。一个实用的学习方法是学到一定技能便开始进行练习。然而，如果你想深入学习这个领域，那么你需要准备投入更多的学习时间。


一个获取技能的有效方法是在线课程。吴恩达的 Coursera [机器学习课程](https://www.coursera.org/learn/machine-learning) 是一个不错的选择。其它有用的在线训练包括：


* [Python 机器学习： Scikit-Learn 教程](https://www.datacamp.com/community/tutorials/machine-learning-python#gs.HfAvLRs)
* [Python 实用机器学习教程](https://pythonprogramming.net/machine-learning-tutorial-python-introduction/)


你也可以在 [LiveEdu.tv](https://www.liveedu.tv/) 上观看机器学习视频，从而进一步了解这个领域。


### 学习更多的 Python 库


当你对 Python 和机器学习有一个好的感觉之后，可以开始学习一些[开源的 Python 库](https://opensource.com/article/17/5/4-practical-python-libraries)。科学的 Python 库将会使完成一些简单的机器学习任务变得很简单。然而，选择什么库是完全主观的，并且在业界内许多人有很大的争论。


一些实用的 Python 库包括：


* [Scikit-learn](http://scikit-learn.org/stable/) ：一个优雅的机器学习算法库，可用于数据挖掘和数据分析任务。
* [Tensorflow](https://opensource.com/article/17/2/machine-learning-projects-tensorflow-raspberry-pi) ：一个易于使用的神经网络库。
* [Theano](http://deeplearning.net/software/theano/) ： 一个强大的机器学习库，可以帮助你轻松的评估数学表达式。
* [Pattern](https://github.com/clips/pattern) ： 可以帮助你进行自然语言处理、数据挖掘以及更多的工作。
* [Nilearn](https://github.com/nilearn/nilearn) ：基于 Scikit-learn，它可以帮助你进行简单快速的统计学习。


### 探索机器学习


对基本的 Python、机器学习技能和 Python 库有了一定理解之后，就可以开始探索机器学习了。接下来，尝试探索一下 Scikit-learn 库。一个不错的教程是 Jake VanderPlas 写的 [Scikit-learn 简介](http://nbviewer.jupyter.org/github/donnemartin/data-science-ipython-notebooks/blob/master/scikit-learn/scikit-learn-intro.ipynb)。


然后，进入中级主题，比如 [K-均值聚类算法简介](https://www.datascience.com/blog/introduction-to-k-means-clustering-algorithm-learn-data-science-tutorials)、线性回归、[决策树](http://machinelearningmastery.com/implement-decision-tree-algorithm-scratch-python/)和逻辑回归。


最后，深入高级机器学习主题，比如向量机和复杂数据转换。


就像学习任何新技能一样，练习得越多，就会学得越好。你可以通过练习不同的算法，使用不同的数据集来更好的理解机器学习，并提高解决问题的整体能力。


使用 Python 进行机器学习是对你的技能的一个很好的补充，并且有大量免费和低成本的在线资源可以帮助你。你已经掌握机器学习技能了吗？可以在下面留下你的评论，或者[提交一篇文章](https://opensource.com/story)来分享你的故事。


（题图：opensource.com）




---


作者简介：


Michael J. Garbade 博士是旧金山 LiveEdu Inc（Livecoding.tv）的创始人兼首席执行官。Livecoding.tv 是世界上观看工程师直播编代码最先进的直播平台。你可以通过观看工程师们写网站、移动应用和游戏，来将你的技能提升到一个新的水平。MichaelJ. Garbade 博士拥有金融学博士学位，并且是一名自学成才的工程师，他喜欢 Python、Django、Sencha Touch 和视频流。




---


via: <https://opensource.com/article/17/5/python-machine-learning-introduction>


作者：[Michael J. Garbade](https://opensource.com/users/drmjg) 译者：[ucasFL](https://github.com/ucasFL) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
Have you wondered what it takes to get started with machine learning? In this article, I will walk through steps for getting started with machine learning using [Python](https://opensource.com/article/17/2/3-top-machine-learning-libraries-python). Python is a popular open source programming language and it is one of the most-used languages in artificial intelligence and other related scientific fields. Machine learning (ML), on the other hand, is the field of artificial intelligence that uses algorithms to learn from data and make predictions. Machine learning helps predict the world around us.

From self-driving cars to stock market predictions to online learning, machine learning is used in almost every field that utilizes prediction as a way to improve itself. Due to its practical usage, it is one of the most in-demand skills right now in the job market. Also, getting started with [Python](https://www.liveedu.tv/learn/python/) and machine learning is easy as there are plenty of online resources and lots of [Python machine learning libraries](https://opensource.com/article/17/2/3-top-machine-learning-libraries-python) available.


What do you have to do to get started with Python machine learning? Let's walk through the process.

## Brush up your Python skills

Because Python is extremely popular, both in the industrial and scientific communities, you will have no difficulty finding Python learning resources. If you are a complete beginner, you can start learning Python using online materials, such as courses, books, and videos. For example:

## Install Anaconda

The next step is to install [Anaconda](http://docs.continuum.io/anaconda/install). With Anaconda, you are set to explore the world of machine learning with Python. The Anaconda package contains the required tools that you will need for exploring machine learning.

## Basic machine learning skills

With basic Python programming skills under your belt, you're ready to pick up basic machine learning skills. A practical approach to learning is more than enough to get started; however, if you are interested in going deep into the subject, be ready to invest perhaps hundreds of hours of learning.

One efficient way to acquire skills is with online courses. Andrew Ng's Coursera [Machine Learning course](https://www.coursera.org/learn/machine-learning) is a great option. Other online training worth checking out include:

(You can also watch machine learning streams on [LiveEdu.tv](https://www.liveedu.tv/) to get a feel for the subject.)

## Learn more about Python packages

After getting a good feel for Python and machine learning, consider learning the [open source Python libraries](https://opensource.com/article/17/5/4-practical-python-libraries). The scientific Python libraries will make it easy to complete simple machine learning tasks; however, the choice of these libraries is completely subjective and is highly debatable by many people in the industry.

A few Python libraries to check out include:

[Scikit-learn](http://scikit-learn.org/stable/): A neat library of machine learning algorithms that can be used for data mining and data analysis task.[Tensorflow:](https://opensource.com/article/17/2/machine-learning-projects-tensorflow-raspberry-pi)An easy-to-use neural network library.[Theano:](http://deeplearning.net/software/theano/)Theano is a powerful machine learning library that helps you easily evaluate mathematical expressions.[Pattern](https://github.com/clips/pattern): Pattern can help you with Natural Language processing, data mining, and much more.[Nilearn](https://github.com/nilearn/nilearn): Nilearn, which is based on Scikit-learn, helps you to do easy and fast statistical learning.

## Explore machine learning

With an understanding of basic Python, machine learning skills, and Python libraries, you are all set. Next try exploring the Scikit-learn library. A good tutorial to check out is an [introduction to Scikit-learn](http://nbviewer.jupyter.org/github/donnemartin/data-science-ipython-notebooks/blob/master/scikit-learn/scikit-learn-intro.ipynb) by Jake VanderPlas.

Then jump into intermediate topics, such as [an introduction to K-means clustering](https://www.datascience.com/blog/introduction-to-k-means-clustering-algorithm-learn-data-science-tutorials), linear regression, [decision trees](http://machinelearningmastery.com/implement-decision-tree-algorithm-scratch-python/), and logistic regression.

Finally, dive deep into advanced machine learning topics such as vector machines and complex data transformation.

As with learning any new skills, the more you practice, the better you become. Practice different algorithms and work with different data sets to have a better understanding of machine learning, and to improve your overall problem-solving skills.

Machine learning with Python is a great addition to your technical skillset, and there are lots of free and low-cost online resources available to help. How have you picked up machine learning skills? Leave a comment below, or [submit an article proposal](https://opensource.com/story) to share your story.

## 1 Comment