Giter Site home page Giter Site logo

guilhermedom / pca-multivariate-regression Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 159 KB

Quick analysis on multivariate regression using PCA and R2 score to select variables.

License: MIT License

Jupyter Notebook 100.00%
pca python r2-score boston-housing-dataset clustering iris-dataset machine-learning polynomial-features polynomial-regression regression-model

pca-multivariate-regression's Introduction

PCA Multivariate Regression

A quick analysis on multivariate regression using Principal Component Analysis (PCA), PolynomialFeatures and R2 score to find a good and simple regression model.

Problem Overview

Regression analysis is a powerful tool to predict variables when there is historical data to adjust a regression model. However, sometimes the data is not distributed in space in a linear manner, but rather in a polynomial fashion (quadratic, cubic or higher).

Sometimes, the data may be grouped in separate clusters. Take a 2D, dimensionality reduced, Iris dataset for instance:

iris_2d_plot

A linear regression curve, fitted to Iris' linear features, will achieve a hyperplane that falls in between the two clusters of data:

iris_3d_plot_regression_hyperplane

Analysis Introduction

A linear regression model cannot work on a setting with two features scattered in a non-linear manner, since it does not have enough variables to fit a good curve.

To overcome this situation, a good usage of the PCA method can result in a good dimensionality reduction that will generate a dataset with less features, but still being representative of the original data. However, simplifying the data may not be enough to get a simple model that fits well to the data. PolynomialFeatures (scikit-learn), on the other hand, is a method that takes linear features and combines them, eventually creating polynomial features.

In this project we use a notebook to analyze multivariate regression models using two popular datasets with distinct challenges involved, Iris and Boston Housing. We demonstrate how PolynomialFeatures and PCA techniques can be combined to help regression models achieve very good performances on datasets with irregular distributions.

With PCA simplifying our data, and training a regression model using polynomial features, it is possible to find a good fit without needing a complex model.

pca-multivariate-regression's People

Contributors

guilhermedom 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.