dendritic_preprocessing/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

//! # Dendritic Preprocessing Crate
//!
//! This crate contains functionality for performing normalization of data during the preprocessing stage for a model.
//! Contains preprocessing for encoding and standard scaling.
//!
//! ## Features
//! - **Standard Scalar**: Standard scalar and min max normlization of data.
//! - **Encoding**: One hot encoding for multi class data
//!
//! ## Getting Started
//! To get started, add this to your `Cargo.toml`:
//! ```toml
//! [dependencies]
//! dendritic-preprocessing = "0.1"
//! ```
//! ## Example Usage
//! This is an example of using the one hot encoder for data with multiple class labels
//! ```rust
//! use dendritic_ndarray::ndarray::NDArray;
//! use dendritic_preprocessing::encoding::{OneHotEncoding};
//! 
//! fn main() {
//!
//!    // Data to one hot encode for multi class classification
//!    let x = NDArray::array(vec![10, 1], vec![
//!        1.0,2.0,0.0,2.0,0.0,
//!        0.0,1.0,0.0,2.0,2.0
//!    ]).unwrap();
//!
//!    let mut encoder = OneHotEncoding::new(x).unwrap();
//!    println!("Max Value: {:?}", encoder.max_value()); // 3.0
//!    println!("Num Samples: {:?}", encoder.num_samples()); // 10.0 
//!
//!    let encoded_vals = encoder.transform();
//!    println!("Encoded Values: {:?}", encoded_vals); 
//!
//! }
//! ```
//! ## Disclaimer
//! The dendritic project is a toy machine learning library built for learning and research purposes.
//! It is not advised by the maintainer to use this library as a production ready machine learning library.
//! This is a project that is still very much a work in progress.
pub mod standard_scalar;
pub mod encoding;