pub struct GpuPCA {
pub n_components: usize,
pub center: bool,
pub components: Option<Array2<f64>>,
pub explained_variance: Option<Array1<f64>>,
pub mean: Option<Array1<f64>>,
/* private fields */
}Expand description
GPU-accelerated Principal Component Analysis
Fields§
§n_components: usizeNumber of components to compute
center: boolWhether to center the data
components: Option<Array2<f64>>Principal components (loading vectors)
explained_variance: Option<Array1<f64>>Explained variance for each component
mean: Option<Array1<f64>>Mean values for centering
Implementations§
Source§impl GpuPCA
impl GpuPCA
Sourcepub fn fit(&mut self, x: &ArrayView2<'_, f64>) -> Result<()>
pub fn fit(&mut self, x: &ArrayView2<'_, f64>) -> Result<()>
Fit the PCA model on GPU
Currently this is a placeholder implementation that will return an error indicating that full GPU PCA support is not yet implemented.
§Arguments
x- Input data matrix with shape (n_samples, n_features)
§Errors
Returns an error indicating that GPU PCA is not fully implemented yet
§Examples
let mut pca = GpuPCA::new(2)?;
let data = Array2::zeros((100, 5));
// This will return an error indicating GPU PCA is not implemented
pca.fit(&data.view())?;Sourcepub fn transform(&self, x: &ArrayView2<'_, f64>) -> Result<Array2<f64>>
pub fn transform(&self, x: &ArrayView2<'_, f64>) -> Result<Array2<f64>>
Transform data using the fitted PCA model on GPU
Currently this is a placeholder implementation that will return an error indicating that full GPU PCA support is not yet implemented.
§Arguments
x- Input data matrix with shape (n_samples, n_features)
§Returns
Transformed data matrix with shape (n_samples, n_components)
§Errors
Returns an error indicating that GPU PCA is not fully implemented yet
Sourcepub fn fit_transform(&mut self, x: &ArrayView2<'_, f64>) -> Result<Array2<f64>>
pub fn fit_transform(&mut self, x: &ArrayView2<'_, f64>) -> Result<Array2<f64>>
Fit the PCA model and transform data in one step
Currently this is a placeholder implementation that will return an error indicating that full GPU PCA support is not yet implemented.
§Arguments
x- Input data matrix with shape (n_samples, n_features)
§Returns
Transformed data matrix with shape (n_samples, n_components)
§Errors
Returns an error indicating that GPU PCA is not fully implemented yet
Auto Trait Implementations§
impl Freeze for GpuPCA
impl !RefUnwindSafe for GpuPCA
impl Send for GpuPCA
impl Sync for GpuPCA
impl Unpin for GpuPCA
impl UnsafeUnpin for GpuPCA
impl !UnwindSafe for GpuPCA
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.