Logistic Regression

I just finished the code for a Logistic Regression classification model. I worked on a Card transaction processing system and there was a requirement for identifying whether a card transaction is fradulent or not. We did not use any classification model but if we had had a training set of historical data we could have used this learning algorithm.
Most of the time it is the lack of skills that affects software projects that I have been involved with.

Cost function for Logistic Regression

J(\theta) = 1/m \sum_{i=1}^{m}[-y^{(i)} log( h_\theta(x^{(i)}) - (1-y^{(i)})log( 1 - h_\theta(x^{(i)}))] ;

Gradient of the cost

(\partial J(\theta)/\partial \theta_j ) = 1/m \sum_{i=1}^{m} ( h_\theta(x^{(i)}) - y^{(i)}) x^{(i)}_j

This is the plot generated by the course material based on my code. The line is a decision boundary that shows which exam scores ensure admittance. We can use historical card transaction data in place of this.

Screen Shot 2014-04-06 at 9.12.09 PM

This classificatio model can predict which card transactions could be fradulent based on a probability calculated by the algorithm. So here instead of plotting exam scores on the axes we can plot card transaction data.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: