Skip to content

v1.5.0 — neural networks, and the scaling bug they exposed

Choose a tag to compare

@cattolatte cattolatte released this 27 Jul 12:06

A training loop is part of the toolkit. michi already owned one — bench, tune, and fit all call .fit(), and for hist-gbm that's 500 boosting iterations with early stopping. But the catalogue had fourteen models and not one network, so the loop an engineer actually retypes was the one michi didn't write.

Two networks, no new architecture

michi bench data.csv --target y --models rf,hist-gbm,mlp     # no extra install
michi tune  data.csv --target y --model mlp --save-params best.yaml
michi fit   data.csv --target y --model mlp --params best.yaml -o model.joblib
Model Needs What it is
mlp nothing Feed-forward net on scikit-learn's loop
torch-mlp pip install 'komichi[torch]' Epochs, Adam, mini-batches, validation split, early stopping, best-weight restore

Both are ordinary catalogue entries. Because they satisfy fit/predict, every verb already works on them with no special case anywhere in michi — a network is cross-validated, significance-tested, and held against the dummy baseline exactly like a random forest. michi never presents "we used deep learning" as a result.

tune --list-space --model torch-mlp shows layer sizes, dropout, learning rate, and batch size as what they are: hyperparameters, not defaults michi picked for your data.

The bug the networks found

mlp scored exactly the dummy baseline on a dataset where linear regression scored 0.89. The cause wasn't the network.

When a recipe names a column, transformer_specs replaced michi's handling of it — including the standardisation scale-sensitive models depend on. An imputed salary reached the estimator in the tens of thousands while every other feature sat near zero.

This was never only about neural networks. linear, ridge, lasso, knn, and svm were all quietly degraded whenever a recipe had a fitted step, and had been since recipes and bench were first composed.

Before After
Max feature magnitude 56,542 7.0
mlp balanced accuracy 0.5000 0.8757

The recipe still decides what happens to a column; scaling is appended after it rather than instead of it. Two tests pin it — one that a claimed column arrives scaled, one that a scale-invariant model is still left alone, because the fix must not start standardising for trees.

Where the line is now

"No training loops" was too broad and the roadmap now says so properly. What michi still won't do is ship a per-architecture zoo: convolutional and sequence models need data michi doesn't model, and that would turn the catalogue into a framework. Bring those through module:object or a plugin — eval and predict already accept them.

Install: pip install komichi · with networks: pip install 'komichi[torch]'