I have 10 embedding vectors each of length 1536 that I wish to reduce the dimensions of using PCA. Should I pass these to the PrincipleComponentAnalysis.Learn and PrincipleComponentAnalysis.Transform methods as double[10][1536] or double[1536][10]?
Reduce an embedding's dimensions using PCA
163 Views Asked by phil At
1
There are 1 best solutions below
Related Questions in C#
- Passing arguments to main in C using Eclipse
- kernel module does not print packet info
- error C2016 (C requires that a struct or union has at least one member) and structs typedefs
- Drawing with ncurses, sockets and fork
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- Configured TTL for A record(s) backing CNAME records
- Allocating memory for pointers inside structures in functions
- Finding articulation point of undirected graph by DFS
- C first fgets() is being skipped while the second runs
- C std library don't appear to be linked in object file
- gcc static library compilation
- How to do a case-insensitive string comparison?
- C programming: Create and write 2D array of files as function
- How to read a file then store to array and then print?
- Function timeouts in C and thread
Related Questions in ACCORD.NET
- How to change the distance calculation between two nodes in an Accord.Collections KDTree?
- How do I calculate posterior probabilities from the results of linear discriminant analysis in Accord.NET?
- Reduce an embedding's dimensions using PCA
- Overcoming Unity IL2CPP compiler issues ("error: unknown type name")
- How do I use Accord.Video.VFM with System.Drawing.Bitmap?
- Screen recorder stopped when another process exists
- Accord .Net for iOS in Unity 3D v2021.3.1
- Accord.NET: Error - There are no samples for class label 0
- C# project in Visual Studio Code is missing the Accord.targets 3.8.0 package
- Accord support for DirectShow
- In Accord.net, why does ResilientBackpropagationLearning.RunEpoch throw an IndexOutOfRangeException?
- Create a neural network to solve the regression problem on the Boston Housing dataset using Accord.net
- how to resolve Accord.Video.FFMPEG error Rational is defined in an assembly that is not referenced
- Accord.Video.FFMPEG getting error for long video
- How to read video frame by frame in C# .NET Framework 4.8?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
PCA provides a wide range of applications, most importantly it rotates your high-dimensional data into a position where the first axis points into the most "important" direction.
In terms of data reduction, there are 3 key topics:
Dropping Needless Dimensions:
in case there are some unused dimensions, PCA allows you to identify them (eigenvalues are zero) and therefore use a low-dim representation of your data without any loss of quality but using less space. imagine 3 points in 5-dimensional space. obviously 3 points always lie in a 2D-plane. Therefore the first two axes (aka eigenvectors aka principal components returned by PCA span your 2D-plane, whereas all the other axes will have eigenvalue 0 - they are not required.
Compression:
Now imagine your 3 points lie almost in a line. This means, the second axis returned by PCA is less "important" to keep the characteristics of your data. You can only store the first axis and more or less, whatever you do with the simplified data will have a similiar output since the information you dropped is almost pointless. The eigenvalue of the second axis will be relatively small compared with the eigenvalue of the first axis. This property is especially usefull when it comes to displaying high-dimensional data, since a plot of the first two axes gives normally the best intuition for your data. There is a nice online tool to play around: https://biit.cs.ut.ee/clustvis/ Just enter some simple data to get used to the fundamental PCA-concepts.
Recreation of data:
Sometimes you want to store your data in the reduced form, but for processing, you like to get back the original (unrotated) data. In this case, you have to store the transformed data AND all the eigenvectors. In case you dropped some of the axes with small, but non-zero eigenvalues, the recreated data will not be 100% accurate. My favorite article to explain the basics of PCA application is https://de.wikipedia.org/wiki/Hauptkomponentenanalyse#Beispiele (unfortunately, it's not available in the english version)
Now back to your question: You want to run a single batch. Otherwise, the axes of your rotated data points into different directions for each batch - which does not help you in general. For your case, think about what you need at the end of the day in terms of the 3 topics above to decide which road to take. Good luck and have fun!