- Python Machine Learning By Example
- Yuxi (Hayden) Liu
- 356字
- 2021-07-02 12:41:37
Setting up Python and environments
We'll be using Python 3 in this book. As you may know, Python 2 will no longer be supported after 2020, so starting with or switching to Python 3 is strongly recommended. Trust me, the transition is pretty smooth. But if you're stuck with Python 2, you still should be able to modify the codes to work for you. The Anaconda Python 3 distribution is one of the best options for data science and machine learning practitioners.
Anaconda is a free Python distribution for data analysis and scientific computing. It has its own package manager, conda. The distribution (https://docs.anaconda.com/anaconda/packages/pkg-docs/, depending on your operating system, or version 3.6, 3.7, or 2.7) includes more than 500 Python packages (as of 2018), which makes it very convenient. For casual users, the Miniconda (https://conda.io/miniconda.html) distribution may be the better choice. Miniconda contains the conda package manager and Python. Obviously, Miniconda takes more disk space than Anaconda.
The procedures to install Anaconda and Miniconda are similar. You can follow the instructions from http://conda.pydata.org/docs/install/quick.html. First, you have to download the appropriate installer for your operating system and Python version, as follows:

Sometimes, you can choose between a GUI and a CLI. I used the Python 3 installer although my system Python version was 2.7 at the time I installed it. This is possible since Anaconda comes with its own Python. On my machine, the Anaconda installer created an anaconda directory in my home directory and required about 900 MB. Similarly, the Miniconda installer installs a miniconda directory in your home directory.
Feel free to play around with it after you set it up. One way to verify you set up Anaconda properly is by entering the following command line in your Terminal on Linux/Mac or Command Prompt on Windows (from now on, I'll just mention terminal):
python
The preceding command line will display your Python running environment, as shown in the following screenshot:

If this isn't what you're seeing, please check the system path or the path Python is running from.
The next step is setting up some of the common packages used throughout this book.
- Mastering Hadoop 3
- 現(xiàn)代測(cè)控電子技術(shù)
- 21天學(xué)通PHP
- Visual FoxPro 6.0數(shù)據(jù)庫(kù)與程序設(shè)計(jì)
- 返璞歸真:UNIX技術(shù)內(nèi)幕
- 最后一個(gè)人類
- STM32G4入門與電機(jī)控制實(shí)戰(zhàn):基于X-CUBE-MCSDK的無刷直流電機(jī)與永磁同步電機(jī)控制實(shí)現(xiàn)
- Maya 2012從入門到精通
- 大數(shù)據(jù)安全與隱私保護(hù)
- Salesforce Advanced Administrator Certification Guide
- 智能+:制造業(yè)的智能化轉(zhuǎn)型
- 分布式Java應(yīng)用
- 從機(jī)器學(xué)習(xí)到無人駕駛
- 大數(shù)據(jù):從基礎(chǔ)理論到最佳實(shí)踐
- Mastering Android Game Development with Unity