Giter Club home page Giter Club logo

sachelsout / effect-of-collinear-features-on-linear-models Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 56 KB

This repository shows, how linear models behave if the features of the dataset are collinear in nature. Support Vector Machine(SVM) and Logistic Regression(LR) algorithms are used as linear models. Weights and accuracy scores are recorded in different scenarios.

Jupyter Notebook 100.00%
collinearity data-science gaussian linear-models logistic-regression machine-learning multicollinearity noise python svm

effect-of-collinear-features-on-linear-models's Introduction

effect-of-collinear-features-on-linear-models

This repository shows, how linear models behave if the features of the dataset are collinear in nature. Support Vector Machine(SVM) and Logistic Regression(LR) algorithms are used as linear models. Weights and accuracy scores are recorded in different scenarios.

What are collinear features

image
Collinear features are the features which are correlated with each other. A change in one feature can cause changes in the correlated features as well which is not good. Due to multicollinearity, we cannot interpret feature importances correctly as we can't trust the model's weights/coeffecients. Also, due to presence of collinear features, small change in the data can impact comparatively larger change in the weights of the trained model. Also, multicollinearity does not impact accuracy of the model which can act as a disguise metric to make us believe everything is correct.

Perturbation test

Perturbation means adding noise, usually to the training data. This is done to detect the multicollinearity in machine learning. Here in this project, a small gaussian noise is added (mean of 0.01 and variance 0) to the original data and the accuracy, weights/coeffecients are compared with that of original data.
The above process is done for both Logistic Regression and SVM trained models and the results obtained are nearly same for both the linear models. There is no change in accuracy observed (got 1.0 accuracy for original data as well as modified data). But there are changes in the weights of both the models for original data and modified data, which indicates presence of multicollinearity.

effect-of-collinear-features-on-linear-models's People

Contributors

sachelsout avatar

Watchers

 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.