Did you know about Python Ecosystem for Machine Learning

The Python ecosystem is growing and may become the dominant platform for machine learning. The primary rationale for adopting Python for machine learning is because it is a general purpose programming language that you can use both for R&D and in production. In this chapter you will discover the Python ecosystem for machine learning. After completing this lesson you will know:

  • Python and it’s rising use for machine learning.
  • SciPy and the functionality it provides with NumPy, Matplotlib and Pandas.
  • scikit-learn that provides all of the machine learning algorithms.
  • How to setup your Python ecosystem for machine learning and what versions to use

1.1 Python

Python is a general purpose interpreted programming language. It is easy to learn and use primarily because the language focuses on readability.

1.2 SciPy

SciPy is an ecosystem of Python libraries for mathematics, science and engineering. It is an add-on to Python that you will need for machine learning. The SciPy ecosystem is comprised of the following core modules relevant to machine learning:

  • NumPy: A foundation for SciPy that allows you to efficiently work with data in arrays.
  • Matplotlib: Allows you to create 2D charts and plots from data.
  • Pandas: Tools and data structures to organize and analyze your data.

 To be effective at machine learning in Python you must install and become familiar with SciPy. Specifically:

  • You will prepare your data as NumPy arrays for modeling in machine learning algorithms.
  • You will use Matplotlib (and wrappers of Matplotlib in other frameworks) to create plots and charts of your data.
  • You will use Pandas to load explore and better understand your data.

1.3 scikit-learn

The scikit-learn library is how you can develop and practice machine learning in Python. It is built upon and requires the SciPy ecosystem. The name scikit suggests that it is a SciPy plug-in or toolkit. The focus of the library is machine learning algorithms for classification, regression, clustering and more. It also provides tools for related tasks such as evaluating models, tuning parameters and pre-processing data.

1.4 Python Ecosystem Installation

1.4.1 How To Install Python

 

1.4.2 How To Install SciPy

There are many ways to install SciPy. For example two popular ways are to use package management on your platform (e.g. yum on RedHat or macports on OS X) or use a Python package management tool like pip. The SciPy documentation is excellent and covers howto instructions for many different platforms on the page Installing the SciPy Stack 5 . When installing SciPy, ensure that you install the following packages as a minimum:

  • scipy
  • numpy
  • matplotlib
  • pandas

Once installed, you can confirm that the installation was successful. Open the Python interactive environment by typing python at the command line, then type in and run the following Python code to print the versions of the installed libraries.

# scipy 
import scipy as sp
print('scipy: {}'.format(sp.__version__))

# numpy
import numpy as np
print("numpy: {}".format(np.__version__))

# matplotlib
import matplotlib as plt
print("matplotlib: {}".format(plt.__version__))

# pandas
import pandas as pd
print("pandas: {}".format(pd.__version__))

1.4.3 How To Install scikit-learn 

# scikit-learn
import sklearn as sk
print("sklearn: {}".format(sk.__version__))

 1.4.4 How To Install The Ecosystem: An Easier Way

If you are not confident at installing software on your machine, there is an easier option for you. There is a distribution called Anaconda that you can download and install for free7 . It supports the three main platforms of Microsoft Windows, Mac OS X and Linux. It includes Python, SciPy and scikit-learn. Everything you need to learn, practice and use machine learning with the Python Environment.

1.5 Summary

In this chapter you discovered the Python ecosystem for machine learning. You learned about:

  • Python and it’s rising use for machine learning.
  • SciPy and the functionality it provides with NumPy, Matplotlib and Pandas.
  • scikit-learn that provides all of the machine learning algorithms.
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值