Skip to main content

StatisticalComputingLibrary

Struct StatisticalComputingLibrary 

Source
pub struct StatisticalComputingLibrary { /* private fields */ }
Expand description

Statistical Computing Library Manager

Implementations§

Source§

impl StatisticalComputingLibrary

Source

pub fn new() -> Self

Create new statistical computing library

Source

pub fn initialize(&mut self) -> Result<(), StatisticalError>

Initialize the library

Source

pub fn create_dataset( &mut self, dataset_id: String, data: Vec<Vec<DataValue>>, column_names: Vec<String>, column_types: Vec<DataType>, privacy_level: PrivacyLevel, ) -> Result<Dataset, StatisticalError>

Create a new dataset

Source

pub fn mean( &mut self, dataset_id: &str, column: &str, privacy_preserved: bool, ) -> Result<StatisticalAnalysisResult<f64>, StatisticalError>

Compute mean of a column

Source

pub fn median( &mut self, dataset_id: &str, column: &str, privacy_preserved: bool, ) -> Result<StatisticalAnalysisResult<f64>, StatisticalError>

Compute median of a column

Source

pub fn variance( &mut self, dataset_id: &str, column: &str, sample: bool, privacy_preserved: bool, ) -> Result<StatisticalAnalysisResult<f64>, StatisticalError>

Compute variance of a column

Source

pub fn correlation( &mut self, dataset_id: &str, column1: &str, column2: &str, method: CorrelationMethod, privacy_preserved: bool, ) -> Result<StatisticalAnalysisResult<f64>, StatisticalError>

Compute correlation between two columns

Source

pub fn t_test( &mut self, dataset_id: &str, column: &str, hypothesis_type: HypothesisType, privacy_preserved: bool, ) -> Result<StatisticalAnalysisResult<TTestResult>, StatisticalError>

Perform t-test

Source

pub fn histogram( &mut self, dataset_id: &str, column: &str, bins: usize, privacy_preserved: bool, ) -> Result<StatisticalAnalysisResult<HistogramResult>, StatisticalError>

Generate histogram

Source

pub fn standard_deviation( &self, dataset_id: &str, column: &str, sample: bool, ) -> Result<StatisticalAnalysisResult<f64>, StatisticalError>

Standard deviation (sample = true → Bessel-corrected).

Source

pub fn skewness( &self, dataset_id: &str, column: &str, ) -> Result<StatisticalAnalysisResult<f64>, StatisticalError>

Sample skewness (Fisher-Pearson).

Source

pub fn kurtosis( &self, dataset_id: &str, column: &str, ) -> Result<StatisticalAnalysisResult<f64>, StatisticalError>

Excess kurtosis.

Source

pub fn mode( &self, dataset_id: &str, column: &str, ) -> Result<ModeResult, StatisticalError>

Modal value + its frequency.

Source

pub fn quantile( &self, dataset_id: &str, column: &str, q: f64, ) -> Result<StatisticalAnalysisResult<f64>, StatisticalError>

The q-quantile (q ∈ [0,1]) via linear interpolation between order statistics. percentile is the same with p ∈ [0,100].

Source

pub fn covariance( &self, dataset_id: &str, column_x: &str, column_y: &str, sample: bool, ) -> Result<StatisticalAnalysisResult<f64>, StatisticalError>

Covariance between two columns (sample = true → divide by n-1).

Source

pub fn linear_regression( &self, dataset_id: &str, column_x: &str, column_y: &str, ) -> Result<LinearRegression, StatisticalError>

Ordinary-least-squares simple linear regression y ~ x with full inferential statistics (slope/intercept, R², standard errors, t, p).

Source

pub fn polynomial_regression( &self, dataset_id: &str, column_x: &str, column_y: &str, degree: usize, ) -> Result<PolynomialFit, StatisticalError>

Polynomial regression y ~ poly(x, degree) by least squares (normal equations). Returns ascending-power coefficients and in-sample R².

Source

pub fn logistic_regression( &self, dataset_id: &str, feature_columns: &[&str], label_column: &str, fit_intercept: bool, ) -> Result<GlmModel, StatisticalError>

Binary logistic regression by IRLS (label in {0,1}), with Wald standard errors, z-statistics and p-values on the coefficients.

Source

pub fn anova( &self, dataset_id: &str, group_columns: &[&str], ) -> Result<AnovaResult, StatisticalError>

One-way ANOVA across the named columns (each column is a group). Groups may have unequal lengths; Null cells are dropped per column.

Source

pub fn chi_square_gof( &self, dataset_id: &str, observed_column: &str, expected_column: Option<&str>, ) -> Result<ChiSquareResult, StatisticalError>

Chi-square goodness-of-fit test: observed counts vs. expected counts. If expected_column is None, a uniform expectation is used.

Source

pub fn chi_square_independence( &self, dataset_id: &str, columns: &[&str], ) -> Result<ChiSquareResult, StatisticalError>

Chi-square test of independence over a contingency table whose columns are the named columns (each row of the table is one dataset row).

Source

pub fn autocorrelation( &self, dataset_id: &str, column: &str, lag: usize, ) -> Result<StatisticalAnalysisResult<f64>, StatisticalError>

Autocorrelation of a column at the given lag (biased estimator).

Source

pub fn moving_average( &self, dataset_id: &str, column: &str, window: usize, ) -> Result<Vec<f64>, StatisticalError>

Simple moving average of a column with the given window.

Source

pub fn exponential_smoothing( &self, dataset_id: &str, column: &str, alpha: f64, ) -> Result<Vec<f64>, StatisticalError>

Single exponential smoothing of a column with factor alpha ∈ (0,1].

Source

pub fn kmeans( &self, dataset_id: &str, feature_columns: &[&str], k: usize, max_iter: usize, seed: u64, ) -> Result<KMeansModel, StatisticalError>

K-means clustering over the named feature columns. Returns the fitted model (centroids, per-point labels, inertia, convergence).

Source

pub fn linear_svm( &self, dataset_id: &str, feature_columns: &[&str], label_column: &str, c: f64, ) -> Result<SvmFitResult, StatisticalError>

Soft-margin linear SVM over the named feature columns with a boolean label column (non-zero = positive class). Returns a fit summary with support-vector count and in-sample accuracy.

Source

pub fn random_forest( &self, dataset_id: &str, feature_columns: &[&str], target_column: &str, n_trees: usize, classifier: bool, seed: u64, ) -> Result<RandomForestFitResult, StatisticalError>

Random-forest fit over the named feature columns and a target column. classifier = true fits a classification forest (integer labels) and reports in-sample accuracy; otherwise a regression forest reporting R².

Source

pub fn get_performance_stats(&self) -> SystemMetrics

Get performance statistics

Source

pub fn list_datasets(&self) -> Vec<String>

List all datasets

Source

pub fn get_dataset_info(&self, dataset_id: &str) -> Option<DatasetMetadata>

Get dataset information

Auto Trait Implementations§

Blanket Implementations§

§

impl<S, A> Aggregate<Result<S, Error>> for A
where A: Aggregate<S>,

§

fn from_shares<T>(iter: T) -> Result<A, Error>
where T: IntoIterator<Item = Result<S, Error>>,

Aggregate shares in an MPC protocol.
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,