3D Regression after doing PCA

조회 수: 4 (최근 30일)
Maggie
Maggie 2024년 4월 18일
답변: Taylor 2024년 4월 18일
Here is my current code - I am using PCA on RGB values which correspond to a pH...one component explains 86% of the data so I am thinking of using 2 components for the regression. I am unsure how to do this, so my current code has 3 methods from chatGPT, only one of which is working. If anyone has any ideas, that would be greatly appreciated. I have included the code and the data. I want to be able to input RGB values and have it output an estimated pH.
The goal is:
a projection of measurements onto principal components as the independent variable, and the target value as the dependent variable
Test the curves on out-of-distribution data (data not used to fit the curves) to get a measurement of the amount of error in the curve. If necessary, repeat step 3 by varying the type of curve fit or the number of principal components used until a satisfactory result is obtained

답변 (1개)

Taylor
Taylor 2024년 4월 18일
You want to use the second ouput of pca (score in your code). Each column represents each principal component, where each value of explained contains the percent variances explained by each component.

카테고리

Help CenterFile Exchange에서 Dimensionality Reduction and Feature Extraction에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by