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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
//! Machine learning models for clustering, classification, regression, dimensionality
//! reduction, and anomaly detection
//!
//! This module groups models by algorithm family into submodules:
//! [`clustering`],
//! [`decomposition`],
//! [`linear_model`],
//! [`manifold`], [`svm`],
//! [`tree`], [`neighbors`],
//! [`discriminant_analysis`], and
//! [`ensemble`]. This module also re-exports every estimator,
//! so it is reachable directly as `machine_learning::<Model>`. Supervised and unsupervised
//! estimators implement the shared [`Fit`] /
//! [`Predict`] traits. The dimensionality-reduction
//! transformers implement [`Transform`] /
//! [`FitTransform`].
//!
//! # Supervised learning
//!
//! ## Classification
//! - **LogisticRegression**: binary classification via gradient descent, with L1/L2 regularization
//! - **KNN**: k-nearest neighbors with selectable distance metric
//! (Euclidean/Manhattan/Minkowski) and weighting
//! - **DecisionTree**: classifier supporting ID3, C4.5, and CART, with pruning options
//! - **SVC**: support vector classifier using Sequential Minimal Optimization (SMO) with kernels
//! - **LinearSVC**: linear support vector classifier for large datasets, with hinge loss
//! - **LDA**: linear discriminant analysis for classification and supervised
//! dimensionality reduction
//!
//! ## Regression
//! - **LinearRegression**: simple and multivariate linear regression with L1/L2 regularization
//!
//! # Unsupervised learning
//!
//! ## Clustering
//! - **KMeans**: k-means with k-means++ initialization and parallel assignment
//! - **DBSCAN**: density-based clustering of arbitrary-shaped clusters, with noise detection
//! - **MeanShift**: non-parametric clustering that discovers the number of clusters
//!
//! ## Dimensionality reduction
//! - **PCA**: principal component analysis (linear)
//! - **KernelPCA**: nonlinear reduction via kernels (RBF, Linear, Poly, Sigmoid, Cosine)
//! - **TSNE**: t-distributed stochastic neighbor embedding for visualization
//!
//! ## Anomaly detection
//! - **IsolationForest**: ensemble isolation-based anomaly detector
//!
//! # Shared types
//!
//! - [`DistanceCalculationMetric`]:
//! Euclidean/Manhattan/Minkowski dispatcher, re-exported from [`crate::math`]
//! - [`RegularizationType`]: L1 / L2
//! regularization
//! - [`KernelType`] /
//! [`Gamma`]: kernel selection and coefficient
//!
//! # Examples
//!
//! ```rust
//! use rustyml::machine_learning::{LeastSquaresSolver, LinearRegression};
//! use ndarray::array;
//!
//! let mut model = LinearRegression::new(true).with_solver(LeastSquaresSolver::GradientDescent { learning_rate: 0.01, max_iter: 1000, tol: 1e-6 }).unwrap();
//! let x = array![[1.0, 2.0], [2.0, 3.0], [3.0, 4.0]];
//! let y = array![6.0, 9.0, 12.0];
//! model.fit(&x, &y).unwrap();
//! ```
//!
//! [`clustering`]: crate::machine_learning::clustering
//! [`decomposition`]: crate::machine_learning::decomposition
//! [`linear_model`]: crate::machine_learning::linear_model
//! [`manifold`]: crate::machine_learning::manifold
//! [`svm`]: crate::machine_learning::svm
//! [`tree`]: crate::machine_learning::tree
//! [`neighbors`]: crate::machine_learning::neighbors
//! [`discriminant_analysis`]: crate::machine_learning::discriminant_analysis
//! [`ensemble`]: crate::machine_learning::ensemble
//! [`Fit`]: crate::traits::Fit
//! [`Predict`]: crate::traits::Predict
//! [`Transform`]: crate::traits::Transform
//! [`FitTransform`]: crate::traits::FitTransform
//! [`DistanceCalculationMetric`]: crate::math::DistanceCalculationMetric
//! [`RegularizationType`]: crate::machine_learning::types::RegularizationType
//! [`KernelType`]: crate::machine_learning::types::KernelType
//! [`Gamma`]: crate::machine_learning::types::Gamma
pub use crateDistanceCalculationMetric;
/// The crate-wide estimator traits, re-exported here for convenience. Their canonical
/// home is [`crate::traits`]
pub use crate;
pub use ;
/// Clustering estimators: DBSCAN, K-means, and Mean Shift
/// Decomposition estimators: PCA and Kernel PCA
/// Discriminant analysis: Linear Discriminant Analysis (LDA)
/// Ensemble models: Isolation Forest
/// Linear models: linear and logistic regression
/// Manifold-learning estimators: t-SNE
/// Nearest-neighbor models: K-Nearest Neighbors
/// Support vector machines: SVC and Linear SVC
/// Tree models: decision trees
/// Decision-tree error type, aggregated into the crate-wide [`Error`](crate::error::Error)
/// Internal linear-algebra primitives shared across estimator families: dense factorizations
/// (symmetric eigendecomposition, SVD, thin QR) plus iterative top-`k` eigensolvers (power
/// iteration, Lanczos)
pub
/// Internal shared helpers for parallel/sequential dispatch across models
/// Internal kd-tree spatial index for fixed-radius and k-nearest-neighbor queries
pub
/// Shared configuration types: kernel selection (`KernelType`), kernel coefficient (`Gamma`), and
/// regularization (`RegularizationType`)
/// Internal shared input-validation helpers used by every model
pub use ;
pub use ;
pub use ;
pub use ;
pub use TreeError;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;