Giter VIP home page Giter VIP logo

logistic-regression's Introduction

MAD III- Project

Logistic regression using stochastic gradient descent - implemented in Python

Experiments

Dataset: pima-indians-diabetes with 768 instances

Validation used: Percentage split - in the tests used as 66%

Example output:

Dataset pima-indians-diabetes.csv loaded. Number of Instances: 768 Loading dataset took: 0.0089s
Splitting the dataset by 66.0%
Creating the model took: 1.7120s
Coefficients:  [-7.582051426755043, 1.854301929346409, 7.193768376521267, -1.70601044011557, -0.5132182256460746, 0.3630667567006922, 4.938894187944461, 3.0229812111891645, 0.7150993199638532]
Correct predictions: 201, incorrect: 60, accuracy: 77.011%
Analyzing dataset took: 0.0034s
Total time to analyze: 1.7155s

Compare to Weka:

Weka 3.6.13 This implementation
Speed 0.01s ~1.7s
Accuracy 81.226% 80.843%
10 runs accuracy 78.651% 76.782%

Notes:

  • The first accuracy is measured without the random shuffle
  • When run the test 10 times dataset is always shuffled before split
  • In a long run it seems that Weka has better results

Example output for 10 runs:

Correct predictions: 196, incorrect: 65, accuracy: 75.096%
Correct predictions: 200, incorrect: 61, accuracy: 76.628%
Correct predictions: 201, incorrect: 60, accuracy: 77.011%
Correct predictions: 206, incorrect: 55, accuracy: 78.927%
Correct predictions: 203, incorrect: 58, accuracy: 77.778%
Correct predictions: 197, incorrect: 64, accuracy: 75.479%
Correct predictions: 201, incorrect: 60, accuracy: 77.011%
Correct predictions: 199, incorrect: 62, accuracy: 76.245%
Correct predictions: 200, incorrect: 61, accuracy: 76.628%
Correct predictions: 201, incorrect: 60, accuracy: 77.011%
Total accuracy in 10 runs: 76.782%

Requirements to run

  1. python 3

Sources

Performance measured on:
  • i5-2410M CPU @ 2.30GHz
  • Python 3.5.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.