Giter Club home page Giter Club logo

pybiplot's Introduction

PyBiPlot: Principal Component Analysis Visual

This aims to reproduce the R's biplot visual for PCA where the visual combines both the scores and loadings. You'll see arrows representing the original variables' contributions to each principal component, and you'll also see how the data points project onto the components.

PyPi link: PyPi link

Explanation of PCA and PyBiPlot usecase link: PCA link

Features:

  • Flexibility through Optional Parameters: Multiple optional parameters allow users to customize the plot's appearance.

  • Support for Overlaying Plots: Users can decide to overlay the samples and loadings plots or display them side by side.

  • Dynamic Labeling: The script supports dynamic labeling based on the actual values of the projected data, loadings, and explained variances.

  • Arrow Representations for Loadings: Loadings are represented as arrows, pointing in the direction and magnitude of the loading.

Use:

BiPlot(ProjectedData, Loadings, ExplainedVar, **kwargs).plot()
  • ProjectedData: (pd.DataFrame) - The projected data.
  • Loadings: (pd.DataFrame) - The loadings data.
  • ExplainedVar: (list) - Explained variance for the components.

Optional Parameters (kwargs):

  • Fig_size: Figure size (default is (16, 12))
  • Fig_size_sub: Figure size for subplots (default is (20, 12))
  • Overlaid: Flag to overlay plots or not (default is True)
  • Plot_style: Style of the plot (default is 'seaborn-v0_8-bright')
  • Sample_colors: Colors for samples (default is 'blue')
  • Sample_size: Size of the sample points (default is 15)
  • Sample_labels: Flag to show sample labels or not (default is True)
  • Sample_labels_color: Color for sample labels (default is 'black')
  • Sample_labels_size: Size of the sample labels (default is 10)
  • Sample_labels_shift: Shift for sample labels (default is .02)
  • Arrow_colors: Color of the arrows (default is 'red')
  • Arrow_head_size: Size of the arrow heads (default is 0.05)
  • Arrow_labels: Flag to show arrow labels or not (default is True)
  • Arrow_labels_size: Size of the arrow labels (default is 10)
  • Arrow_labels_color: Color of the arrow labels (default is 'black')
  • Arrow_labels_shift: Shift for arrow labels (default is 1.15)
  • X_label_size: Size of the X-axis label (default is 15)
  • Y_label_size: Size of the Y-axis label (default is 15)
  • Title_size: Size of the title (default is 20)

pybiplot's People

Contributors

adames-ouro avatar

Stargazers

 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.