import type { CoreClusteringParams, DataMatrix } from '../clustering/types'; /** * Principal Component Analysis matching scikit-learn's `PCA(svd_solver='full')` * numerically (up to per-component sign). * * The TensorFlow.js backend has no eigendecomposition, so the leading * components are found by power iteration with deflation on the (mean-centered) * covariance matrix. The same power-iteration core seeds SOM `'linear'`/`'pca'` * weight initialization, keeping map seeding and public reduction numerically * identical. */ export interface PCAParams extends CoreClusteringParams { /** Must be ≤ n_features. */ n_components: number; } export interface PCAJSON { params: PCAParams; components_: number[][]; explained_variance_: number[]; mean_: number[]; } export interface EigResult { /** Eigenvectors as rows, most-significant first. */ components: number[][]; /** Corresponding eigenvalues, descending. */ eigenvalues: number[]; } /** * Unit-norm power-iteration start vector for component `c`: the candidate * normalized, or the `c % d` standard basis vector when the candidate has * zero norm (so iteration always starts from a valid direction). */ export declare function unit_init_vector(candidate: number[], c: number): number[]; /** * Top-`k` eigenvectors/eigenvalues of a symmetric matrix via power iteration * with deflation. Deterministic for a fixed `random_state`. Shared by * {@link PCA} and SOM principal-component initialization. * */ export declare function power_iteration_eig(matrix: number[][], k: number, random_state?: number): EigResult; export declare class PCA { readonly params: PCAParams; /** Principal axes as rows (`n_components × n_features`). Null until `fit`. */ components_: number[][] | null; explained_variance_: number[] | null; /** Per-feature empirical mean used for centering. Null until `fit`. */ mean_: number[] | null; constructor(params: PCAParams); fit(X: DataMatrix): this; transform(X: DataMatrix): number[][]; fit_transform(X: DataMatrix): number[][]; inverse_transform(Z: DataMatrix): number[][]; /** PCA is a dimensionality reducer, not a clusterer. */ fit_predict(_X: DataMatrix): never; to_json(): PCAJSON; static from_json(json: PCAJSON): PCA; } //# sourceMappingURL=pca.d.ts.map