Giter VIP home page Giter VIP logo

regression's Introduction

Regression


Author: Soundouss MESSOUDI
Description: The objective of this repository is to implement linear and logistic regression from scratch in Python.
Version: 1.0
Licence: by Soundouss MESSOUDI 2018

Linear regression

First, I started by defining the loss function and the function for learning the linear regression parameters.

Second, I generated a regression dataset using sklearn with 200 samples, 5 features from which 4 are informative and with no bias. This dataset was divided into train and test sets with a test size of 20%.

Third, I added and array of ones in the beginning of the train and test sets. Then I learned the parameters with the defined function and sklearn linear regression and used both of them to predict Y test values.

Finally, I printed the results. The first element in the learned parameters' array represents the bias which is close to zero and reflects the bias chosen in the dataset generation. The other elements represent the values of the parameters for each feature. Only one of them has a value close to zero since I chose that 4 out of the 5 features are informative. The losses of the learned parameters and the sklearn parameters are very close, reflecting the correctness of the implemented linear regression.

regression's People

Contributors

m-soundouss avatar

Watchers

 avatar  avatar

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.