Showing posts with label Machine Learning. Show all posts
Showing posts with label Machine Learning. Show all posts

Wednesday, 3 February 2016

Switching to ML concepts

As I'm getting a lot of assignments these days I've decided to pause app development and first work on them and they are interesting too.

I'll be detailing about every algorithm which I've learnt and will be learning.
So, lets start with k means algorithm.

K means Algorithm -

Suppose we have been given data about something and we wish to find pattern in the given data like some clusters where we can group similar type of data together.
To achieve this objective we can use k means algorithm.
To use this algorithm we need to have the information about the number of groups/clusters will be there. Let this number is k.

The algorithm -
1. Input - set of points (x1,x2,...xn) of size say n
2. Randomly generate k numbers and assume them to be the centroids at the moment.
3. Repeat until convergence:
    for each point xi:
        Find nearest centroid Cj (Can use eucledian distance to find the nearest centroid)
        Assign the point xi to cluster j
    for each cluster j=i...k
        new centroid Cj = mean of all points xi assigned to cluster j in previous step
4.Stop when none of the cluster assignments change


Note - 
After each iteration centroid will change and get placed optimally(better position than before)
We need to stop updating the centroids when there is no change in the cluster arrangement i.e. if clusters are remaining same for 2 consecutive iterations.

Time Complexity of this algorithm - O(#iteration*#clusters*#instances*#dimensions)

I've implemented this on python - See

The problem was - Given 150 flower's data with (petal length,petal width,sepal length,sepal width) we need to group them into 3 clusters.

I hope this will be helpful.

In addition to this I've rolled out an update for Medicator app. Now the app covers over 125 diseases.
You can check it out here - Medicator

Thursday, 25 December 2014

Introduction to Machine Learning

Wishing everyone merry Christmas !



These days I am learning about Machine Learning. The thing that excites me the most about this field is that its like teaching computers how to think like a real human. The computer can develop the ability to do something by learning from the simulation or from the data provided which may be so much difficult if we go through the normal programming.

Machine Learning Algorithms are broadly classified into these two categories -

1. Supervised Learning -
 
                      In this type of learning the computer is given the data with results like right and wrong or classification based results and it is made to learn from it what is correct and what is incorrect or how to classify the result.
       
               It can be further divided into two types -
             
              1. Regression - It is like predicting the continuous value of the asked object like price,quantity,etc,. Ex - Prediction of the stock price from previous month performance of the stock and the market status , estimating the value of the land purchased based on the given data.
 
              2. Classification - It is like predicting a type of outcome out of some finite possible outcomes like predicting the outcome of a football match between Real Madrid and Barcelona whether it will be a draw or Messi's magic will prevail or Ronaldo will seal the victory. In this example no. of possible outcomes are 3. Win,loss and draw

2. Unsupervised Learning - 
      
                  In this type of learning the computer is provided with the data and it is asked to provide some structure in the data provided.Ex - finding the set of people who are having more than say 10 mutual friends on a social networking site or like finding patterns in the genetic structure of two individuals.

There is a famous problem in which the goal is to separate out different type of voices from the recording given. This problem is known as cocktail party problem. There is an algorithm derived for this problem and it took a lot of research to derive it. Surprisingly, now it can be implemented in Octave (A Machine Learning Programming tool) by just a single line of code.

This is what I've learnt.I used to surprise that how photo tagging feature on facebook works.Its accuracy of identifying individuals in the photo is quite good. Now I've the answer. Its ML magic.

Thanks for reading and once again merry Christmas !  

Sunday, 21 December 2014

Finally !

After spending a lot of time trying out different things I got a very interesting area to invest my time.
Its Machine Learning ! With a lot of real world applications this is like a dream come true for me . It's just what I needed.

I tried out with android,game development,gui development,etc. I was not that much interested with those things but this is so much interesting that I am taking its course on coursera even at 3 o' clock(night). I don't know whether I'll be able to master it or not but its worth learning it.

Lets see I drive through this part of my journey. One thing is for sure its gonna be interesting damn interesting!!!