gizai:ml/experiment
Standalone classical ML model selection. Only the fit engine owns algorithms; this module owns validation, scoring and experiment ordering, never model copies.
import * as Experiment from "gizai:ml/experiment";Types
Candidate
type Candidate = { algorithm: string; params: Json; }One fully specified model and hyperparameter candidate.
algorithm:stringparams:gizlang_json.Json
Trial
type Trial = { algorithm: string; params: Json; score: f64; folds: Vec<f64>; }The mean validation score and individual scores of a completed candidate.
algorithm:stringparams:gizlang_json.Jsonscore:f64folds:Vec<f64>
Study
type Study = { champion: Model; trials: Vec<Trial>; metric: string; folds: i64; seed: u64; transform?: Prep.Standardizer; }Leaderboard is sorted descending (best first); champion is refitted on all input rows.
champion:M42.Modeltrials:Vec<M38.Trial>metric:stringfolds:i64seed:u64transform:_gizlang_sdk_core.Option<M44.Standardizer>
Functions
score
function score(task: string, metric: string, y: Vec<f64>, predicted: Vec<f64>): f64 throws stringPrimary supervised metric: higher is better. Class labels need not be consecutive integers.
Effects: fail.
search
function search(task: string, data: Data, candidates: Vec<Candidate>, folds: i64, seed: u64, metric: string = "", maxFits: i64 = 128, standardize: bool = false): Study throws stringBounded, deterministic AutoML-style search over user-supplied candidates. Each candidate gets identical shuffled folds; all scores are out-of-fold. The winner is refit on all data only after selection. This is not nested CV.
Effects: fail.
leaderboard
function leaderboard(trials: Vec<Trial>): Vec<Trial>Higher validation scores win; exact ties preserve the supplied candidate order.
Effects: fail.
importance
function importance(task: string, metric: string, model: Model, validation: Data, seed: u64): Vec<f64> throws stringHeld-out permutation importance; each feature is shuffled independently once. Positive values mean validation performance fell when that feature was corrupted. Use more repetitions for statistically stable estimates.
Effects: fail.