You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`x`: Shall be a rank-2 real array with shape `(m, n)`. It is an `intent(inout)` argument. If `overwrite_x` is `.true.`, `x` may be modified during computation.
313
+
314
+
`components`: Shall be a rank-2 real array with shape `(n_components, n)`. It stores the principal components as rows. It is an `intent(out)` argument.
315
+
316
+
`singular_values`: Shall be a rank-1 real array with shape `(n_components)`. It stores the singular values in descending order. It is an `intent(out)` argument.
317
+
318
+
`x_mean` (optional): Shall be a rank-1 real array with shape `(n)`. It stores the mean of each feature (column). It is an `intent(out)` argument.
319
+
320
+
`method` (optional): Shall be a character string. Either `"svd"` or `"eig"`/`"cov"`. It is an `intent(in)` argument.
321
+
322
+
`overwrite_x` (optional): Shall be a scalar of type `logical`. If `.true.`, the input matrix `x` can be used as a workspace and modified. It is an `intent(in)` argument.
323
+
324
+
`err` (optional): Shall be of type `linalg_state_type`. It is an `intent(out)` argument.
325
+
326
+
### Example
327
+
328
+
```fortran
329
+
{!example/stats/example_pca.f90!}
330
+
```
331
+
332
+
## `pca_transform` - Projects data into principal component space
333
+
334
+
### Status
335
+
336
+
Experimental
337
+
338
+
### Description
339
+
340
+
Projects the input data `x` into the reduced dimensional space defined by the provided principal components.
341
+
The transformation is defined as `x_transformed = (x - x_mean) * components^T`.
0 commit comments