请选择 进入手机版 | 继续访问电脑版
楼主: oliyiyi
1403 2

How to Create a Linux Virtual Machine For ML Development With Python 3 [推广有奖]

版主

泰斗

0%

还不是VIP/贵宾

-

TA的文库  其他...

计量文库

威望
7
论坛币
272091 个
通用积分
31269.1729
学术水平
1435 点
热心指数
1554 点
信用等级
1345 点
经验
383778 点
帖子
9599
精华
66
在线时间
5466 小时
注册时间
2007-5-21
最后登录
2024-3-21

初级学术勋章 初级热心勋章 初级信用勋章 中级信用勋章 中级学术勋章 中级热心勋章 高级热心勋章 高级学术勋章 高级信用勋章 特级热心勋章 特级学术勋章 特级信用勋章

oliyiyi 发表于 2017-2-27 15:56:54 |显示全部楼层 |坛友微信交流群

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

本帖隐藏的内容

Linux is an excellent environment for machine learning development with Python.

The tools can be installed quickly and easily and you can develop and run large models directly.

In this tutorial, you will discover how to create and setup a Linux virtual machine for machine learning with Python.

After completing this tutorial, you will know:

  • How to download and install VirtualBox for managing virtual machines.
  • How to download and setup Fedora Linux.
  • How to install a SciPy environment for machine learning in Python 3.

This tutorial is suitable if your base operating system is Windows, Mac OS X, and Linux.

Let’s get started.

Benefits of a Linux Virtual Machine

There are a number of reasons that you may want to use a Linux virtual machine for Python machine learning development.

For example, below is a list of 5 top benefits for using a virtual machine:

  • To use tools not available on your system (if you’re on Windows).
  • To install and use machine learning tools without impacting your local environment (e.g. use Python 3 tools).
  • To have highly customized environments for different projects (Python2 and Python3).
  • To save the state of the machine and pick up exactly where you left off (jump from machine to machine).
  • To share development environment with other developers (set-up once and reuse many times).

Perhaps the most beneficial point is the first, being able to easily use machine learning tools not supported on your environment.

I’m an OS X user, and even though machine learning tools can be installed using brew and macports, I still find it easier to setup and use Linux virtual machines for machine learning development.

Overview

This tutorial is broken down into 3 parts:

  • Download and Install VirtualBox.
  • Download and Install Fedora Linux in a Virtual Machine.
  • Install Python Machine Learning Environment
1. Download and Install VirtualBox

VirtualBox is a free open source platform for creating and managing virtual machines.

Once installed, you can create all the virtual machines you like, as long as you have the ISO images or CDs to install from.

[color=rgb(255, 255, 255) !important]

Download VirtualBox

  • 3. Choose binaries for your workstation.
  • 4. Install the software for your system and follow the installation instructions.
[color=rgb(255, 255, 255) !important]

Install VirtualBox

  • 5. Open the VirtualBox software and confirm it works.
[color=rgb(255, 255, 255) !important]

Start VirtualBox

2. Download and Install Fedora Linux

I chose Fedora Linux because I think it is a kinder and gentler Linux than some.

It is a leading edge for RedHat Linux intended for workstations and developers.

2.1 Download the Fedora ISO Image

Let’s start off by downloading the ISO for Fedora Linux. In this case, the 64-bit version of Fedora 25.

[color=rgb(255, 255, 255) !important]

Download Fedora

  • 5. You should now have an ISO file with the name:
    • Fedora-Workstation-Live-x86_64-25-1.3.iso“.

We are now ready to create the VM in VirtualBox.

2.2 Create the Fedora Virtual Machine

Now, let’s create the Fedora virtual machine in VirtualBox.

  • 1. Open the VirtualBox software.
  • 2. Click “New” button.
  • 3. Select the Name and operating system.
    • name: Fedora25
    • type: Linux
    • version: Fedora (64-bit)
    • Click “Continue
[color=rgb(255, 255, 255) !important]

Create Fedora VM Name and Operating System

  • 4. Configure the Memory Size
    • 2048
  • 5. Configure the Hard Disk
    • Create a virtual hard disk now
    • Hard disk file type
    • VDI (VirtualBox Disk Image)
    • Storage on physical hard disk
    • Dynamically allocated
    • File location and size: 10GB

We are now ready to install Fedora from the ISO image.

2.3 Install Fedora Linux

Now, let’s install Fedora Linux on the new virtual machine.

  • 1. Select the new virtual machine and click the “Start” button.
  • 2. Click Folder Icon and choose the Fedora ISO file:
    • Fedora-Workstation-Live-x86_64-25-1.3.iso“.
[color=rgb(255, 255, 255) !important]

Install Fedora

  • 3. Click the “Start” button.
  • 4. Select the first option “Start Fedora-Live-Workstation-Live 25” and press the Enter key.
  • 5. Hit the “Esc” key to skip the check.
  • 6. Select “Live System User“.
  • 7. Select “Install to Hard Drive“.
[color=rgb(255, 255, 255) !important]

Install Fedora to Hard Drive

  • 8. Complete “Language Selection” (English)
  • 9. Complete “Installation Destination” (“ATA VBOX HARDDISK“).
    • You may need to wait one minute for the VM to create the hard disk.
[color=rgb(255, 255, 255) !important]

Install on Virtual Hard Disk

  • 10. Click “Begin Installation“.
  • 11. Set root password.
  • 12. Create a user for yourself.
    • Note down the username and password (so that you can use it later).
    • Tick the “Make this user administrator” (so you can install software).
[color=rgb(255, 255, 255) !important]

Create a New User

  • 13. Wait for the installation to complete… (5 minutes?)
  • 14. Click “Quit”, click power icon in top right; select power off.
2.4 Finalize Fedora Linux Installation

Fedora Linux has been installed; let’s finalize the installation and make it ready for use.

  • 1. In VirtualBox with the Fedora25 VM selected, under “Storage“, click on “Optical Drive“.
    • Select “Remove disk from virtual drive” to eject the ISO image.
  • 2. Click the “Start” button to start the Fedora Linux installation.
  • 3. Login as the user you created.
[color=rgb(255, 255, 255) !important]

Fedora Login as New User

  • 4. Finalize installation
    • Choose language “English
    • Click “Next
    • Choose Keyboard “US
    • Click “Next
    • Configure Privacy
    • Click “Next
    • Connect Your Online Accounts
    • Click “Skip
    • Click “Start using Fedora
  • 5. Close the help system that starts automatically.

We now have a Fedora Linux virtual machine ready to install new software.

3. Install Python Machine Learning Environment

Fedora uses Gnome 3 as the window manager.

Gnome 3 is quite different to prior versions of Gnome; you can learn how to get around by using the built-in help system.

3.1 Install Python Environment

Let’s start off by installing the required Python libraries for machine learning development.

  • 1. Open the terminal.
    • Click “Activities
    • Type “terminal
    • Click icon or press enter
[color=rgb(255, 255, 255) !important]

Start Terminal

  • 2. Confirm Python3 was installed.

Type:

python3 --version
[color=rgb(255, 255, 255) !important]

Python3 Version

  • 3. Install the Python machine learning environment. Specifically:
    • NumPy
    • SciPy
    • Pandas
    • Matplotlib
    • Statsmodels
    • Scikit-Learn

DNF is the software installation system, formally yum. The first time you run dnf, it will update the database of packages, this might take a minute.

Type:

sudo dnf install python3-numpy python3-scipy python3-scikit-learn python3-pandas python3-matplotlib python3-statsmodels

Enter your password when prompted.

Confirm the installation when prompted by pressing “y” and “enter“.




[color=rgb(255, 255, 255) !important]






二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Development machine Develop virtual python Create Linux

已有 1 人评分论坛币 收起 理由
星野 + 1000 恭喜获得2017年2月优秀会员

总评分: 论坛币 + 1000   查看全部评分

缺少币币的网友请访问有奖回帖集合
https://bbs.pinggu.org/thread-3990750-1-1.html
ekscheng 发表于 2017-2-27 19:18:19 |显示全部楼层 |坛友微信交流群

使用道具

kankan


thx
已有 1 人评分论坛币 收起 理由
oliyiyi + 5 精彩帖子

总评分: 论坛币 + 5   查看全部评分

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-3-28 21:14