Skip to content

Machine Learning in Python : Introduction

Preface

Machine learning as a stream of Computer Science Engineering has started evolving over the past few decades. Python programming language has a wide range of support for solving Machine learning problems. So this is the chance for you to grab the fundamental blocks of Machine Learning.

Simple Understanding

Let’s suppose that you as a programmer writing a function which will accept an integer value and return its squared value. Somewhat, The function structure will look like this.

function square(int argument){
  return argument*argument
}

So what this function does? It just accepts a data point and applies a logic to the data point and predicts a result. Right isn’t it? Here the data point is the integer argument and logic is the squaring the integer argument. You can write any function if you aware of the logic to perform inside the function. Simply, A computer function is clearly defining a relationship with its argument dataset and output based on past knowledge or logic.

Suppose, what will happen if you are not aware of the logic? You have a set of data and it outputs. But you don’t know how both are related. You have to find and write a relation logic. Then only you can make a function from the dataset. This was the problems faced by the conventional computing methods. They did not know how to relate dataset and its outputs and find their relationships for solving problems. With the help of Mathematics, We can do it and thus the Learning by Machines itself achieved.

Supervised and Unsupervised learning

Most of you might have heard these words if you were into the world of Machine Learning. These are the two main categories in the field of Machine Learning. As the name suggests, Supervised learning is a model of learning where there will be a supervisor to direct everything. Suppose you are a supervisor of your team, you will provide the instruction to all the team members. In Machine Learning terms, A model predicts based on the previous dataset which will be called Supervised learning.

Unlike Supervised learning, The model will not be trained previously and it will not form a relationship formulas in its dataset. In Unsupervised learning, the model will not aware of any dataset and it will form the relationship by its own formulas and patterns.

A Machine Learning model is a computer programme which has 
the ability to learn from the dataset and predict values 
for new dataset.

Environment Setup

For Linux/Ubuntu users,

You can use Python 2 or Python 3 for learning Machine Learning. Since Python 3 is the latest, I will be coding in Python 3.

Install pip in python using below command

 #For Python 2 environment
 sudo apt-get install python-pip python-dev build-essential
 sudo pip install --upgrade pip
    
 #For Python 3 environment
 sudo apt-get -y install python3-pip

After installing the Pip, You can install Pip packages using below command,

python -m pip install --user numpy scipy matplotlib ipython
python -m pip install --user jupyter pandas sympy nose scikit-learn

For Windows users,

You can get Python executable from here. Download it and install the Python.

From Python 3.4 onwards Pip is packed along with Python installer executable. So that you don’t need to install the Python Package Manager PIP. Finally, Just install the required pip packages same as like in Ubuntu guide.

Commonly used IDEs

  1. Sublime (Both Windows and Linux)
  2. Spyder (Linux)
  3. Weka
  4. Tensorflow
  5. VSCode

Upcoming chapters

In upcoming chapters, We will be talking about Regressions and Many Machine learning model approaches. Stay tuned for my website for more updates.

Happy Coding. 

 

Published inMachine Learning

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *