Giter Club home page Giter Club logo

Comments (4)

hosseinmoein avatar hosseinmoein commented on June 2, 2024

Matrix and DataFrame are very different data structures and used for different kind of analysis. If you simply want to transferer the data from one structure to another, it is very easy. Both Eigen and DataFrame use std::vectors as their underlying data container. But I believe Eigen matrix requires special alignment which DataFrame also gives you the tools for it. Read the documentation here https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html.

But of you intend to substitute Eigen matrix with DataFrame and run matrix operations on DataFrame, that’s a very bad idea. In other words; a DataFrame is not a matrix and a matrix is not a DataFrame

from dataframe.

shaojunjie0912 avatar shaojunjie0912 commented on June 2, 2024

Thanks for your reply. Here's my situation.

I'm currently implementing the Principal Component Analysis (PCA) algorithm in C++, and I've implemented a basic version with the Eigen library.

Now I want to use the DataFrame library to implement it, because DataFrame provides a lot of data analysis functions (thanks for your work), but in the PCA algorithm I need to calculate the eigenvalues and eigenvectors of the whole data covariance matrix, or the SVD decomposition of the whole data matrix.

However, I noticed that the DataFrame library does not have similar functions, so I want to combine the DataFrame library and the Eigen library, use the Eigen library to solve the covariance matrix, and then convert it to the DataFrame for further analysis.

I don't know if my idea of implementing PCA complicates a simple problem, or if I don't need to use the functionality of the DataFrame library at all.

Thank you!

from dataframe.

hosseinmoein avatar hosseinmoein commented on June 2, 2024

Yes, DataFrame doesn't have Eigen values and vectors and svc, because the data in a DataFrame is not layed out efficiently for those calculations. I have another matrix library (https://github.com/hosseinmoein/Tiger) that has those and more. You may want to look at it.

In any case, moving data between a matrix and DataFrame should be very easy.

from dataframe.

shaojunjie0912 avatar shaojunjie0912 commented on June 2, 2024

Thanks a lot, I will have a try.

from dataframe.

Related Issues (20)

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.