Enhance documentation with usage examples for statistical routines and utilities

This commit is contained in:
Palash Tyagi
2025-08-03 16:48:02 +01:00
parent d1dd7ea6d2
commit e6964795e3
6 changed files with 75 additions and 0 deletions

View File

@@ -1,3 +1,15 @@
//! Descriptive statistics for matrices.
//!
//! Provides means, variances, medians and other aggregations computed either
//! across the whole matrix or along a specific axis.
//!
//! ```
//! use rustframe::compute::stats::descriptive;
//! use rustframe::matrix::Matrix;
//!
//! let m = Matrix::from_vec(vec![1.0, 2.0, 3.0, 4.0], 2, 2);
//! assert_eq!(descriptive::mean(&m), 2.5);
//! ```
use crate::matrix::{Axis, Matrix, SeriesOps};
pub fn mean(x: &Matrix<f64>) -> f64 {