Expand description
Classification (ISL ch 4) — generative and instance-based classifiers.
knn— k-nearest-neighbours (lazy,AllPairs).naive_bayes— Gaussian naive Bayes (generative,Reduction).
LDA / QDA (shared / per-class Gaussian discriminants) land here next, on the
linear_algebra covariance solve (build order in stats_plan.md).
Re-exports§
pub use discriminant::LdaModel;pub use discriminant::QdaModel;pub use knn::KnnClassifier;pub use naive_bayes::GaussianNb;pub use svm::Kernel;pub use svm::Svm;pub use svm_multiclass::MulticlassSvm;
Modules§
- discriminant
- Discriminant analysis (ISL ch 4.4) — LDA (shared covariance ⇒ linear boundary)
and QDA (per-class covariance ⇒ quadratic boundary). Both are Gaussian
generative classifiers; the covariance inverse / log-determinant come from
linear_algebra::cholesky(no new solver). Kernel-classDenseLinear. - knn
- k-Nearest-Neighbours classifier (ISL ch 2/4) — a lazy learner: store the
training set, classify a query by majority vote of its
knearest neighbours (squared Euclidean). Kernel-classAllPairs(query↔train distances). - naive_
bayes - Gaussian Naive Bayes (ISL ch 4.4.4) — a generative classifier assuming the
features are conditionally independent Gaussians given the class. Fit per-class
priors and per-feature mean/variance (reusing
statistics::descriptive); classify by the argmax log-posterior. Kernel-classReduction. - svm
- Support Vector Machine (ISL ch 9, PRML ch 7) — soft-margin binary classifier
trained by simplified Sequential Minimal Optimization (SMO) on the dual, with a
linear or RBF (Gaussian) kernel. Kernel SVM separates classes a linear boundary
cannot. Labels are boolean (true = +1, false = −1). Kernel-class
DenseLinear(the kernel matrix) +Divergent(the SMO working-set loop) → CPU here. - svm_
multiclass - Multiclass SVM by one-vs-rest (ISL ch 9.4.2) — train one binary SVM per class
(that class vs. all others) and predict the class whose decision value is
largest. Reuses the binary
super::svm(no duplicated SMO).