analysis.dimensionality_reduction.pca_dim_reduction¶
Methods for dimensionality reduction using PCA.
Functions
|
Plot scatter of PCA components colored by the given features. |
|
Plot inverse transform of PCA. |
|
Run Principal Component Analysis (PCA) on simulation data. |
|
Save PCA results data. |
|
Save PCA trajectories data. |
|
Save PCA transform data. |
- run_pca(data: DataFrame) tuple[DataFrame, PCA] [source]¶
Run Principal Component Analysis (PCA) on simulation data.
- Parameters:
data – Simulated fiber data.
- Returns:
Dataframe with PCA components appended and the PCA object.
- save_pca_results(pca_results: DataFrame, save_location: str, save_key: str, resample: bool = True) None [source]¶
Save PCA results data.
- Parameters:
pca_results – PCA trajectory data.
save_location – Location for output file (local path or S3 bucket).
save_key – Name key for output file.
resample – True if data should be resampled before saving, False otherwise.
- save_pca_trajectories(pca_results: DataFrame, save_location: str, save_key: str) None [source]¶
Save PCA trajectories data.
- Parameters:
pca_results – PCA trajectory data.
save_location – Location for output file (local path or S3 bucket).
save_key – Name key for output file.
- save_pca_transforms(pca: PCA, points: list[list[float]], save_location: str, save_key: str) None [source]¶
Save PCA transform data.
- Parameters:
pca – PCA object.
points – List of inverse transform points.
save_location – Location for output file (local path or S3 bucket).
save_key – Name key for output file.
- plot_pca_feature_scatter(data: DataFrame, features: dict, pca: PCA, save_location: str | None = None, save_key: str = 'pca_feature_scatter.png') None [source]¶
Plot scatter of PCA components colored by the given features.
- Parameters:
data – PCA results data.
features – Map of feature name to coloring.
pca – PCA object.
save_location – Location for output file (local path or S3 bucket).
save_key – Name key for output file.
- plot_pca_inverse_transform(pca: PCA, pca_results: DataFrame, save_location: str | None = None, save_key: str = 'pca_inverse_transform.png') None [source]¶
Plot inverse transform of PCA.
- Parameters:
pca – PCA object.
pca_results – PCA results data.
save_location – Location for output file (local path or S3 bucket).
save_key – Name key for output file.