A blog for computer science passionates.

Wednesday, 22 August 2018

Hello Friends!!!

Now a day one of the most popular thing in the field of IT is Machine Learning and deep learning, specially for research  areas and for researcher in this field. As per the usage of internet groves by leaps and bounds, all the researchers, developers find a way how to manage machine learning and deep learning online.
So, here we have a tensorflow.js
It is an open source WebGL accelerated JavaScript library file for Machine Learning and deep learning. To  build neural network online to run on your browser tensorflow.js is used. It provides low - level building blocks as well as high level API for Machine Learning. It is also inspired by Keras library to construct neural network or deep learning model.

 Tensorflow.js works with tensor. now we have that question what is tensor?

In mathematical terms, tensor means a generalized matrix, it can be 1 - D or 3 - D or higher dimensional matrix.
Here, the central unit of data in tensorflow.js is called a tensor, set of numerical elements shaped in an array one or more dimensional. in tensorflow.js we have shape attribute to define array shape or dimension.

Now Lets' start tensorflow.js with simple example with brief summery,
To start with tensorflow.js create your webpage. i.e. create a simple HTML file.

<html>
<head>
<!-- first load tensorflow.js from CDN-->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@0.12.0"> </script>

    <script>
      // Define a model and add layers in it. I have only one input and one output so I add a layer with single input and output to a model.
      const model = tf.sequential();      model.add(tf.layers.dense({units: 1, inputShape: [1]}));

      // Prepare the model for training: Specify the loss and the optimizer.
      model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});

      // Generate some synthetic data for training. My Input as well as both are of same shape
      const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]);     //For input Here I define a tensor with [4,1] for input
      const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]);    //For output I will get the same shape of output.


      // Train the model using the data. here I give epochs i.e. loop through data 10 times.

      model.fit(xs, ys, {epochs: 10}).then(() => {
       
        // Open the browser devtools to see the output
        model.predict(tf.tensor2d([5], [1, 1])).print();          //Here I specify [1,1] tensor with value [5] i.e. containing value is [5] it will print in web console.
      });
    </script>
</head>
<body></body>
</html>

So, This is a very simple model we create with brief summery.  Hope you enjoy....

Happy Coding and have fun with tensorflow.js!!!! 

Sunday, 8 July 2018

Hi Friends,


Welcome again,

Today We are going to learn about Regression. We have already learn a brief about regression. But now, we take deep dive into the regression. It is a very broad thing in ML.

So, let's start with regression.
Regression is a type of supervised learning, so it has input variable as well as output variable like classification, but regression works for statistical analysis on data. or we can say it is a statistical process  to estimate real values, such  as, prices of different cars.

Lets take an example of regression:

import csv
import numpy
import matplotlib.pyplot as plt
from matplotlib import style
style.use("ggplot")
from sklearn import svm
file_name="regression_ex.csv"
raw_data=open(file_name,"rt")
reader=csv.reader(raw_data,delimiter=',',quoting=csv.QUOTE_NONE)
x=list(reader)
data=numpy.array(x)
plt.scatter(data[1:,0],data[1:,1])

Output:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAX0AAAD8CAYAAACb4nSYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAGmVJREFUeJzt3XuUHGWZx/Hv5AJILiBkdiMXBdagJgFDgGTxQoAFFkQSUHwkBiEiYlR0jcCedQVWx4ML7GLQlUUwBy8sIA8oJEdAcBeIihIJhFuCgc2AiCFLQhRCgMBkZv+o6kmn05Ou7q6u6ar39zknJ9PV1f28b8/0M3XpqV9HX18fIiIShiGDPQAREcmOmr6ISEDU9EVEAqKmLyISEDV9EZGAqOmLiARETV9EJCBq+iIiAVHTFxEJyLDBHkAV+hNhEZHGdNRaoR2bPqtWrWr4sWPGjGHt2rUpjqZ96mluqtdutYpeL09z22233RKtp8M7IiIBUdMXEQmImr6ISEDU9EVEAqKmLyISkESf3jGzY4BvAUOB+e5+0QDrnQTcCBzs7kvMbC/gcWBFvMp97j6n6VGLiEhDajZ9MxsKXA4cBTwL3G9mC919ecV6o4AvAIsrnmKlu09Kabwi0iZ616yGBdeybsN6ekeMghmzGNI5drCHJTUk2dKfAvyvu3cDmNmPgRnA8or1vg5cApyT6ghFpO30rllN37wLYM1q3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veA/G3pn0S0e/c2d9/L3fcEniL6jT8lPuQxhOi3fr2HcpLWAhhvZtvHu59/Fy/7PbBP/IMPm7c86mZmncB3ge+4ex9RPvFn4q0mzGxfMxtBtLt4enwck/iHvlED1YB0X9udgOfjhn848LYmnqsef6D69y2Pda4Gutz90YrlO7H5JOvsNqg5H/g2cH+9W8nx+k502LHkN2z+QMUs4p/DeAv6d8C3gJ/VuZH3P8COZnYq9J/bupRoz+ROYE7p5HfZ+2s9MKqe+cSPf4eZjStbNAl4HOiMT/JiZsPNrHwP7aPx8vcRHX59sd66lfLW9GcSBbCX+wnRR6B+S3Qi8jGi5ly5Xpq1HHiE6LjiUoD4hONngZ+b2a+B/yM6yZRU6Tj7MqLDHncSnUSC6M2zHHgw3o2+Ehjm7j8n2spZEu8aNnKMuKRqjfi+qq+tmc03s0RbcPEbZyPRa3aQmS0heuPWPJFpZnPMbE5909myrrv/kSrft7RkVQfA3Z91929VuesSoi3ee4n2TLc13oe2dX8aNd39AeAltr21vi2XAuWf4vkC8In40ODHgX8ou+8G4BTqO7RDvFF1IvARM3sSeILovNM/E70nngEeMbOHid77EJ1ovt3M7q5zPiOBH5rZ8ngO44nOg5wEXBzXeIjogwwlfzaz3xBtBH6y8gkbUYi/yK38xMQgjmOku78cn5i8HHjS3ecN5pjahZm9G/ieu08pYt3Bml87M7PdiA5lvLPRT3uFzFL6+5FKedvSb3efireglhHt9l5ZY/0gxFvp1xOdpCpc3cGaXzuLD5csBr6iht9eCrGlLyIiyWhLX0QkIGr6IiIBUdMXEQmImr6ISEDU9EVEAqKmLyISkP8HtkOF8rWBZjMAAAAASUVORK5CYII=
Figure: Regression of Month wise Heatwave


So, This is a simple example of regression. in next article, we will learn different types of regression.

Wednesday, 28 March 2018

Hello Friends,
In the previous article, we have discussed supervised learning algorithms and even we have seen a simple classification example in python, but now in this article, we are going to take deep dive into Classification, algorithm,
Actually, in the Supervised Learning algorithm, there is a data-set and from that data-set, we want to learn to classify. Now say, for example, I have some data of students and if I made a survey about how many students want to learn computer programming, so for us, those students who want to learn computer programming are positive examples, and others are negative examples. We find a class of students who want to learn computer programming so, we should consider positive examples only for that we need to make a prediction based on knowledge extraction.

In classification sometimes we have either true/false or Yes / No or Male / Female type of data, i.e. in our above example, students who want to learn computer programming is a positive example, so those who want to learn computer programming says YES. So,

This type of Classification is known as binary classification. and is used to classify two classes on the basis of a classification rule.

Other types of classifications are
  • Multi-Class Classification
  • Multi-Label Classification
Sometimes, these both becomes ambiguous,  So, let's differentiate these both,

Multi-Class Vs. Multi-Label Classification,

Here, let's take an example, Consider the word Animal, in which we have Multiple - Classes such as,
There are Birds, Mammals, etc. And Birds class has lots of different types of Birds such as parrot, peacock,  sparrow, etc. Here, parrot, pea-cock are different labels.
Fig. 1 Multi-Class Classification(Image Source: pixabay)

In the above pic, you can see three different classes, and with different animals, you can classify these classes with different labels of animals such as class wild - animal has tiger, monkey, etc. labels.

So, this is Classification and it's type. In the next post, we will see regression.
Enjoy with Machine Learning.

Monday, 5 March 2018

Hello Friends,

In this article, we are going to learn about Supervised Learning in detail. In previous article we discussed about all the types of learning in brief. From which we learn more about Supervised Learning. So, Let's take a tour to Supervised Learning.

Supervised Learning is most popular and successful learning algorithm. In supervised learning, there is a teacher to train set of data. i.e. the set of data learns under supervision of an instructor or teacher. we all know about supervised learning, it is something like humans learning methods. In supervised learning, there is input as well as output data. such as, X is my input data, Y becomes output data.something like,
Y=f(X)

Here, we have input data X, it is training data. so, here we have a teacher who give training to our input data X, and X make a prediction and it is corrected by the teacher and represent some output Y. This algorithm is known as Supervised Learning. In this algorithm we try to make accurate prediction to generate unseen or new data that has never seen before.

We have two types of Supervised Machine Learning algorithms,
  • Classification
  • Regression
In classification, we predict a different class and give some label to that class.For example, if we have different flowers, we classify this data in different other class based on its' different types and smell and look such as,Rose, Water lily, Sun - Flower, Jasmine, Orchid etc. we just classify different flowers as per their category.
Let's take demo example of classification.
First of all I have this sample data set.
Figure1. Data Set
I have this .csv file as my data set. I put some flower name and set it's color and width and height.
Figure2. Classification using Flower name and It's Color.

In this example, I classify flower through their color.

In regression,  we have some real values related data, i.e. Monthly - Income, or Predicting a price of a car or home etc, and we get the output in real values, we predict based on real values is regression.

This is supervised learning, hope you get supervised learning easily,
In next article I will discuss more interesting things related to Machine Learning, till then Enjoy...

Tuesday, 27 February 2018

Hello Friends,

In this article We are going to learn about different types of Machine Learning. Actually types are in the form of algorithms. So, Lets' start different types of Machine Learning.
  • Supervised Learning
  • Un-supervised Learning
  • Semi supervised Learning
  • Reinforcement Learning
These are the types of Machine Learning. Lets' start with some brief.

First of all we are going through,

Supervised Learning: 

  • Supervised learning means machine needs to learn under supervision, i.e., there is a teacher to teach machine.
  • Supervised learning is an learning algorithm, for labeled data.
  • In supervised learning, we have trained data which consists of input object as well as desired output value.

Unsupervised Learning:

  • Unsupervised learning means machine learns without teacher, i.e. without any supervision.
  • In unsupervised learning there is only input data, there is no output.
  • In unsupervised learning there is only input data, and asked to extract knowledge from this data.

Semi supervised Learning:

  • Semi supervised learning is a part of supervised learning, and works between supervised and unsupervised learning.
  • When we have large amount of unlabeled data, from which this algorithm makes use of those unlabeled data to train small amount of labeled data.

Reinforcement Learning:

  •  In reinforcement learning, we have an agent to automatically determine the behavior, in order to improve the performance.
  • In reinforcement learning, software agent make decision on the basis of situation, to tackle the situation and also to improve the performance.
These are the types of Machine Learning, and brief introduction of these types.
I will come to you with some new aspect, till then

Enjoy with ML...