Since two months ago I’m researching about machine learning and its algorithms. The goal is get a good unsupervised and clustering algorithm to analyze every android applications and predict what application you want to install or use in a particular time. The first step is learn and understand the theory of machine learning. For this,  I began to study the Machine Learning Course of Stanford. It’s a great and practical course with videos and material to help understand the classes.

The first model that I have studied is linear regression. This model consist in have a relation between two or more variables. For example, in my example I have a training data about the prices of the houses and its size in square meters. This training data is used to build a linear regression model to predict the prices of the house give the size of the house. As you  can see in the following figure, the black dots show the training data (I did web crawling to get real data). The blue line represents the trend line of the model, and the red dots show the predicts for two size of houses.


You can see the prediction values that are represented by red dots in the figure.

For a house with 100 meters, we predict a price of 202906.39 euros
For a house with 175 meters, we predict a price of 354343.54 euros

You can use Octave or R to practice and implement machine learning algorithms. Personally, I prefer to use a great and FLOSS library that I found, scitik-learn. This library has several implementations of linear models: LinearRegression, RidgeRegression, Lasso, Elastic Net, …. For this example, I have used the SGDRegressor model but, I want to test other models more smooth like Lasso or Elastic models.

You can get the source code of this example in my GIT repository

facebooktwittergoogle_pluslinkedinmailby feather

Leave a Reply

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

Related Posts


WorldTripLogger working!!

We tried the WorldTripLogger one day before MrHicks46 began his world trip on his motorcycle. We have noticed that the vibrations will be a little bit of a problem because some pictures have some wrong lines Read more…


Show your RTSP video in Android with VLC

If you have developed an Android app with video streaming, I’m sure you notice that Android use a pre-load of video buffer that fills in 10 seconds. This delay is hardcode in the source code. Read more…


Polynomial Regression

Polynomial Regression is a form of linear regression model but fits a non-linear relationship between the value X and Y. Basically we have to add new features to the final equation. But what features? It’s Read more…