Prerequisites for Machine Learning part of the Workshop :)

Hi folks!


Prerequisites for the Machine Learning section of the workshop are as follows:





Software requirements:
1. Ubuntu 18.04 Operating System

Since we will be running python scripts for machine learning model building, we need to have python installed. Also, to install the python related machine learning libraries and preprocessing modules, we need pip.

Pip is a package management system that simplifies installation and management of software packages written in Python such as those found in the Python Package Index (PyPI). Pip is not installed by default on Ubuntu 18.04, but the installation is pretty straightforward.

Ubuntu 18.04 ships with Python 3, as the default Python installation. Complete the following steps to install pip (pip3) for Python 3:

Start by updating the package list using the following command:

          sudo apt update

Use the following command to install pip for Python 3:

         sudo apt install python3-pip

The command above will also install all the dependencies required for building Python modules.

Once the installation is complete, verify the installation by checking the pip version:

         pip3 --version

The version number may vary, but it will look something like this:

        pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)


You should install Python modules globally using pip only if there is no package available through the package manager.
In most cases, you should use pip within a virtual environment only. Python Virtual Environments allows you to install Python modules in an isolated location for a specific project, rather than being installed globally. This way you do not have to worry about affecting other Python projects.

To view the list of all pip commands and options, type:

       pip3 --help

Installing Packages with Pip
Let’s say you want to install a package called scrapy which is used for scraping and extracting data from websites.

To install the latest version of the package you need to run the following command:

     sudo pip3 install scrapy

To install a specific version of the package you would issue the following command:


     sudo pip3 install scrapy==1.5

To upgrade an already installed package to the latest version use the following command:

     sudo pip3 install --upgrade package_name

To uninstall a package run:

     sudo pip3 uninstall package_name


There are the 4 key libraries that you will need to install. Below is a list of the Python libraries required for this workshop:

1. numpy
     sudo pip3 install numpy

2. matplotlib
    sudo pip3 install matplotlib

3. pandas
    sudo pip3 install pandas

4. sklearn
   sudo pip3 install sklearn

To check whether the libraries have been installed successfully, do the following for all of them. As an example, numpy library installation is tested below.
Open a command line and start the python interpreter, type the following:
    python

This should display the python version you have, if successfully installed. Now, type

    import numpy

If the interpreter does not throw an error, then Congratulations! :) You have installed numpy successfully using pip


Please complete the prerequisites beforehand so that we can spend more time learning fun stuff.

Happy learning! :D

Comments

Popular posts from this blog

Day 2 Session 1: Introduction to Zodiac FX switch

Day 3 Session 2: Building an SDN network