Skip to content

Machine learning

Planned for wave 3: clustering, classification and model selection, validated against scikit-learn.

Status: planned, wave 3; repositories not created yet, one per algorithm family, names not fixed.

Clustering, classification and model selection in pure Go (PLAN.md item 15, wave 3). The bibliography sizes the work as XL and proposes splitting it per algorithm, so the repository layout is not fixed.

No code exists yet: nothing on this page is released, measured or tested. It says what the library is planned to provide and how it will be checked. The wave and the order are in PLAN.md; the state of each item in STATUS.md.

What it will provide

Clusteringk-means (Lloyd, k-means++ seeding), hierarchical clustering, DBSCAN, Gaussian mixtures by EM
Dimension reductionPCA, factor analysis and rotations
Classificationlogistic regression, SVM (SMO and dual coordinate descent), decision trees, random forests, gradient boosting, k-NN
Model selectioncross-validation splitters, grid search, metrics (accuracy, ARI and others)
Neural networksdeferred, priority 3: nn on top of go-autodiff’s reverse mode, outside the first scope

References

The references the work starts from (bibliography first):

Reference implementations

ImplementationLicence and use
scikit-learn (Python/Cython)BSD-3-Clause; port permitted: k-means, DBSCAN, trees, forests, GMM
LIBSVM, LIBLINEAR (C/C++)BSD-3-Clause; port permitted: SVM and logistic regression
malaschitz/randomForest (Go)Apache-2.0; a reuse candidate
golearn (Go)MIT; inspect only, last push 2024-01

How it will be validated

Reference tools are run as oracles, driven from Go by exec with JSON on a pipe; the unit suite must pass with no oracle installed.

OracleHow
scikit-learn, statsmodelsuv run --with scikit-learn --with statsmodels; JSON in, JSON out
UCI Machine Learning Repositoryhttps://archive.ics.uci.edu (iris, wine, digits); per-dataset licences to check

What “correct” means:

AreaCriterion
Clustering and classificationdeterministic given a seed: partitions exact against scikit-learn with the same initialisation; adjusted Rand index equal to 1 on a shared init
Accuracywithin cross-validation noise of the oracle

Risks and open questions

  • Linear algebra is the bottleneck: PCA, SVM and GMM need QR, Cholesky and symmetric eigen solvers tested to LAPACK accuracy; check what go-ndarray and gonum provide before sizing.
  • Corpus licences (UCI datasets) must be checked per file; prefer download-on-demand into a directory outside the repositories.
  • The name go-learn is taken, so the organisation is go-mlkit.

Created on by tannevaled

Modified on by tannevaled