Skip to content
learn

Machine learning, as applied in IX — Mission

Conceptual art: an underground city of machines in a vast cavern. Giant brass gears and robotic arms bend over glass domes that hold glowing forges, a walkway spans the rock walls, small human silhouettes cross the floor, and a circular shaft of daylight opens high above.

Conceptual art, not a diagram: an original underground city of precision machines, inspired by the machine planet Ix in Frank Herbert’s Dune. It shows nothing about the IX crates or their code. Generated on the author’s machine with ComfyUI 0.36.0 and Z-Image-Turbo (Apache 2.0 licence), seed 20260927; one 36 × 20 pixel indicator panel was blurred to remove glyph-like marks. Prompt, workflow and timings.

IX is a Rust workspace of machine learning and math algorithms that Claude Code can call as tools: k-means, decision trees, gradient descent, and about eighty crates more. When a tool answers “3 clusters, silhouette 0.50”, I want to know what was computed, whether it’s right, and what a better answer would look like.

The way I learn an algorithm is to write it. Each lesson writes an algorithm in a few dozen lines, runs it and IX’s version on the same data, and compares the two to the last printed digit. When they differ, one of the two is wrong, and finding out which is where I learn the most: this is what the journal records, lesson by lesson.

You write C# or Java. You’re comfortable with high-school algebra: a straight line y = w·x + b, a sum Σ, a square root, a derivative. You don’t need to know any machine learning. You don’t need to know Rust well either: the code uses loops, closures and the matrices of ndarray, and the Rust course covers the rest.

If you’ve used ML.NET, Tribuo or Deeplearning4j, each lesson maps what you know to what IX does.

ML.NET Tribuo IX
Language C#, F# Java Rust
A data set IDataView, typed columns Dataset<T> of Example<T> two ndarray matrices: Array2<f64> features, Array1 labels
A model IEstimator.Fit returns an ITransformer Trainer.train returns a Model a struct with fit and predict (traits Regressor, Classifier, Clusterer)
Preprocessing NormalizeMeanVariance, fitted like a model TransformationMap StandardScaler::fit, then transform
From an AI assistant — — MCP tools such as ix_kmeans and ix_ml_pipeline

Sources: ML.NET tasks and trainers, Tribuo clustering, IX README.

No downloaded data set: both files come from this repository, and data/extract.py rebuilds them from the CI history the DuckDB course exported on 2026-09-14 (runs.json and jobs.json) and from Git:

  • builds.csv, for regression: the 65 successful builds of this site, in commit order, with the number of Markdown pages at that commit (18 to 289) and the seconds of the step that builds them (10 to 48). Does the build time grow with the number of pages?
  • jobs.csv, for classification, clustering and everything after: 186 CI jobs, each with five timings in whole seconds (waiting in the queue, setting up the job, checking out the repository, cleaning up the checkout, completing the job) and the OS of the runner: 121 Ubuntu, 34 Windows, 31 macOS. Can the timings tell which OS ran a job?

The course uses seven IX crates so far: ix-math (statistics, scaling, splitting, calculus), ix-supervised (regression, classification, metrics, cross-validation), ix-optimize (gradient descent, annealing, particle swarm), ix-unsupervised (k-means, DBSCAN, Gaussian mixtures, PCA), ix-ensemble (random forests, gradient boosting), ix-nn (layers, losses, attention) and ix-voicings (the silhouette score and the clustering of guitar voicings). Cargo.toml takes them from Git, pinned to one commit, as the Cargo reference describes:

ix-supervised = { git = "https://github.com/GuitarAlchemist/ix", rev = "490c39533627d296bf9f8f050e6fafc14d7a20c2" }

Every link to IX code in the lessons points to that commit, so the line numbers stay right when IX changes.

By the end of this course, I will be able to

Section titled “By the end of this course, I will be able to”
  • split data for training and testing, pick a baseline, and score a model with the metric that fits the question;
  • fit a straight line two ways, by the closed form and by gradient descent, and say why descent diverges;
  • train and compare logistic regression, k nearest neighbours and a decision tree, with cross-validation;
  • group data without labels with k-means, DBSCAN and a Gaussian mixture, and judge the groups;
  • reduce five dimensions to two, and say exactly what the reduction cost;
  • combine weak models by bagging and by boosting, and know which of the two forgives a bad setting;
  • differentiate a network by hand and check the answer against finite differences;
  • choose an update rule, and recognize a run that diverged from one that converged;
  • read an algorithm in IX, check it against a hand-written version and scikit-learn, and describe a difference precisely.

Lessons 1 to 9 are written. The rest is the plan, one lesson per family of algorithms IX implements, and each will be published with its code and its cross-check like the others.

# Lesson IX crates If you know ML.NET
1 Data, features and evaluation ix-math IDataView, TrainTestSplit, RegressionMetrics
2 Linear regression and gradient descent ix-supervised, ix-optimize Ols, OnlineGradientDescent
3 Classification: logistic regression, k nearest neighbours, decision trees ix-supervised LbfgsLogisticRegression, FastTree, CrossValidate
4 Clustering: k-means, DBSCAN, Gaussian mixtures ix-unsupervised, ix-voicings KMeansTrainer
5 Principal components, and what a variance ratio means ix-unsupervised ProjectToPrincipalComponents
6 Ensembles: bagging, random forests and gradient boosting ix-ensemble FastForest, LightGbm
7 Neural networks, and finite differences as the judge ix-nn —
8 Optimization: descent, momentum, Adam, and searches without a gradient ix-optimize, ix-math —
9 The other reducers: MDS, kernel PCA, NMF, LDA, t-SNE ix-unsupervised —
10 Sequences: Markov chains, hidden Markov models and Viterbi ix-graph —
11 Counting without counting: Bloom filters, HyperLogLog, count-min, cuckoo ix-probabilistic —
12 Automatic differentiation: the Wengert tape ix-autograd —
13 Attention, layer normalization and a transformer block ix-nn —
14 Reinforcement learning: bandits and Q-learning ix-rl —
15 Signals: the Fourier transform, wavelets, filters and Kalman ix-signal —
16 Search: A*, Monte-Carlo tree search, local search ix-search, ix-graph —
17 Evolution: genetic algorithms, differential evolution, Pareto fronts ix-evolution —
18 Adversarial examples, poisoning and the defences ix-adversarial —
19 The shape of data: persistent homology ix-topo, ix-manifold —
20 On the GPU: matrix products, distances and k nearest neighbours in WGSL ix-gpu —
21 Pipelines end to end, and the MCP tools an assistant calls ix-pipeline, ix-agent MLContext
— Every crate and every public function the 80 with a public surface —
— Journal