mirror of
https://github.com/hanzoai/ml.git
synced 2026-11-20 23:08:29 +00:00
An example that fits both arms on the ULB card-fraud release — 284,807 real transactions, 492 of them fraud — and prints what each one separates. The isolation forest never sees a label and reaches 0.9606 ROC area on the held-out split, but 0.1545 average precision: at a 1% alarm budget it catches 32 of 49 frauds at 10.1% precision. The logistic fit on the same matrix reaches 0.7953 average precision and catches 45 of 49 at 24.1% precision on half the budget. Both numbers belong in the open because the gap between them is the argument for labelling, and the ROC areas alone would hide it. parquet is a DEV dependency: the crate takes its data as a Matrix, so a file format is never part of what it links.
41 lines
1.8 KiB
TOML
41 lines
1.8 KiB
TOML
[package]
|
|
name = "hanzo-learn"
|
|
# A new crate opens at 0.1.0. Versioning and publication belong to the release track.
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
description = "Statistical learning as values: fit is a transformation, a model is a value, predict is a query."
|
|
repository.workspace = true
|
|
license.workspace = true
|
|
keywords = ["machine-learning", "regression", "statistics"]
|
|
categories = ["science"]
|
|
|
|
[dependencies]
|
|
sha2 = "0.10"
|
|
rayon = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
# `float_roundtrip` is NOT optional here, it is what makes the oracle an oracle.
|
|
# serde_json's default parser takes a fast path that is accurate to about one ulp: it reads
|
|
# the fixture literal 1.5442159175872803 back as 1.5442159175872805. Every bit-identity
|
|
# assertion in `tests/sklearn.rs` — split thresholds, scaler statistics, the local outlier
|
|
# factor — would then be comparing a correct value against a corrupted one, and the failure
|
|
# looks exactly like an arithmetic bug in the estimator. Measured, not assumed; see the
|
|
# note on `reals` in tests/sklearn.rs.
|
|
serde_json = { workspace = true, features = ["float_roundtrip"] }
|
|
criterion = { workspace = true }
|
|
# The `fraud` example reads a labelled dataset off disk. The parquet crate's own record
|
|
# reader is enough for that — no arrow — and it stays a DEV dependency: the crate itself
|
|
# takes its data as a `Matrix`, so a file format is never part of what it links.
|
|
parquet = { workspace = true }
|
|
|
|
[[bench]]
|
|
name = "learn"
|
|
harness = false
|
|
|
|
# The workspace's lint decisions rather than a second set of this crate's own — every other
|
|
# member opts in the same way. It matters here for `needless_range_loop`, allowed there for
|
|
# parallel-array indexing, which is what the Newton step's Hessian accumulation does: one
|
|
# index reads the working weights AND the design row.
|
|
[lints]
|
|
workspace = true
|