moon-online-models

A native MoonBit toolkit for online learning, sparse and dense models, streaming features, evaluation, monitoring, serving, and reproducible model lifecycle workflows.

machine-learning
regression
online-learning
incremental-learning
classification
streaming-data
model-monitoring
moonbit
moon add phjphj676/moon-online-models@0.2.0
Download zip
Author
Version
0.2.0
License
Apache-2.0
Last updated
5 hours ago
Downloads
2
README

#moon-online-models

phjphj676/moon-online-models is a native MoonBit toolkit for applications that learn from events continuously: CTR/risk scoring, device telemetry, incremental forecasting, ranking, feature streams, and model monitoring. It is the acceptance version of the August 2026 MoonBit Hackathon project.

#What is included

  • Dense online learners: RLS, SGD/FTRL logistic regression, Adagrad, ridge, Huber, quantile, softmax, Naive Bayes, k-means, kernels, PCA, factorization, tree stumps, ensembles, and time-series models.
  • Sparse and streaming data: sparse vectors, hashing, CSV parsing, categorical encoding, feature crosses, online joins, reservoirs, bootstrapping, and schema-checked feature storage.
  • Evaluation and safety: exact and histogram AUC, calibration, regression and ranking metrics, conformal intervals, drift detectors, fairness gaps, cost-sensitive thresholds, validation, gradient/prediction guards.
  • Operations: model snapshots and checksums, registry and deployment state transitions, canary experiments, serving batchers, SLO/error budgets, alerts, audit trails, data lineage, privacy budgets, and reproducibility manifests.

The implementation is deliberately dependency-light: the root package only uses moonbitlang/core/math and moonbitlang/core/json. Public state is bounded where a stream can grow without limit; callers can inspect counters, reset state, and reject malformed dimensions at the boundary.

#Install

moon add phjphj676/moon-online-models

#Minimal example

let model = @moon-online-models.AdagradLogisticRegression::new(
3,
learning_rate=0.1,
)
model.update([1.0, 0.0, 0.2], 1.0)
model.update([0.0, 1.0, -0.2], 0.0)
let probability = model.predict([1.0, 0.0, 0.2])

For sparse CTR-style features:

let hasher = @moon-online-models.FeatureHasher::new(1_000_000)
let features = hasher.encode(["country=CN", "device=mobile", "slot=home"])
let model = @moon-online-models.SparseAdagradClassifier::new(1_000_000)
model.update(features, 1.0)
let probability = model.predict(features)

#Verification

Run the same checks locally that the repository CI runs:

moon version --all moon update moon check --target all moon test --target all moon fmt && git diff --exit-code moon info && git diff --exit-code

The local wasm-gc test suite contains 16 boundary and behavior scenarios; the native benchmark trains 20,000 deterministic events and records its measured output in benchmarks/RESULTS.md. Re-run it with benchmarks/run.ps1 on the acceptance machine.

#Package and repository

The code is original MoonBit implementation authored by the repository owner. No generated build directory or credentials are part of the package.

#
OnlineLearner

pub trait OnlineLearner {
fn update(Self, Array[Double], Double) -> Unit
fn predict(Self, Array[Double]) -> Double
}

A trait for online learning models that can be incrementally updated.

#
Snapshot

pub trait Snapshot {
fn to_bytes(Self) -> Bytes
fn from_bytes(Self, Bytes) -> Bool
}

A trait for models that support saving and loading state.

#
AdagradLinearRegression

pub struct AdagradLinearRegression {
weights : Array[Double]
accumulator : Array[Double]
learning_rate : Double
epsilon : Double
l2 : Double
steps : Int
}

A linear regressor with Adagrad updates, useful when labels are continuous and the stream has heterogeneous feature scales.

#
AdagradLinearRegression::dimension

#
AdagradLinearRegression::loss

fn AdagradLinearRegression::loss(self : AdagradLinearRegression, features : Array[Double], label : Double) -> Double

#
AdagradLinearRegression::new

fn AdagradLinearRegression::new(dimension : Int, learning_rate? : Double, epsilon? : Double, l2? : Double) -> AdagradLinearRegression

#
AdagradLinearRegression::predict

fn AdagradLinearRegression::predict(self : AdagradLinearRegression, features : Array[Double]) -> Double

#
AdagradLinearRegression::reset

#
AdagradLinearRegression::residual

fn AdagradLinearRegression::residual(self : AdagradLinearRegression, features : Array[Double], label : Double) -> Double

#
AdagradLinearRegression::steps

#
AdagradLinearRegression::update

fn AdagradLinearRegression::update(self : AdagradLinearRegression, features : Array[Double], label : Double) -> Unit

#
AdagradLinearRegression::weights

#
AdagradLogisticRegression

pub struct AdagradLogisticRegression {
weights : Array[Double]
accumulator : Array[Double]
learning_rate : Double
epsilon : Double
l1 : Double
l2 : Double
steps : Int
seen : Double
}

Online binary classifier trained with Adagrad and optional elastic-net regularization. It is a practical dense counterpart to FTRL for streams where feature values are dense but their scales change over time.

#
AdagradLogisticRegression::accumulator

fn AdagradLogisticRegression::accumulator(self : AdagradLogisticRegression) -> Array[Double]

#
AdagradLogisticRegression::dimension

#
AdagradLogisticRegression::feature_importance

fn AdagradLogisticRegression::feature_importance(self : AdagradLogisticRegression) -> Array[Double]

#
AdagradLogisticRegression::logit

fn AdagradLogisticRegression::logit(self : AdagradLogisticRegression, features : Array[Double]) -> Double

#
AdagradLogisticRegression::loss

fn AdagradLogisticRegression::loss(self : AdagradLogisticRegression, features : Array[Double], label : Double) -> Double

#
AdagradLogisticRegression::new

fn AdagradLogisticRegression::new(dimension : Int, learning_rate? : Double, epsilon? : Double, l1? : Double, l2? : Double) -> AdagradLogisticRegression

#
AdagradLogisticRegression::predict

fn AdagradLogisticRegression::predict(self : AdagradLogisticRegression, features : Array[Double]) -> Double

#
AdagradLogisticRegression::predict_label

fn AdagradLogisticRegression::predict_label(self : AdagradLogisticRegression, features : Array[Double], threshold? : Double) -> Double

#
AdagradLogisticRegression::regularization

fn AdagradLogisticRegression::regularization(self : AdagradLogisticRegression) -> Double

#
AdagradLogisticRegression::reset

#
AdagradLogisticRegression::seen

#
AdagradLogisticRegression::sparsity

fn AdagradLogisticRegression::sparsity(self : AdagradLogisticRegression, tolerance? : Double) -> Double

#
AdagradLogisticRegression::steps

#
AdagradLogisticRegression::update

fn AdagradLogisticRegression::update(self : AdagradLogisticRegression, features : Array[Double], label : Double) -> Unit

#
AdagradLogisticRegression::update_weighted

fn AdagradLogisticRegression::update_weighted(self : AdagradLogisticRegression, features : Array[Double], label : Double, sample_weight : Double) -> Unit

#
AdagradLogisticRegression::weights

#
AdagradOptimizer

pub struct AdagradOptimizer {
learning_rate : Double
epsilon : Double
schedule : LearningRateSchedule
accumulator : Array[Double]
clipper : GradientClipper
step_count : Int
statistics : OptimizerStatistics
}

#
AdagradOptimizer::accumulated

fn AdagradOptimizer::accumulated(self : AdagradOptimizer) -> Array[Double]

#
AdagradOptimizer::apply

fn AdagradOptimizer::apply(self : AdagradOptimizer, parameters : Array[Double], gradients : Array[Double]) -> Unit

#
AdagradOptimizer::dimension

fn AdagradOptimizer::dimension(self : AdagradOptimizer) -> Int

#
AdagradOptimizer::new

fn AdagradOptimizer::new(dimension : Int, learning_rate? : Double, epsilon? : Double, schedule? : LearningRateSchedule, clipper? : GradientClipper) -> AdagradOptimizer

#
AdagradOptimizer::rate

fn AdagradOptimizer::rate(self : AdagradOptimizer) -> Double

#
AdagradOptimizer::reset

fn AdagradOptimizer::reset(self : AdagradOptimizer) -> Unit

#
AdagradOptimizer::statistics

#
AdagradOptimizer::step_count

fn AdagradOptimizer::step_count(self : AdagradOptimizer) -> Int

#
AdagradOptimizer::update

fn AdagradOptimizer::update(self : AdagradOptimizer, gradients : Array[Double]) -> Array[Double]

#
AdamOptimizer

pub struct AdamOptimizer {
learning_rate : Double
beta1 : Double
beta2 : Double
epsilon : Double
first_moment : Array[Double]
second_moment : Array[Double]
clipper : GradientClipper
step_count : Int
}

#
AdamOptimizer::apply

fn AdamOptimizer::apply(self : AdamOptimizer, parameters : Array[Double], gradients : Array[Double]) -> Unit

#
AdamOptimizer::first_moment

fn AdamOptimizer::first_moment(self : AdamOptimizer) -> Array[Double]

#
AdamOptimizer::new

fn AdamOptimizer::new(dimension : Int, learning_rate? : Double, beta1? : Double, beta2? : Double, epsilon? : Double, clipper? : GradientClipper) -> AdamOptimizer

#
AdamOptimizer::reset

fn AdamOptimizer::reset(self : AdamOptimizer) -> Unit

#
AdamOptimizer::second_moment

fn AdamOptimizer::second_moment(self : AdamOptimizer) -> Array[Double]

#
AdamOptimizer::step_count

fn AdamOptimizer::step_count(self : AdamOptimizer) -> Int

#
AdamOptimizer::update

fn AdamOptimizer::update(self : AdamOptimizer, gradients : Array[Double]) -> Array[Double]

#
AlertCondition

pub(all) enum AlertCondition {
GreaterThan
LessThan
OutsideRange
Stale
} derive(Eq,
Debug
)

#
AlertRule

pub struct AlertRule {
name : String
metric : String
condition : AlertCondition
lower : Double
upper : Double
severity : AlertSeverity
cooldown : Int64
last_alert : Int64?
}

#
AlertRule::evaluate

fn AlertRule::evaluate(self : AlertRule, snapshot : MetricSnapshot, now : Int64) -> Bool

#
AlertRule::greater

fn AlertRule::greater(name : String, metric : String, threshold : Double, severity? : AlertSeverity, cooldown? : Int64) -> AlertRule

#
AlertRule::less

fn AlertRule::less(name : String, metric : String, threshold : Double, severity? : AlertSeverity, cooldown? : Int64) -> AlertRule

#
AlertRule::metric

fn AlertRule::metric(self : AlertRule) -> String

#
AlertRule::name

fn AlertRule::name(self : AlertRule) -> String

#
AlertRule::outside

fn AlertRule::outside(name : String, metric : String, lower : Double, upper : Double, severity? : AlertSeverity, cooldown? : Int64) -> AlertRule

#
AlertRule::reset

fn AlertRule::reset(self : AlertRule) -> Unit

#
AlertRule::severity

fn AlertRule::severity(self : AlertRule) -> AlertSeverity

#
AlertRule::stale

fn AlertRule::stale(name : String, metric : String, max_age : Int64, severity? : AlertSeverity) -> AlertRule

#
AlertSeverity

pub(all) enum AlertSeverity {
Info
Warn
Critical
} derive(Eq,
Debug
)

#
AucTracker

pub struct AucTracker {
scores : Array[Double]
labels : Array[Bool]
}

Exact incremental AUC. The tracker stores event scores, so memory is O(n) and the final computation is deterministic with tie handling.

#
AucTracker::auc

fn AucTracker::auc(self : AucTracker) -> Double

#
AucTracker::negative_count

fn AucTracker::negative_count(self : AucTracker) -> Int

#
AucTracker::new

fn AucTracker::new() -> AucTracker

#
AucTracker::positive_count

fn AucTracker::positive_count(self : AucTracker) -> Int

#
AucTracker::reset

fn AucTracker::reset(self : AucTracker) -> Unit

#
AucTracker::size

fn AucTracker::size(self : AucTracker) -> Int

#
AucTracker::update

fn AucTracker::update(self : AucTracker, score : Double, label : Double) -> Unit

#
AuditAction

pub(all) enum AuditAction {
Train
Predict
Promote
Rollback
Reject
Snapshot
} derive(Eq,
Debug
)

Auditable metadata for model updates, data lineage, and privacy budgets.

#
AuditRecord

pub struct AuditRecord {
event_id : String
actor : String
action : AuditAction
model : String
version : String
timestamp : Int64
detail : String
success : Bool
}

#
AuditRecord::action

fn AuditRecord::action(self : AuditRecord) -> AuditAction

#
AuditRecord::actor

fn AuditRecord::actor(self : AuditRecord) -> String

#
AuditRecord::detail

fn AuditRecord::detail(self : AuditRecord) -> String

#
AuditRecord::event_id

fn AuditRecord::event_id(self : AuditRecord) -> String

#
AuditRecord::model

fn AuditRecord::model(self : AuditRecord) -> String

#
AuditRecord::new

fn AuditRecord::new(event_id : String, actor : String, action : AuditAction, model : String, version : String, timestamp : Int64, detail? : String, success? : Bool) -> AuditRecord

#
AuditRecord::success

fn AuditRecord::success(self : AuditRecord) -> Bool

#
AuditRecord::timestamp

fn AuditRecord::timestamp(self : AuditRecord) -> Int64

#
AuditRecord::version

fn AuditRecord::version(self : AuditRecord) -> String

#
AuditTrail

pub struct AuditTrail {
capacity : Int
records : Array[AuditRecord]
ids : Map[String, Bool]
accepted : Int
duplicates : Int
evicted : Int
}

#
AuditTrail::accepted

fn AuditTrail::accepted(self : AuditTrail) -> Int

#
AuditTrail::append

fn AuditTrail::append(self : AuditTrail, record : AuditRecord) -> Bool

#
AuditTrail::clear

fn AuditTrail::clear(self : AuditTrail) -> Unit

#
AuditTrail::count_action

fn AuditTrail::count_action(self : AuditTrail, action : AuditAction) -> Int

#
AuditTrail::duplicates

fn AuditTrail::duplicates(self : AuditTrail) -> Int

#
AuditTrail::evicted

fn AuditTrail::evicted(self : AuditTrail) -> Int

#
AuditTrail::failed

fn AuditTrail::failed(self : AuditTrail) -> Int

#
AuditTrail::find

fn AuditTrail::find(self : AuditTrail, event_id : String) -> AuditRecord?

#
AuditTrail::new

fn AuditTrail::new(capacity? : Int) -> AuditTrail

#
AuditTrail::records

fn AuditTrail::records(self : AuditTrail) -> Array[AuditRecord]

#
AuditTrail::size

fn AuditTrail::size(self : AuditTrail) -> Int

#
BatchNormalizer

pub struct BatchNormalizer {
moments : VectorMoments
dimension : Int
batches : Int
}

#
BatchNormalizer::batches

fn BatchNormalizer::batches(self : BatchNormalizer) -> Int

#
BatchNormalizer::fit

fn BatchNormalizer::fit(self : BatchNormalizer, batch : DataBatch) -> Unit

#
BatchNormalizer::mean

fn BatchNormalizer::mean(self : BatchNormalizer) -> Array[Double]

#
BatchNormalizer::new

fn BatchNormalizer::new(dimension : Int) -> BatchNormalizer

#
BatchNormalizer::reset

fn BatchNormalizer::reset(self : BatchNormalizer) -> Unit

#
BatchNormalizer::transform

fn BatchNormalizer::transform(self : BatchNormalizer, batch : DataBatch) -> DataBatch

#
BatchNormalizer::variance

fn BatchNormalizer::variance(self : BatchNormalizer) -> Array[Double]

#
BernoulliSampler

pub struct BernoulliSampler {
probability : Double
rng : DeterministicRng
accepted : Int
seen : Int
}

#
BernoulliSampler::accept

fn BernoulliSampler::accept(self : BernoulliSampler) -> Bool

#
BernoulliSampler::accepted

fn BernoulliSampler::accepted(self : BernoulliSampler) -> Int

#
BernoulliSampler::new

fn BernoulliSampler::new(probability : Double, seed? : UInt64) -> BernoulliSampler

#
BernoulliSampler::probability

fn BernoulliSampler::probability(self : BernoulliSampler) -> Double

#
BernoulliSampler::rate

fn BernoulliSampler::rate(self : BernoulliSampler) -> Double

#
BernoulliSampler::reset

fn BernoulliSampler::reset(self : BernoulliSampler) -> Unit

#
BernoulliSampler::seen

fn BernoulliSampler::seen(self : BernoulliSampler) -> Int

#
BootstrapCounter

pub struct BootstrapCounter {
counts : Array[Int]
rng : DeterministicRng
rounds : Int
}

#
BootstrapCounter::counts

fn BootstrapCounter::counts(self : BootstrapCounter) -> Array[Int]

#
BootstrapCounter::coverage

fn BootstrapCounter::coverage(self : BootstrapCounter) -> Double

#
BootstrapCounter::draw

fn BootstrapCounter::draw(self : BootstrapCounter) -> Array[Int]

#
BootstrapCounter::new

fn BootstrapCounter::new(size : Int, seed? : UInt64) -> BootstrapCounter

#
BootstrapCounter::reset

fn BootstrapCounter::reset(self : BootstrapCounter) -> Unit

#
BootstrapCounter::rounds

fn BootstrapCounter::rounds(self : BootstrapCounter) -> Int

#
CalibrationBin

pub struct CalibrationBin {
count : Double
predicted : Double
observed : Double
}

#
CalibrationBin::count

fn CalibrationBin::count(self : CalibrationBin) -> Double

#
CalibrationBin::mean_observed

fn CalibrationBin::mean_observed(self : CalibrationBin) -> Double

#
CalibrationBin::mean_prediction

fn CalibrationBin::mean_prediction(self : CalibrationBin) -> Double

#
CalibrationBin::new

#
CalibrationBin::update

fn CalibrationBin::update(self : CalibrationBin, prediction : Double, label : Double) -> Unit

#
CalibrationTracker

pub struct CalibrationTracker {
bins : Array[CalibrationBin]
total : Double
weighted_gap : Double
}

#
CalibrationTracker::bins

#
CalibrationTracker::ece

fn CalibrationTracker::ece(self : CalibrationTracker) -> Double

#
CalibrationTracker::mce

fn CalibrationTracker::mce(self : CalibrationTracker) -> Double

#
CalibrationTracker::new

fn CalibrationTracker::new(bin_count? : Int) -> CalibrationTracker

#
CalibrationTracker::reset

fn CalibrationTracker::reset(self : CalibrationTracker) -> Unit

#
CalibrationTracker::update

fn CalibrationTracker::update(self : CalibrationTracker, prediction : Double, label : Double) -> Unit

#
CanaryExperiment

pub struct CanaryExperiment {
name : String
baseline : String
candidate : String
target_samples : Int
baseline_metric : Double
candidate_metric : Double
samples : Int
}

#
CanaryExperiment::baseline

fn CanaryExperiment::baseline(self : CanaryExperiment) -> Double

#
CanaryExperiment::candidate

fn CanaryExperiment::candidate(self : CanaryExperiment) -> Double

#
CanaryExperiment::complete

fn CanaryExperiment::complete(self : CanaryExperiment) -> Bool

#
CanaryExperiment::improvement

fn CanaryExperiment::improvement(self : CanaryExperiment) -> Double

#
CanaryExperiment::new

fn CanaryExperiment::new(name : String, baseline : String, candidate : String, target_samples? : Int) -> CanaryExperiment

#
CanaryExperiment::observe

fn CanaryExperiment::observe(self : CanaryExperiment, baseline : Double, candidate : Double) -> Unit

#
CanaryExperiment::samples

fn CanaryExperiment::samples(self : CanaryExperiment) -> Int

#
CanaryExperiment::winner

fn CanaryExperiment::winner(self : CanaryExperiment) -> String

#
CategoricalEncoder

pub struct CategoricalEncoder {
values : Map[String, Int]
next_index : Int
unknown_index : Int?
}

#
CategoricalEncoder::contains

fn CategoricalEncoder::contains(self : CategoricalEncoder, value : String) -> Bool

#
CategoricalEncoder::dimension

fn CategoricalEncoder::dimension(self : CategoricalEncoder) -> Int

#
CategoricalEncoder::encode

fn CategoricalEncoder::encode(self : CategoricalEncoder, value : String) -> Int

#
CategoricalEncoder::entries

fn CategoricalEncoder::entries(self : CategoricalEncoder) -> Array[(String, Int)]

#
CategoricalEncoder::new

fn CategoricalEncoder::new(unknown_index? : Int) -> CategoricalEncoder

#
CategoricalEncoder::reset

fn CategoricalEncoder::reset(self : CategoricalEncoder) -> Unit

#
ChangePointDetector

pub struct ChangePointDetector {
short : SequenceWindow
long : SequenceWindow
threshold : Double
changes : Int
last_score : Double
}

#
ChangePointDetector::changes

fn ChangePointDetector::changes(self : ChangePointDetector) -> Int

#
ChangePointDetector::new

fn ChangePointDetector::new(short_window? : Int, long_window? : Int, threshold? : Double) -> ChangePointDetector

#
ChangePointDetector::observe

fn ChangePointDetector::observe(self : ChangePointDetector, value : Double) -> Bool

#
ChangePointDetector::reset

fn ChangePointDetector::reset(self : ChangePointDetector) -> Unit

#
ChangePointDetector::score

fn ChangePointDetector::score(self : ChangePointDetector) -> Double

#
ClassCost

pub struct ClassCost {
false_positive : Double
false_negative : Double
true_positive : Double
true_negative : Double
}

Cost-sensitive decision rules for imbalanced streaming classification.

#
ClassCost::balanced_threshold

fn ClassCost::balanced_threshold(self : ClassCost) -> Double

#
ClassCost::cost

fn ClassCost::cost(self : ClassCost, prediction : Double, label : Double, threshold : Double) -> Double

#
ClassCost::expected_cost

fn ClassCost::expected_cost(self : ClassCost, probability : Double, threshold : Double) -> Double

#
ClassCost::negative_weight

fn ClassCost::negative_weight(self : ClassCost) -> Double

#
ClassCost::new

fn ClassCost::new(false_positive? : Double, false_negative? : Double, true_positive? : Double, true_negative? : Double) -> ClassCost

#
ClassCost::positive_weight

fn ClassCost::positive_weight(self : ClassCost) -> Double

#
ClassCountTracker

pub struct ClassCountTracker {
counts : Array[Int]
}

#
ClassCountTracker::count

fn ClassCountTracker::count(self : ClassCountTracker, label : Int) -> Int

#
ClassCountTracker::counts

fn ClassCountTracker::counts(self : ClassCountTracker) -> Array[Int]

#
ClassCountTracker::new

fn ClassCountTracker::new(classes : Int) -> ClassCountTracker

#
ClassCountTracker::observe

fn ClassCountTracker::observe(self : ClassCountTracker, label : Int) -> Bool

#
ClassCountTracker::prior

fn ClassCountTracker::prior(self : ClassCountTracker, label : Int, smoothing? : Double) -> Double

#
ClassCountTracker::priors

fn ClassCountTracker::priors(self : ClassCountTracker, smoothing? : Double) -> Array[Double]

#
ClassCountTracker::total

fn ClassCountTracker::total(self : ClassCountTracker) -> Int

#
ClickThroughRateTracker

pub struct ClickThroughRateTracker {
impressions : Double
clicks : Double
predicted_sum : Double
squared_calibration_error : Double
}

#
ClickThroughRateTracker::brier

#
ClickThroughRateTracker::ctr

#
ClickThroughRateTracker::impressions

fn ClickThroughRateTracker::impressions(self : ClickThroughRateTracker) -> Double

#
ClickThroughRateTracker::new

#
ClickThroughRateTracker::predicted_ctr

fn ClickThroughRateTracker::predicted_ctr(self : ClickThroughRateTracker) -> Double

#
ClickThroughRateTracker::reset

#
ClickThroughRateTracker::update

fn ClickThroughRateTracker::update(self : ClickThroughRateTracker, probability : Double, clicked : Bool, weight? : Double) -> Unit

#
ConformalInterval

pub struct ConformalInterval {
residuals : Array[Double]
capacity : Int
confidence : Double
seen : Int
}

Bounded conformal residual tracker for distribution-free prediction bands.

#
ConformalInterval::confidence

fn ConformalInterval::confidence(self : ConformalInterval) -> Double

#
ConformalInterval::coverage

fn ConformalInterval::coverage(self : ConformalInterval, prediction : Double, label : Double) -> Bool

#
ConformalInterval::interval

fn ConformalInterval::interval(self : ConformalInterval, prediction : Double) -> (Double, Double)

#
ConformalInterval::new

fn ConformalInterval::new(capacity? : Int, confidence? : Double) -> ConformalInterval

#
ConformalInterval::observe

fn ConformalInterval::observe(self : ConformalInterval, prediction : Double, label : Double) -> Unit

#
ConformalInterval::radius

fn ConformalInterval::radius(self : ConformalInterval) -> Double

#
ConformalInterval::reset

fn ConformalInterval::reset(self : ConformalInterval) -> Unit

#
ConformalInterval::seen

fn ConformalInterval::seen(self : ConformalInterval) -> Int

#
ConformalInterval::size

fn ConformalInterval::size(self : ConformalInterval) -> Int

#
ConfusionMatrix

pub struct ConfusionMatrix {
true_positive : Double
false_positive : Double
true_negative : Double
false_negative : Double
}

Mutable binary classification confusion matrix for a stream.

#
ConfusionMatrix::accuracy

fn ConfusionMatrix::accuracy(self : ConfusionMatrix) -> Double

#
ConfusionMatrix::balanced_accuracy

fn ConfusionMatrix::balanced_accuracy(self : ConfusionMatrix) -> Double

#
ConfusionMatrix::f1

fn ConfusionMatrix::f1(self : ConfusionMatrix) -> Double

#
ConfusionMatrix::false_negative_count

fn ConfusionMatrix::false_negative_count(self : ConfusionMatrix) -> Double

#
ConfusionMatrix::fp

fn ConfusionMatrix::fp(self : ConfusionMatrix) -> Double

#
ConfusionMatrix::mcc

fn ConfusionMatrix::mcc(self : ConfusionMatrix) -> Double

#
ConfusionMatrix::merge

fn ConfusionMatrix::merge(self : ConfusionMatrix, other : ConfusionMatrix) -> Unit

#
ConfusionMatrix::new

#
ConfusionMatrix::precision

fn ConfusionMatrix::precision(self : ConfusionMatrix) -> Double

#
ConfusionMatrix::recall

fn ConfusionMatrix::recall(self : ConfusionMatrix) -> Double

#
ConfusionMatrix::reset

fn ConfusionMatrix::reset(self : ConfusionMatrix) -> Unit

#
ConfusionMatrix::specificity

fn ConfusionMatrix::specificity(self : ConfusionMatrix) -> Double

#
ConfusionMatrix::tn

fn ConfusionMatrix::tn(self : ConfusionMatrix) -> Double

#
ConfusionMatrix::total

fn ConfusionMatrix::total(self : ConfusionMatrix) -> Double

#
ConfusionMatrix::tp

fn ConfusionMatrix::tp(self : ConfusionMatrix) -> Double

#
ConfusionMatrix::update

fn ConfusionMatrix::update(self : ConfusionMatrix, prediction : Double, label : Double, threshold? : Double) -> Unit

#
CostSensitiveEvaluator

pub struct CostSensitiveEvaluator {
costs : ClassCost
total : Double
count : Int
}

#
CostSensitiveEvaluator::count

#
CostSensitiveEvaluator::mean

#
CostSensitiveEvaluator::new

#
CostSensitiveEvaluator::observe

fn CostSensitiveEvaluator::observe(self : CostSensitiveEvaluator, prediction : Double, label : Double, threshold : Double) -> Double

#
CostSensitiveEvaluator::reset

#
CostSensitiveEvaluator::total

#
CrossValidationFold

pub struct CrossValidationFold {
train : DataBatch
validation : DataBatch
index : Int
}

#
CrossValidationFold::index

fn CrossValidationFold::index(self : CrossValidationFold) -> Int

#
CrossValidationFold::train

#
CrossValidationFold::validation

#
CsvOptions

pub struct CsvOptions {
separator : Char
quote : Char
escape : Char
trim_fields : Bool
skip_empty : Bool
}

#
CsvOptions::new

fn CsvOptions::new(separator? : Char, quote? : Char, escape? : Char, trim_fields? : Bool, skip_empty? : Bool) -> CsvOptions

#
CsvOptions::parse_line

fn CsvOptions::parse_line(self : CsvOptions, line : String) -> Array[String]

#
CsvOptions::parse_lines

fn CsvOptions::parse_lines(self : CsvOptions, text : String) -> Array[Array[String]]

#
CsvOptions::separator

fn CsvOptions::separator(self : CsvOptions) -> Char

#
CumulativeSumDetector

pub struct CumulativeSumDetector {
target : Double
allowance : Double
threshold : Double
positive : Double
negative : Double
}

Two-sided CUSUM detector for abrupt shifts around a target level.

#
CumulativeSumDetector::negative

fn CumulativeSumDetector::negative(self : CumulativeSumDetector) -> Double

#
CumulativeSumDetector::new

fn CumulativeSumDetector::new(target? : Double, allowance? : Double, threshold? : Double) -> CumulativeSumDetector

#
CumulativeSumDetector::positive

fn CumulativeSumDetector::positive(self : CumulativeSumDetector) -> Double

#
CumulativeSumDetector::reset

#
CumulativeSumDetector::update

fn CumulativeSumDetector::update(self : CumulativeSumDetector, value : Double) -> Bool

#
DataBatch

pub struct DataBatch {
features : Array[Array[Double]]
labels : Array[Double]
weights : Array[Double]
}

#
DataBatch::add

fn DataBatch::add(self : DataBatch, features : Array[Double], label : Double, weight? : Double) -> Bool

#
DataBatch::dimension

fn DataBatch::dimension(self : DataBatch) -> Int

#
DataBatch::features

fn DataBatch::features(self : DataBatch) -> Array[Array[Double]]

#
DataBatch::from_arrays

fn DataBatch::from_arrays(features : Array[Array[Double]], labels : Array[Double]) -> DataBatch

#
DataBatch::labels

fn DataBatch::labels(self : DataBatch) -> Array[Double]

#
DataBatch::new

fn DataBatch::new(dimension? : Int) -> DataBatch

#
DataBatch::shuffle

fn DataBatch::shuffle(self : DataBatch, random_index : (Int) -> Int) -> Unit

#
DataBatch::size

fn DataBatch::size(self : DataBatch) -> Int

#
DataBatch::slice

fn DataBatch::slice(self : DataBatch, start : Int, end : Int) -> DataBatch

#
DataBatch::validate

fn DataBatch::validate(self : DataBatch) -> ValidationReport

#
DataBatch::weights

fn DataBatch::weights(self : DataBatch) -> Array[Double]

#
DataLineage

pub struct DataLineage {
nodes : Map[String, LineageNode]
edges : Map[String, Array[String]]
registrations : Int
}

#
DataLineage::clear

fn DataLineage::clear(self : DataLineage) -> Unit

#
DataLineage::connect

fn DataLineage::connect(self : DataLineage, input : String, output : String) -> Bool

#
DataLineage::inputs

fn DataLineage::inputs(self : DataLineage, dataset : String) -> Array[String]

#
DataLineage::new

#
DataLineage::node

fn DataLineage::node(self : DataLineage, dataset : String) -> LineageNode?

#
DataLineage::register

fn DataLineage::register(self : DataLineage, node : LineageNode) -> Bool

#
DataLineage::registrations

fn DataLineage::registrations(self : DataLineage) -> Int

#
DataLineage::upstream

fn DataLineage::upstream(self : DataLineage, dataset : String) -> Array[String]

#
DataQualityReport

pub struct DataQualityReport {
rows : Int
accepted : Int
rejected : Int
missing_values : Int
dimension_errors : Int
out_of_range : Int
}

#
DataQualityReport::acceptance_rate

fn DataQualityReport::acceptance_rate(self : DataQualityReport) -> Double

#
DataQualityReport::accepted

fn DataQualityReport::accepted(self : DataQualityReport) -> Int

#
DataQualityReport::dimension_errors

fn DataQualityReport::dimension_errors(self : DataQualityReport) -> Int

#
DataQualityReport::missing_values

fn DataQualityReport::missing_values(self : DataQualityReport) -> Int

#
DataQualityReport::new

#
DataQualityReport::observe

fn DataQualityReport::observe(self : DataQualityReport, accepted : Bool, missing : Int, dimension_error : Bool, range_error : Bool) -> Unit

#
DataQualityReport::out_of_range

fn DataQualityReport::out_of_range(self : DataQualityReport) -> Int

#
DataQualityReport::rejected

fn DataQualityReport::rejected(self : DataQualityReport) -> Int

#
DataQualityReport::reset

fn DataQualityReport::reset(self : DataQualityReport) -> Unit

#
DataQualityReport::rows

fn DataQualityReport::rows(self : DataQualityReport) -> Int

#
DenseVector

pub struct DenseVector {
values : Array[Double]
} derive(ToJson,
Debug
,
FromJson
)

An owned dense vector with explicit dimension-safe operations.

DenseVector is useful at API boundaries where callers want a named value rather than a raw array. Model hot paths still accept Array[Double] to keep interop with MoonBit data processing code allocation-free.

#
DenseVector::add

fn DenseVector::add(self : DenseVector, other : DenseVector) -> DenseVector

#
DenseVector::append

fn DenseVector::append(self : DenseVector, value : Double) -> Unit

#
DenseVector::argmax

fn DenseVector::argmax(self : DenseVector) -> Int?

#
DenseVector::axpy

fn DenseVector::axpy(self : DenseVector, factor : Double, other : DenseVector) -> Unit

#
DenseVector::clamp

fn DenseVector::clamp(self : DenseVector, lower : Double, upper : Double) -> DenseVector

#
DenseVector::concat

fn DenseVector::concat(self : DenseVector, other : DenseVector) -> DenseVector

#
DenseVector::cosine

fn DenseVector::cosine(self : DenseVector, other : DenseVector) -> Double

#
DenseVector::dimension

fn DenseVector::dimension(self : DenseVector) -> Int

#
DenseVector::distance

fn DenseVector::distance(self : DenseVector, other : DenseVector) -> Double

#
DenseVector::distance_squared

fn DenseVector::distance_squared(self : DenseVector, other : DenseVector) -> Double

#
DenseVector::dot

fn DenseVector::dot(self : DenseVector, other : DenseVector) -> Double

#
DenseVector::dot_checked

fn DenseVector::dot_checked(self : DenseVector, other : DenseVector) -> Double?

#
DenseVector::fill

fn DenseVector::fill(self : DenseVector, value : Double) -> Unit

#
DenseVector::from_array

fn DenseVector::from_array(values : Array[Double]) -> DenseVector

#
DenseVector::from_view

fn DenseVector::from_view(values : ArrayView[Double]) -> DenseVector

#
DenseVector::get

fn DenseVector::get(self : DenseVector, index : Int) -> Double?

#
DenseVector::hadamard

fn DenseVector::hadamard(self : DenseVector, other : DenseVector) -> DenseVector

#
DenseVector::is_empty

fn DenseVector::is_empty(self : DenseVector) -> Bool

#
DenseVector::is_zero

fn DenseVector::is_zero(self : DenseVector, tolerance? : Double) -> Bool

#
DenseVector::l1_norm

fn DenseVector::l1_norm(self : DenseVector) -> Double

#
DenseVector::l2_norm

fn DenseVector::l2_norm(self : DenseVector) -> Double

#
DenseVector::map

fn DenseVector::map(self : DenseVector, transform : (Double) -> Double) -> DenseVector

#
DenseVector::max_abs

fn DenseVector::max_abs(self : DenseVector) -> Double

#
DenseVector::mean

fn DenseVector::mean(self : DenseVector) -> Double

#
DenseVector::new

fn DenseVector::new(size : Int, fill? : Double) -> DenseVector

#
DenseVector::normalize

fn DenseVector::normalize(self : DenseVector) -> DenseVector

#
DenseVector::ones

fn DenseVector::ones(size : Int) -> DenseVector

#
DenseVector::scale

fn DenseVector::scale(self : DenseVector, factor : Double) -> DenseVector

#
DenseVector::set

fn DenseVector::set(self : DenseVector, index : Int, value : Double) -> Bool

#
DenseVector::slice

fn DenseVector::slice(self : DenseVector, start : Int, end : Int) -> DenseVector

#
DenseVector::softmax

fn DenseVector::softmax(self : DenseVector) -> DenseVector

#
DenseVector::subtract

fn DenseVector::subtract(self : DenseVector, other : DenseVector) -> DenseVector

#
DenseVector::sum

fn DenseVector::sum(self : DenseVector) -> Double

#
DenseVector::top_index

fn DenseVector::top_index(self : DenseVector, rank : Int) -> Int?

#
DenseVector::validate

fn DenseVector::validate(self : DenseVector, expected : Int) -> ValidationReport

#
DenseVector::values

fn DenseVector::values(self : DenseVector) -> Array[Double]

#
DenseVector::variance

fn DenseVector::variance(self : DenseVector) -> Double

#
DenseVector::zeros

fn DenseVector::zeros(size : Int) -> DenseVector

#
DenseVector::zip_map

fn DenseVector::zip_map(self : DenseVector, other : DenseVector, transform : (Double, Double) -> Double) -> DenseVector

#
Deployment

pub struct Deployment {
model : String
version : String
state : DeploymentState
created_at : Int64
updated_at : Int64
traffic : Double
}

#
Deployment::model

fn Deployment::model(self : Deployment) -> String

#
Deployment::new

fn Deployment::new(model : String, version : String, timestamp : Int64) -> Deployment

#
Deployment::set_traffic

fn Deployment::set_traffic(self : Deployment, share : Double) -> Bool

#
Deployment::state

#
Deployment::traffic

fn Deployment::traffic(self : Deployment) -> Double

#
Deployment::transition

fn Deployment::transition(self : Deployment, next : DeploymentState, timestamp : Int64) -> Bool

#
Deployment::version

fn Deployment::version(self : Deployment) -> String

#
DeploymentManager

pub struct DeploymentManager {
deployments : Map[String, Deployment]
policy : RollbackPolicy
transitions : Int
rollbacks : Int
}

#
DeploymentManager::clear

fn DeploymentManager::clear(self : DeploymentManager) -> Unit

#
DeploymentManager::create

fn DeploymentManager::create(self : DeploymentManager, deployment : Deployment) -> Bool

#
DeploymentManager::get

fn DeploymentManager::get(self : DeploymentManager, model : String, version : String) -> Deployment?

#
DeploymentManager::healthy

fn DeploymentManager::healthy(self : DeploymentManager, accuracy : Double, loss : Double, error_rate : Double) -> Bool

#
DeploymentManager::new

#
DeploymentManager::rollbacks

fn DeploymentManager::rollbacks(self : DeploymentManager) -> Int

#
DeploymentManager::transition

fn DeploymentManager::transition(self : DeploymentManager, model : String, version : String, next : DeploymentState, timestamp : Int64) -> Bool

#
DeploymentManager::transitions

fn DeploymentManager::transitions(self : DeploymentManager) -> Int

#
DeploymentState

pub(all) enum DeploymentState {
Draft
Staging
Canary
Active
Paused
RolledBack
Retired
} derive(Eq,
Debug
)

Explicit deployment state machine used by registry and serving layers.

#
DeterministicRng

pub struct DeterministicRng {
state : UInt64
}

Small deterministic pseudo-random generator for reproducible benchmarks.

#
DeterministicRng::new

fn DeterministicRng::new(seed : UInt64) -> DeterministicRng

#
DeterministicRng::next_double

fn DeterministicRng::next_double(self : DeterministicRng) -> Double

#
DeterministicRng::next_int

fn DeterministicRng::next_int(self : DeterministicRng, limit : Int) -> Int

#
DeterministicRng::next_u64

fn DeterministicRng::next_u64(self : DeterministicRng) -> UInt64

#
DeterministicRng::normal

fn DeterministicRng::normal(self : DeterministicRng) -> Double

#
DeterministicRng::shuffle

fn DeterministicRng::shuffle(self : DeterministicRng, values : Array[Int]) -> Unit

#
DeterministicRng::uniform

fn DeterministicRng::uniform(self : DeterministicRng, lower : Double, upper : Double) -> Double

#
DriftMonitor

pub struct DriftMonitor {
feature_detectors : Array[PageHinkleyDetector]
target_detector : PageHinkleyDetector
feature_drift_events : Int
target_drift_events : Int
}

#
DriftMonitor::feature_events

fn DriftMonitor::feature_events(self : DriftMonitor) -> Int

#
DriftMonitor::new

fn DriftMonitor::new(dimension : Int, threshold? : Double, delta? : Double) -> DriftMonitor

#
DriftMonitor::reset

fn DriftMonitor::reset(self : DriftMonitor) -> Unit

#
DriftMonitor::target_events

fn DriftMonitor::target_events(self : DriftMonitor) -> Int

#
DriftMonitor::update

fn DriftMonitor::update(self : DriftMonitor, features : Array[Double], target? : Double) -> Bool

#
DuplicateSignatureTracker

pub struct DuplicateSignatureTracker {
signatures : Map[String, Int]
rows : Int
duplicates : Int
}

#
DuplicateSignatureTracker::duplicate_rate

fn DuplicateSignatureTracker::duplicate_rate(self : DuplicateSignatureTracker) -> Double

#
DuplicateSignatureTracker::duplicates

#
DuplicateSignatureTracker::new

#
DuplicateSignatureTracker::observe

fn DuplicateSignatureTracker::observe(self : DuplicateSignatureTracker, features : Array[Double]) -> Bool

#
DuplicateSignatureTracker::reset

#
DuplicateSignatureTracker::rows

#
EarlyStopping

pub struct EarlyStopping {
patience : Int
minimum_delta : Double
best : Double
bad_rounds : Int
initialized : Bool
}

#
EarlyStopping::bad_rounds

fn EarlyStopping::bad_rounds(self : EarlyStopping) -> Int

#
EarlyStopping::best

fn EarlyStopping::best(self : EarlyStopping) -> Double

#
EarlyStopping::new

fn EarlyStopping::new(patience? : Int, minimum_delta? : Double) -> EarlyStopping

#
EarlyStopping::observe

fn EarlyStopping::observe(self : EarlyStopping, loss : Double) -> Bool

#
EarlyStopping::reset

fn EarlyStopping::reset(self : EarlyStopping) -> Unit

#
EarlyStopping::should_stop

fn EarlyStopping::should_stop(self : EarlyStopping) -> Bool

#
ErrorBudget

pub struct ErrorBudget {
target : Double
window : Int
successes : Int
failures : Int
}

#
ErrorBudget::availability

fn ErrorBudget::availability(self : ErrorBudget) -> Double

#
ErrorBudget::failures

fn ErrorBudget::failures(self : ErrorBudget) -> Int

#
ErrorBudget::healthy

fn ErrorBudget::healthy(self : ErrorBudget) -> Bool

#
ErrorBudget::new

fn ErrorBudget::new(target? : Double, window? : Int) -> ErrorBudget

#
ErrorBudget::observe

fn ErrorBudget::observe(self : ErrorBudget, success : Bool) -> Unit

#
ErrorBudget::remaining

fn ErrorBudget::remaining(self : ErrorBudget) -> Double

#
ErrorBudget::reset

fn ErrorBudget::reset(self : ErrorBudget) -> Unit

#
ErrorBudget::successes

fn ErrorBudget::successes(self : ErrorBudget) -> Int

#
ErrorBudget::target

fn ErrorBudget::target(self : ErrorBudget) -> Double

#
EvaluationSummary

pub struct EvaluationSummary {
samples : Double
log_loss : Double
mse : Double
accuracy : Double
precision : Double
recall : Double
f1 : Double
auc : Double
ece : Double
} derive(ToJson,
Debug
,
FromJson
)

#
EvaluationSummary::accuracy

fn EvaluationSummary::accuracy(self : EvaluationSummary) -> Double

#
EvaluationSummary::auc

fn EvaluationSummary::auc(self : EvaluationSummary) -> Double

#
EvaluationSummary::ece

fn EvaluationSummary::ece(self : EvaluationSummary) -> Double

#
EvaluationSummary::f1

fn EvaluationSummary::f1(self : EvaluationSummary) -> Double

#
EvaluationSummary::log_loss

fn EvaluationSummary::log_loss(self : EvaluationSummary) -> Double

#
EvaluationSummary::mse

fn EvaluationSummary::mse(self : EvaluationSummary) -> Double

#
EvaluationSummary::precision

fn EvaluationSummary::precision(self : EvaluationSummary) -> Double

#
EvaluationSummary::recall

fn EvaluationSummary::recall(self : EvaluationSummary) -> Double

#
EvaluationSummary::samples

fn EvaluationSummary::samples(self : EvaluationSummary) -> Double

#
EventLog

pub struct EventLog {
capacity : Int
events : Array[TrainingEvent]
ids : Map[String, Bool]
appended : Int
evicted : Int
}

#
EventLog::append

fn EventLog::append(self : EventLog, event : TrainingEvent) -> Bool

#
EventLog::appended

fn EventLog::appended(self : EventLog) -> Int

#
EventLog::capacity

fn EventLog::capacity(self : EventLog) -> Int

#
EventLog::clear

fn EventLog::clear(self : EventLog) -> Unit

#
EventLog::events

fn EventLog::events(self : EventLog) -> Array[TrainingEvent]

#
EventLog::evicted

fn EventLog::evicted(self : EventLog) -> Int

#
EventLog::first_timestamp

fn EventLog::first_timestamp(self : EventLog) -> Int64?

#
EventLog::last_timestamp

fn EventLog::last_timestamp(self : EventLog) -> Int64?

#
EventLog::new

fn EventLog::new(capacity : Int) -> EventLog

#
EventLog::positive_rate

fn EventLog::positive_rate(self : EventLog) -> Double

#
EventLog::replay

fn EventLog::replay(self : EventLog, consume : (TrainingEvent) -> Unit) -> Unit

#
EventLog::size

fn EventLog::size(self : EventLog) -> Int

#
EwmaAnomalyDetector

pub struct EwmaAnomalyDetector {
baseline : ExponentialMovingVariance
threshold : Double
anomalies : Int
}

EWMA z-score detector. It reports an anomaly before updating its baseline, which prevents a single spike from hiding itself.

#
EwmaAnomalyDetector::anomalies

fn EwmaAnomalyDetector::anomalies(self : EwmaAnomalyDetector) -> Int

#
EwmaAnomalyDetector::new

fn EwmaAnomalyDetector::new(alpha? : Double, threshold? : Double) -> EwmaAnomalyDetector

#
EwmaAnomalyDetector::reset

fn EwmaAnomalyDetector::reset(self : EwmaAnomalyDetector) -> Unit

#
EwmaAnomalyDetector::score

fn EwmaAnomalyDetector::score(self : EwmaAnomalyDetector, value : Double) -> Double

#
EwmaAnomalyDetector::update

fn EwmaAnomalyDetector::update(self : EwmaAnomalyDetector, value : Double) -> Bool

#
ExponentialImportance

pub struct ExponentialImportance {
scores : Array[Double]
alpha : Double
observations : Int
}

#
ExponentialImportance::new

fn ExponentialImportance::new(dimension : Int, alpha? : Double) -> ExponentialImportance

#
ExponentialImportance::observations

fn ExponentialImportance::observations(self : ExponentialImportance) -> Int

#
ExponentialImportance::reset

#
ExponentialImportance::scores

fn ExponentialImportance::scores(self : ExponentialImportance) -> Array[Double]

#
ExponentialImportance::top_k

fn ExponentialImportance::top_k(self : ExponentialImportance, k : Int) -> Array[Int]

#
ExponentialImportance::update

fn ExponentialImportance::update(self : ExponentialImportance, gradients : Array[Double]) -> Unit

#
ExponentialMovingAverage

pub struct ExponentialMovingAverage {
alpha : Double
value : Double
initialized : Bool
}

#
ExponentialMovingAverage::initialized

fn ExponentialMovingAverage::initialized(self : ExponentialMovingAverage) -> Bool

#
ExponentialMovingAverage::new

#
ExponentialMovingAverage::reset

#
ExponentialMovingAverage::update

fn ExponentialMovingAverage::update(self : ExponentialMovingAverage, value : Double) -> Double

#
ExponentialMovingAverage::value

#
ExponentialMovingVariance

pub struct ExponentialMovingVariance {
alpha : Double
mean : Double
variance : Double
initialized : Bool
}

#
ExponentialMovingVariance::initialized

#
ExponentialMovingVariance::mean

#
ExponentialMovingVariance::new

#
ExponentialMovingVariance::reset

#
ExponentialMovingVariance::standard_deviation

fn ExponentialMovingVariance::standard_deviation(self : ExponentialMovingVariance) -> Double

#
ExponentialMovingVariance::update

fn ExponentialMovingVariance::update(self : ExponentialMovingVariance, value : Double) -> Unit

#
ExponentialMovingVariance::variance

#
ExponentialMovingVariance::z_score

fn ExponentialMovingVariance::z_score(self : ExponentialMovingVariance, value : Double) -> Double

#
FTRL

pub struct FTRL {
alpha : Double
beta : Double
l1 : Double
l2 : Double
z : Array[Double]
n : Array[Double]
} derive(ToJson,
FromJson
)

FTRL-Proximal Online Logistic Regression Model. Supports L1 and L2 regularization, ideal for large-scale features.

#
FTRL::new

fn FTRL::new(dim : Int, alpha? : Double, beta? : Double, l1? : Double, l2? : Double) -> FTRL

Create a new FTRL model with dim features.

#
FTRL::predict

fn FTRL::predict(self : FTRL, features : Array[Double]) -> Double

Predict the probability for a given feature vector.

#
FTRL::update

fn FTRL::update(self : FTRL, features : Array[Double], label : Double) -> Unit

Update the model with a single sample (features and label). Label should be 0.0 or 1.0.

#
FactorizationMachine

pub struct FactorizationMachine {
linear : Array[Double]
factors : Array[Array[Double]]
learning_rate : Double
l2 : Double
updates : Int
}

#
FactorizationMachine::new

fn FactorizationMachine::new(dimension : Int, rank : Int, learning_rate? : Double, l2? : Double) -> FactorizationMachine

#
FactorizationMachine::predict

fn FactorizationMachine::predict(self : FactorizationMachine, features : SparseVector) -> Double

#
FactorizationMachine::updates

fn FactorizationMachine::updates(self : FactorizationMachine) -> Int

#
FairnessMonitor

pub struct FairnessMonitor {
groups : Map[String, GroupMetric]
observations : Int
}

#
FairnessMonitor::group

fn FairnessMonitor::group(self : FairnessMonitor, group : String) -> GroupMetric?

#
FairnessMonitor::groups

fn FairnessMonitor::groups(self : FairnessMonitor) -> Array[String]

#
FairnessMonitor::max_positive_rate_gap

fn FairnessMonitor::max_positive_rate_gap(self : FairnessMonitor) -> Double

#
FairnessMonitor::max_recall_gap

fn FairnessMonitor::max_recall_gap(self : FairnessMonitor) -> Double

#
FairnessMonitor::new

#
FairnessMonitor::observations

fn FairnessMonitor::observations(self : FairnessMonitor) -> Int

#
FairnessMonitor::observe

fn FairnessMonitor::observe(self : FairnessMonitor, group : String, prediction : Double, label : Double, threshold? : Double) -> Unit

#
FairnessMonitor::reset

fn FairnessMonitor::reset(self : FairnessMonitor) -> Unit

#
FeatureAttribution

pub struct FeatureAttribution {
index : Int
contribution : Double
}

Lightweight local explanations for linear and sparse predictions.

#
FeatureAttribution::contribution

fn FeatureAttribution::contribution(self : FeatureAttribution) -> Double

#
FeatureAttribution::index

fn FeatureAttribution::index(self : FeatureAttribution) -> Int

#
FeatureAttribution::new

fn FeatureAttribution::new(index : Int, contribution : Double) -> FeatureAttribution

#
FeatureDriftSummary

pub struct FeatureDriftSummary {
changed : Array[Bool]
scores : Array[Double]
}

#
FeatureDriftSummary::changed

fn FeatureDriftSummary::changed(self : FeatureDriftSummary, index : Int) -> Bool

#
FeatureDriftSummary::changed_count

fn FeatureDriftSummary::changed_count(self : FeatureDriftSummary) -> Int

#
FeatureDriftSummary::new

fn FeatureDriftSummary::new(scores : Array[Double], threshold : Double) -> FeatureDriftSummary

#
FeatureDriftSummary::scores

fn FeatureDriftSummary::scores(self : FeatureDriftSummary) -> Array[Double]

#
FeatureHasher

pub struct FeatureHasher {
buckets : Int
signed : Bool
}

#
FeatureHasher::buckets

fn FeatureHasher::buckets(self : FeatureHasher) -> Int

#
FeatureHasher::encode

fn FeatureHasher::encode(self : FeatureHasher, tokens : Array[String]) -> SparseVector

#
FeatureHasher::encode_map

fn FeatureHasher::encode_map(self : FeatureHasher, values : Map[String, Double]) -> SparseVector

#
FeatureHasher::encode_weighted

fn FeatureHasher::encode_weighted(self : FeatureHasher, tokens : Array[(String, Double)]) -> SparseVector

#
FeatureHasher::index

fn FeatureHasher::index(self : FeatureHasher, token : String) -> Int

#
FeatureHasher::new

fn FeatureHasher::new(buckets : Int, signed? : Bool) -> FeatureHasher

#
FeatureMaterializer

pub struct FeatureMaterializer {
schema : FeatureSchema
defaults : Array[Double]
materialized : Int
fallback : Int
}

#
FeatureMaterializer::fallback

fn FeatureMaterializer::fallback(self : FeatureMaterializer) -> Int

#
FeatureMaterializer::materialize

fn FeatureMaterializer::materialize(self : FeatureMaterializer, values : Array[Double]) -> Array[Double]

#
FeatureMaterializer::materialized

fn FeatureMaterializer::materialized(self : FeatureMaterializer) -> Int

#
FeatureMaterializer::new

fn FeatureMaterializer::new(schema : FeatureSchema, defaults? : Array[Double]) -> FeatureMaterializer

#
FeatureMaterializer::reset

fn FeatureMaterializer::reset(self : FeatureMaterializer) -> Unit

#
FeaturePipeline

pub struct FeaturePipeline {
standardizer : Standardizer
lower : Array[Double]
upper : Array[Double]
clip_enabled : Bool
hasher : FeatureHasher?
transformed : Int
}

A reusable online feature pipeline: optional clipping, Welford standardization, and deterministic sparse hashing.

#
FeaturePipeline::dimension

fn FeaturePipeline::dimension(self : FeaturePipeline) -> Int

#
FeaturePipeline::disable_clip

fn FeaturePipeline::disable_clip(self : FeaturePipeline) -> Unit

#
FeaturePipeline::fit_only

fn FeaturePipeline::fit_only(self : FeaturePipeline, features : Array[Double]) -> Unit

#
FeaturePipeline::mean

fn FeaturePipeline::mean(self : FeaturePipeline) -> Array[Double]

#
FeaturePipeline::new

fn FeaturePipeline::new(dimension : Int, clip_lower? : Double, clip_upper? : Double, hashing_buckets? : Int) -> FeaturePipeline

#
FeaturePipeline::reset

fn FeaturePipeline::reset(self : FeaturePipeline) -> Unit

#
FeaturePipeline::set_clip

fn FeaturePipeline::set_clip(self : FeaturePipeline, lower : Double, upper : Double) -> Bool

#
FeaturePipeline::transform

fn FeaturePipeline::transform(self : FeaturePipeline, features : Array[Double]) -> Array[Double]

#
FeaturePipeline::transform_tokens

fn FeaturePipeline::transform_tokens(self : FeaturePipeline, tokens : Array[String]) -> SparseVector?

#
FeaturePipeline::transformed

fn FeaturePipeline::transformed(self : FeaturePipeline) -> Int

#
FeaturePipeline::variance

fn FeaturePipeline::variance(self : FeaturePipeline) -> Array[Double]

#
FeatureRangeMonitor

pub struct FeatureRangeMonitor {
lower : Array[Double]
upper : Array[Double]
minimum : Array[Double]
maximum : Array[Double]
violations : Array[Int]
}

#
FeatureRangeMonitor::maximum

fn FeatureRangeMonitor::maximum(self : FeatureRangeMonitor) -> Array[Double]

#
FeatureRangeMonitor::minimum

fn FeatureRangeMonitor::minimum(self : FeatureRangeMonitor) -> Array[Double]

#
FeatureRangeMonitor::new

fn FeatureRangeMonitor::new(lower : Array[Double], upper : Array[Double]) -> FeatureRangeMonitor

#
FeatureRangeMonitor::observe

fn FeatureRangeMonitor::observe(self : FeatureRangeMonitor, features : Array[Double]) -> Bool

#
FeatureRangeMonitor::reset

fn FeatureRangeMonitor::reset(self : FeatureRangeMonitor) -> Unit

#
FeatureRangeMonitor::violations

fn FeatureRangeMonitor::violations(self : FeatureRangeMonitor) -> Array[Int]

#
FeatureRecord

pub struct FeatureRecord {
key : String
version : Int
values : Array[Double]
timestamp : Int64
source : String
}

#
FeatureRecord::checksum

fn FeatureRecord::checksum(self : FeatureRecord) -> String

#
FeatureRecord::key

fn FeatureRecord::key(self : FeatureRecord) -> String

#
FeatureRecord::new

fn FeatureRecord::new(key : String, values : Array[Double], timestamp : Int64, source? : String, version? : Int) -> FeatureRecord

#
FeatureRecord::source

fn FeatureRecord::source(self : FeatureRecord) -> String

#
FeatureRecord::timestamp

fn FeatureRecord::timestamp(self : FeatureRecord) -> Int64

#
FeatureRecord::values

fn FeatureRecord::values(self : FeatureRecord) -> Array[Double]

#
FeatureRecord::version

fn FeatureRecord::version(self : FeatureRecord) -> Int

#
FeatureSchema

pub struct FeatureSchema {
name : String
dimension : Int
minimum : Array[Double]
maximum : Array[Double]
required : Bool
}

In-memory feature registry with schema checks, versioning, and bounded history.

#
FeatureSchema::dimension

fn FeatureSchema::dimension(self : FeatureSchema) -> Int

#
FeatureSchema::name

fn FeatureSchema::name(self : FeatureSchema) -> String

#
FeatureSchema::new

fn FeatureSchema::new(name : String, dimension : Int, minimum? : Array[Double], maximum? : Array[Double], required? : Bool) -> FeatureSchema

#
FeatureSchema::required

fn FeatureSchema::required(self : FeatureSchema) -> Bool

#
FeatureSchema::validate

fn FeatureSchema::validate(self : FeatureSchema, values : Array[Double]) -> ValidationReport

#
FeatureStore

pub struct FeatureStore {
schemas : Map[String, FeatureSchema]
records : Map[String, Array[FeatureRecord]]
capacity : Int
writes : Int
reads : Int
misses : Int
rejected : Int
}

#
FeatureStore::at_version

fn FeatureStore::at_version(self : FeatureStore, name : String, version : Int) -> FeatureRecord?

#
FeatureStore::clear

fn FeatureStore::clear(self : FeatureStore) -> Unit

#
FeatureStore::history

fn FeatureStore::history(self : FeatureStore, name : String) -> Array[FeatureRecord]

#
FeatureStore::hit_rate

fn FeatureStore::hit_rate(self : FeatureStore) -> Double

#
FeatureStore::latest

fn FeatureStore::latest(self : FeatureStore, name : String) -> FeatureRecord?

#
FeatureStore::misses

fn FeatureStore::misses(self : FeatureStore) -> Int

#
FeatureStore::new

fn FeatureStore::new(capacity? : Int) -> FeatureStore

#
FeatureStore::put

fn FeatureStore::put(self : FeatureStore, name : String, record : FeatureRecord) -> Bool

#
FeatureStore::reads

fn FeatureStore::reads(self : FeatureStore) -> Int

#
FeatureStore::register

fn FeatureStore::register(self : FeatureStore, schema : FeatureSchema) -> Bool

#
FeatureStore::rejected

fn FeatureStore::rejected(self : FeatureStore) -> Int

#
FeatureStore::schema

fn FeatureStore::schema(self : FeatureStore, name : String) -> FeatureSchema?

#
FeatureStore::writes

fn FeatureStore::writes(self : FeatureStore) -> Int

#
FeatureValue

pub enum FeatureValue {
Number(Double)
Category(String)
Boolean(Bool)
Missing
} derive(Eq, ToJson,
Debug
,
FromJson
)

A scalar feature value before it is encoded into a numeric vector.

#
FeatureValue::as_number

fn FeatureValue::as_number(self : FeatureValue, missing_value? : Double) -> Double

#
FeatureValue::is_missing

fn FeatureValue::is_missing(self : FeatureValue) -> Bool

#
ForecastTracker

pub struct ForecastTracker {
metrics : RegressionMetrics
predictions : Int
}

#
ForecastTracker::mae

fn ForecastTracker::mae(self : ForecastTracker) -> Double

#
ForecastTracker::new

#
ForecastTracker::observe

fn ForecastTracker::observe(self : ForecastTracker, prediction : Double, actual : Double) -> Unit

#
ForecastTracker::predictions

fn ForecastTracker::predictions(self : ForecastTracker) -> Int

#
ForecastTracker::r2

fn ForecastTracker::r2(self : ForecastTracker) -> Double

#
ForecastTracker::reset

fn ForecastTracker::reset(self : ForecastTracker) -> Unit

#
ForecastTracker::rmse

fn ForecastTracker::rmse(self : ForecastTracker) -> Double

#
GatedRegressor

pub struct GatedRegressor {
low : OnlineRidgeRegression
high : OnlineRidgeRegression
boundary : Double
low_count : Int
high_count : Int
}

#
GatedRegressor::high_count

fn GatedRegressor::high_count(self : GatedRegressor) -> Int

#
GatedRegressor::low_count

fn GatedRegressor::low_count(self : GatedRegressor) -> Int

#
GatedRegressor::new

fn GatedRegressor::new(dimension : Int, boundary? : Double) -> GatedRegressor

#
GatedRegressor::predict

fn GatedRegressor::predict(self : GatedRegressor, features : Array[Double], gate : Double) -> Double

#
GatedRegressor::update

fn GatedRegressor::update(self : GatedRegressor, features : Array[Double], gate : Double, label : Double) -> Unit

#
GaussianClassStats

pub struct GaussianClassStats {
count : Double
mean : Array[Double]
m2 : Array[Double]
}

Per-class Gaussian sufficient statistics.

#
GaussianClassStats::count

fn GaussianClassStats::count(self : GaussianClassStats) -> Double

#
GaussianClassStats::log_likelihood

fn GaussianClassStats::log_likelihood(self : GaussianClassStats, features : Array[Double], smoothing? : Double) -> Double

#
GaussianClassStats::mean

fn GaussianClassStats::mean(self : GaussianClassStats) -> Array[Double]

#
GaussianClassStats::new

fn GaussianClassStats::new(dimension : Int) -> GaussianClassStats

#
GaussianClassStats::reset

fn GaussianClassStats::reset(self : GaussianClassStats) -> Unit

#
GaussianClassStats::update

fn GaussianClassStats::update(self : GaussianClassStats, features : Array[Double], weight? : Double) -> Unit

#
GaussianClassStats::variance

fn GaussianClassStats::variance(self : GaussianClassStats, smoothing? : Double) -> Array[Double]

#
GradientAccumulator

pub struct GradientAccumulator {
gradients : Array[Double]
count : Int
}

#
GradientAccumulator::add

fn GradientAccumulator::add(self : GradientAccumulator, gradients : Array[Double]) -> Unit

#
GradientAccumulator::count

fn GradientAccumulator::count(self : GradientAccumulator) -> Int

#
GradientAccumulator::mean

fn GradientAccumulator::mean(self : GradientAccumulator) -> Array[Double]

#
GradientAccumulator::new

fn GradientAccumulator::new(dimension : Int) -> GradientAccumulator

#
GradientAccumulator::sum

fn GradientAccumulator::sum(self : GradientAccumulator) -> Array[Double]

#
GradientAccumulator::take_mean

fn GradientAccumulator::take_mean(self : GradientAccumulator) -> Array[Double]

#
GradientClipper

pub struct GradientClipper {
max_norm : Double
max_value : Double
}

#
GradientClipper::clip

fn GradientClipper::clip(self : GradientClipper, gradients : Array[Double]) -> Array[Double]

#
GradientClipper::max_norm

fn GradientClipper::max_norm(self : GradientClipper) -> Double

#
GradientClipper::max_value

fn GradientClipper::max_value(self : GradientClipper) -> Double

#
GradientClipper::new

fn GradientClipper::new(max_norm? : Double, max_value? : Double) -> GradientClipper

#
GradientGuard

pub struct GradientGuard {
lower : Double
upper : Double
clipped : Int
invalid : Int
}

#
GradientGuard::apply

fn GradientGuard::apply(self : GradientGuard, gradient : Array[Double]) -> Array[Double]

#
GradientGuard::clipped

fn GradientGuard::clipped(self : GradientGuard) -> Int

#
GradientGuard::invalid

fn GradientGuard::invalid(self : GradientGuard) -> Int

#
GradientGuard::new

fn GradientGuard::new(lower? : Double, upper? : Double) -> GradientGuard

#
GradientGuard::reset

fn GradientGuard::reset(self : GradientGuard) -> Unit

#
GroupMetric

pub struct GroupMetric {
group : String
count : Int
positives : Int
true_positives : Int
false_positives : Int
false_negatives : Int
}

Group-level diagnostics for online classification services.

#
GroupMetric::count

fn GroupMetric::count(self : GroupMetric) -> Int

#
GroupMetric::false_positive_rate

fn GroupMetric::false_positive_rate(self : GroupMetric) -> Double

#
GroupMetric::group

fn GroupMetric::group(self : GroupMetric) -> String

#
GroupMetric::new

fn GroupMetric::new(group : String) -> GroupMetric

#
GroupMetric::observe

fn GroupMetric::observe(self : GroupMetric, prediction : Double, label : Double, threshold? : Double) -> Unit

#
GroupMetric::positive_rate

fn GroupMetric::positive_rate(self : GroupMetric) -> Double

#
GroupMetric::precision

fn GroupMetric::precision(self : GroupMetric) -> Double

#
GroupMetric::recall

fn GroupMetric::recall(self : GroupMetric) -> Double

#
GroupMetric::reset

fn GroupMetric::reset(self : GroupMetric) -> Unit

#
HashedFeatureSelector

pub struct HashedFeatureSelector {
dimension : Int
importance : ExponentialImportance
threshold : Double
}

A bounded vocabulary selector that keeps the most useful hashed features.

#
HashedFeatureSelector::dimension

fn HashedFeatureSelector::dimension(self : HashedFeatureSelector) -> Int

#
HashedFeatureSelector::new

fn HashedFeatureSelector::new(dimension : Int, threshold? : Double) -> HashedFeatureSelector

#
HashedFeatureSelector::observe

fn HashedFeatureSelector::observe(self : HashedFeatureSelector, vector : SparseVector, gradient : Double) -> Unit

#
HashedFeatureSelector::reset

#
HashedFeatureSelector::scores

fn HashedFeatureSelector::scores(self : HashedFeatureSelector) -> Array[Double]

#
HashedFeatureSelector::selected

#
HashedFeatureSelector::selected_top_k

fn HashedFeatureSelector::selected_top_k(self : HashedFeatureSelector, k : Int) -> Array[Int]

#
HashingVectorizer

pub struct HashingVectorizer {
hasher : FeatureHasher
lowercase : Bool
ngram_order : Int
}

Token hashing utilities for text and event-key features.

#
HashingVectorizer::buckets

fn HashingVectorizer::buckets(self : HashingVectorizer) -> Int

#
HashingVectorizer::encode

fn HashingVectorizer::encode(self : HashingVectorizer, text : String) -> SparseVector

#
HashingVectorizer::new

fn HashingVectorizer::new(buckets : Int, lowercase? : Bool, ngram_order? : Int) -> HashingVectorizer

#
HashingVectorizer::tokens

fn HashingVectorizer::tokens(self : HashingVectorizer, text : String) -> Array[String]

#
HistogramAuc

pub struct HistogramAuc {
positive : Array[Double]
negative : Array[Double]
total_positive : Double
total_negative : Double
}

Fixed-bin AUC approximation for bounded-memory deployments.

#
HistogramAuc::auc

fn HistogramAuc::auc(self : HistogramAuc) -> Double

#
HistogramAuc::bins

fn HistogramAuc::bins(self : HistogramAuc) -> Int

#
HistogramAuc::new

fn HistogramAuc::new(bins? : Int) -> HistogramAuc

#
HistogramAuc::reset

fn HistogramAuc::reset(self : HistogramAuc) -> Unit

#
HistogramAuc::update

fn HistogramAuc::update(self : HistogramAuc, score : Double, label : Double, weight? : Double) -> Unit

#
HoldoutSplit

pub struct HoldoutSplit {
train : DataBatch
holdout : DataBatch
}

#
HoldoutSplit::holdout

fn HoldoutSplit::holdout(self : HoldoutSplit) -> DataBatch

#
HoldoutSplit::holdout_size

fn HoldoutSplit::holdout_size(self : HoldoutSplit) -> Int

#
HoldoutSplit::new

fn HoldoutSplit::new(batch : DataBatch, train_ratio? : Double) -> HoldoutSplit

#
HoldoutSplit::train

fn HoldoutSplit::train(self : HoldoutSplit) -> DataBatch

#
HoldoutSplit::train_size

fn HoldoutSplit::train_size(self : HoldoutSplit) -> Int

#
HoltWinters

pub struct HoltWinters {
alpha : Double
beta : Double
gamma : Double
season_length : Int
seasonals : Array[Double]
level : Double
trend : Double
count : Int
}

Holt-Winters style level/trend/seasonal smoother.

#
HoltWinters::count

fn HoltWinters::count(self : HoltWinters) -> Int

#
HoltWinters::forecast

fn HoltWinters::forecast(self : HoltWinters, horizon : Int) -> Array[Double]

#
HoltWinters::level

fn HoltWinters::level(self : HoltWinters) -> Double

#
HoltWinters::new

fn HoltWinters::new(season_length : Int, alpha? : Double, beta? : Double, gamma? : Double) -> HoltWinters

#
HoltWinters::reset

fn HoltWinters::reset(self : HoltWinters) -> Unit

#
HoltWinters::seasonals

fn HoltWinters::seasonals(self : HoltWinters) -> Array[Double]

#
HoltWinters::trend

fn HoltWinters::trend(self : HoltWinters) -> Double

#
HoltWinters::update

fn HoltWinters::update(self : HoltWinters, value : Double) -> Double

#
KernelKind

pub enum KernelKind {
Linear
Polynomial(degree~ : Int, scale~ : Double, offset~ : Double)
Gaussian(width~ : Double)
} derive(Eq, ToJson,
Debug
,
FromJson
)

Kernel choices for compact online non-linear models.

#
KernelKind::evaluate

fn KernelKind::evaluate(self : KernelKind, left : Array[Double], right : Array[Double]) -> Double

#
KernelSupport

pub struct KernelSupport {
features : Array[Double]
label : Double
coefficient : Double
}

#
KernelSupport::coefficient

fn KernelSupport::coefficient(self : KernelSupport) -> Double

#
KernelSupport::features

fn KernelSupport::features(self : KernelSupport) -> Array[Double]

#
KernelSupport::label

fn KernelSupport::label(self : KernelSupport) -> Double

#
KeyedFeatureJoin

pub struct KeyedFeatureJoin {
capacity : Int
pending_features : Map[String, Array[Double]]
pending_labels : Map[String, Double]
matched : Int
dropped : Int
}

Bounded keyed join for combining asynchronous feature and label streams.

#
KeyedFeatureJoin::dropped

fn KeyedFeatureJoin::dropped(self : KeyedFeatureJoin) -> Int

#
KeyedFeatureJoin::matched

fn KeyedFeatureJoin::matched(self : KeyedFeatureJoin) -> Int

#
KeyedFeatureJoin::new

fn KeyedFeatureJoin::new(capacity : Int) -> KeyedFeatureJoin

#
KeyedFeatureJoin::pending

fn KeyedFeatureJoin::pending(self : KeyedFeatureJoin) -> Int

#
KeyedFeatureJoin::put_features

fn KeyedFeatureJoin::put_features(self : KeyedFeatureJoin, key : String, features : Array[Double]) -> Array[Double]?

#
KeyedFeatureJoin::put_label

fn KeyedFeatureJoin::put_label(self : KeyedFeatureJoin, key : String, label : Double) -> Array[Double]?

#
KeyedFeatureJoin::reset

fn KeyedFeatureJoin::reset(self : KeyedFeatureJoin) -> Unit

#
LatencyTracker

pub struct LatencyTracker {
samples : SequenceWindow
total : Int
rejected : Int
}

#
LatencyTracker::count

fn LatencyTracker::count(self : LatencyTracker) -> Int

#
LatencyTracker::mean

fn LatencyTracker::mean(self : LatencyTracker) -> Double

#
LatencyTracker::new

fn LatencyTracker::new(capacity? : Int) -> LatencyTracker

#
LatencyTracker::observe

fn LatencyTracker::observe(self : LatencyTracker, milliseconds : Double) -> Bool

#
LatencyTracker::p95

fn LatencyTracker::p95(self : LatencyTracker) -> Double

#
LatencyTracker::percentile

fn LatencyTracker::percentile(self : LatencyTracker, probability : Double) -> Double

#
LatencyTracker::rejected

fn LatencyTracker::rejected(self : LatencyTracker) -> Int

#
LatencyTracker::reset

fn LatencyTracker::reset(self : LatencyTracker) -> Unit

#
LatencyTracker::total

fn LatencyTracker::total(self : LatencyTracker) -> Int

#
LearningCurve

pub struct LearningCurve {
train : MetricSeries
validation : MetricSeries
}

#
LearningCurve::generalization_gap

fn LearningCurve::generalization_gap(self : LearningCurve) -> Double

#
LearningCurve::new

fn LearningCurve::new(capacity? : Int) -> LearningCurve

#
LearningCurve::record

fn LearningCurve::record(self : LearningCurve, train_loss : Double, validation_loss : Double) -> Unit

#
LearningCurve::reset

fn LearningCurve::reset(self : LearningCurve) -> Unit

#
LearningCurve::train

fn LearningCurve::train(self : LearningCurve) -> Array[Double]

#
LearningCurve::validation

fn LearningCurve::validation(self : LearningCurve) -> Array[Double]

#
LearningRateSchedule

pub enum LearningRateSchedule {
Constant
InverseScaling(power~ : Double)
ExponentialDecay(decay~ : Double)
CosineDecay(minimum~ : Double, period~ : Int)
} derive(Eq, ToJson,
Debug
,
FromJson
)

Learning-rate schedules shared by adaptive online optimizers.

#
LearningRateSchedule::rate

fn LearningRateSchedule::rate(self : LearningRateSchedule, initial : Double, step : Int) -> Double

#
LineageNode

pub struct LineageNode {
dataset : String
source : String
schema : String
row_count : Int
checksum : String
timestamp : Int64
}

#
LineageNode::checksum

fn LineageNode::checksum(self : LineageNode) -> String

#
LineageNode::dataset

fn LineageNode::dataset(self : LineageNode) -> String

#
LineageNode::new

fn LineageNode::new(dataset : String, source : String, schema : String, row_count : Int, checksum : String, timestamp : Int64) -> LineageNode

#
LineageNode::row_count

fn LineageNode::row_count(self : LineageNode) -> Int

#
LineageNode::schema

fn LineageNode::schema(self : LineageNode) -> String

#
LineageNode::source

fn LineageNode::source(self : LineageNode) -> String

#
LineageNode::timestamp

fn LineageNode::timestamp(self : LineageNode) -> Int64

#
LinearEndpoint

pub struct LinearEndpoint {
weights : Array[Double]
bias : Double
version : String
prediction_guard : PredictionGuard
requests : Int
rejected : Int
}

#
LinearEndpoint::new

fn LinearEndpoint::new(weights : Array[Double], bias? : Double, version? : String, lower? : Double, upper? : Double) -> LinearEndpoint

#
LinearEndpoint::predict

#
LinearEndpoint::predict_batch

#
LinearEndpoint::rejected

fn LinearEndpoint::rejected(self : LinearEndpoint) -> Int

#
LinearEndpoint::requests

fn LinearEndpoint::requests(self : LinearEndpoint) -> Int

#
LinearEndpoint::reset

fn LinearEndpoint::reset(self : LinearEndpoint) -> Unit

#
LinearEndpoint::version

fn LinearEndpoint::version(self : LinearEndpoint) -> String

#
LinearEndpoint::weights

fn LinearEndpoint::weights(self : LinearEndpoint) -> Array[Double]

#
LossAccumulator

pub struct LossAccumulator {
kind : LossKind
parameter : Double
count : Int
weight : Double
total : Double
absolute_gradient : Double
maximum : Double
}

#
LossAccumulator::count

fn LossAccumulator::count(self : LossAccumulator) -> Int

#
LossAccumulator::kind

#
LossAccumulator::maximum

fn LossAccumulator::maximum(self : LossAccumulator) -> Double

#
LossAccumulator::mean

fn LossAccumulator::mean(self : LossAccumulator) -> Double

#
LossAccumulator::mean_absolute_gradient

fn LossAccumulator::mean_absolute_gradient(self : LossAccumulator) -> Double

#
LossAccumulator::new

fn LossAccumulator::new(kind : LossKind, parameter? : Double) -> LossAccumulator

#
LossAccumulator::reset

fn LossAccumulator::reset(self : LossAccumulator) -> Unit

#
LossAccumulator::update

fn LossAccumulator::update(self : LossAccumulator, prediction : Double, label : Double, weight? : Double) -> Double

#
LossAccumulator::weight

fn LossAccumulator::weight(self : LossAccumulator) -> Double

#
LossKind

pub(all) enum LossKind {
Squared
Absolute
Huber
LogLoss
Hinge
Quantile
Poisson
} derive(Eq,
Debug
)

Loss functions and defensive gradient utilities shared by online learners. The implementations are allocation-light and keep all numerical guards at the package boundary so a malformed event cannot poison a long-running job.

#
LossSchedule

pub struct LossSchedule {
initial : Double
decay : Double
floor : Double
step : Int
}

#
LossSchedule::advance

fn LossSchedule::advance(self : LossSchedule, steps? : Int) -> Double

#
LossSchedule::new

fn LossSchedule::new(initial : Double, decay? : Double, floor? : Double) -> LossSchedule

#
LossSchedule::reset

fn LossSchedule::reset(self : LossSchedule) -> Unit

#
LossSchedule::step

fn LossSchedule::step(self : LossSchedule) -> Int

#
LossSchedule::value

fn LossSchedule::value(self : LossSchedule) -> Double

#
MarkovTransitionModel

pub struct MarkovTransitionModel {
states : Int
transitions : Array[Array[Double]]
totals : Array[Double]
previous : Int?
}

#
MarkovTransitionModel::distribution

fn MarkovTransitionModel::distribution(self : MarkovTransitionModel, from : Int) -> Array[Double]

#
MarkovTransitionModel::new

fn MarkovTransitionModel::new(states : Int, smoothing? : Double) -> MarkovTransitionModel

#
MarkovTransitionModel::next_state

fn MarkovTransitionModel::next_state(self : MarkovTransitionModel, from : Int) -> Int?

#
MarkovTransitionModel::observe

fn MarkovTransitionModel::observe(self : MarkovTransitionModel, state : Int) -> Bool

#
MarkovTransitionModel::probability

fn MarkovTransitionModel::probability(self : MarkovTransitionModel, from : Int, to : Int) -> Double

#
MarkovTransitionModel::reset

#
MarkovTransitionModel::states

#
Matrix

pub struct Matrix {
rows : Int
cols : Int
values : Array[Double]
} derive(ToJson,
Debug
,
FromJson
)

#
Matrix::add

fn Matrix::add(self : Matrix, other : Matrix) -> Matrix

#
Matrix::cols

fn Matrix::cols(self : Matrix) -> Int

#
Matrix::column

fn Matrix::column(self : Matrix, index : Int) -> DenseVector?

#
Matrix::determinant

fn Matrix::determinant(self : Matrix) -> Double

Compute a determinant with partial pivoting. The method is intended for small online covariance matrices, not for large dense linear algebra.

#
Matrix::frobenius_norm

fn Matrix::frobenius_norm(self : Matrix) -> Double

#
Matrix::from_rows

fn Matrix::from_rows(rows : Array[Array[Double]]) -> Matrix

#
Matrix::get

fn Matrix::get(self : Matrix, row : Int, col : Int) -> Double?

#
Matrix::identity

fn Matrix::identity(size : Int) -> Matrix

#
Matrix::inverse

fn Matrix::inverse(self : Matrix) -> Matrix?

#
Matrix::is_symmetric

fn Matrix::is_symmetric(self : Matrix, tolerance? : Double) -> Bool

#
Matrix::multiply

fn Matrix::multiply(self : Matrix, other : Matrix) -> Matrix

#
Matrix::multiply_vector

fn Matrix::multiply_vector(self : Matrix, vector : Array[Double]) -> Array[Double]

#
Matrix::new

fn Matrix::new(rows : Int, cols : Int, fill? : Double) -> Matrix

#
Matrix::row

fn Matrix::row(self : Matrix, index : Int) -> DenseVector?

#
Matrix::rows

fn Matrix::rows(self : Matrix) -> Int

#
Matrix::scale

fn Matrix::scale(self : Matrix, factor : Double) -> Matrix

#
Matrix::set

fn Matrix::set(self : Matrix, row : Int, col : Int, value : Double) -> Bool

#
Matrix::solve

fn Matrix::solve(self : Matrix, right_hand_side : Array[Double]) -> Array[Double]?

Solve a square linear system using Gaussian elimination with pivoting.

#
Matrix::to_rows

fn Matrix::to_rows(self : Matrix) -> Array[Array[Double]]

#
Matrix::trace

fn Matrix::trace(self : Matrix) -> Double

#
Matrix::transpose

fn Matrix::transpose(self : Matrix) -> Matrix

#
MetricSeries

pub struct MetricSeries {
name : String
capacity : Int
values : Array[Double]
seen : Int
}

Bounded metric history for dashboards and regression tests.

#
MetricSeries::last

fn MetricSeries::last(self : MetricSeries) -> Double?

#
MetricSeries::maximum

fn MetricSeries::maximum(self : MetricSeries) -> Double

#
MetricSeries::mean

fn MetricSeries::mean(self : MetricSeries) -> Double

#
MetricSeries::minimum

fn MetricSeries::minimum(self : MetricSeries) -> Double

#
MetricSeries::name

fn MetricSeries::name(self : MetricSeries) -> String

#
MetricSeries::new

fn MetricSeries::new(name : String, capacity? : Int) -> MetricSeries

#
MetricSeries::record

fn MetricSeries::record(self : MetricSeries, value : Double) -> Unit

#
MetricSeries::reset

fn MetricSeries::reset(self : MetricSeries) -> Unit

#
MetricSeries::seen

fn MetricSeries::seen(self : MetricSeries) -> Int

#
MetricSeries::trend

fn MetricSeries::trend(self : MetricSeries) -> Double

#
MetricSeries::values

fn MetricSeries::values(self : MetricSeries) -> Array[Double]

#
MetricSnapshot

pub struct MetricSnapshot {
name : String
value : Double
timestamp : Int64
samples : Int
}

Production-facing health and SLO primitives for continuously trained models.

#
MetricSnapshot::name

fn MetricSnapshot::name(self : MetricSnapshot) -> String

#
MetricSnapshot::new

fn MetricSnapshot::new(name : String, value : Double, timestamp : Int64, samples? : Int) -> MetricSnapshot

#
MetricSnapshot::samples

fn MetricSnapshot::samples(self : MetricSnapshot) -> Int

#
MetricSnapshot::timestamp

fn MetricSnapshot::timestamp(self : MetricSnapshot) -> Int64

#
MetricSnapshot::value

fn MetricSnapshot::value(self : MetricSnapshot) -> Double

#
MetricsTracker

pub struct MetricsTracker {
count : Double
sum_squared_error : Double
sum_log_loss : Double
}

Incremental metrics tracker.

#
MetricsTracker::log_loss

fn MetricsTracker::log_loss(self : MetricsTracker) -> Double

Get the current LogLoss.

#
MetricsTracker::mse

fn MetricsTracker::mse(self : MetricsTracker) -> Double

Get the current Mean Squared Error (MSE).

#
MetricsTracker::new

Create a new metrics tracker.

#
MetricsTracker::update

fn MetricsTracker::update(self : MetricsTracker, pred : Double, label : Double) -> Unit

Update metrics with a new prediction and ground truth label.

#
MiniBatchAccumulator

pub struct MiniBatchAccumulator {
dimension : Int
features : Array[Array[Double]]
labels : Array[Double]
weights : Array[Double]
capacity : Int
}

Reusable mini-batch accumulator for callers that need deterministic batch boundaries while keeping the learner online between flushes.

#
MiniBatchAccumulator::add

fn MiniBatchAccumulator::add(self : MiniBatchAccumulator, features : Array[Double], label : Double, weight? : Double) -> Bool

#
MiniBatchAccumulator::clear

fn MiniBatchAccumulator::clear(self : MiniBatchAccumulator) -> Unit

#
MiniBatchAccumulator::flush

#
MiniBatchAccumulator::new

fn MiniBatchAccumulator::new(dimension : Int, capacity? : Int) -> MiniBatchAccumulator

#
MiniBatchAccumulator::ready

fn MiniBatchAccumulator::ready(self : MiniBatchAccumulator) -> Bool

#
MiniBatchAccumulator::size

#
MissingValuePolicy

pub enum MissingValuePolicy {
Reject
Zero
Mean
CarryForward
} derive(Eq, ToJson,
Debug
,
FromJson
)

#
ModelArtifact

pub struct ModelArtifact {
name : String
version : String
checksum : String
created_at : String
stage : String
metrics : Map[String, Double]
} derive(ToJson,
Debug
,
FromJson
)

Lightweight in-process model registry for reproducible experiments.

#
ModelArtifact::add_metric

fn ModelArtifact::add_metric(self : ModelArtifact, name : String, value : Double) -> Unit

#
ModelArtifact::checksum

fn ModelArtifact::checksum(self : ModelArtifact) -> String

#
ModelArtifact::metric

fn ModelArtifact::metric(self : ModelArtifact, name : String) -> Double?

#
ModelArtifact::metrics

fn ModelArtifact::metrics(self : ModelArtifact) -> Map[String, Double]

#
ModelArtifact::name

fn ModelArtifact::name(self : ModelArtifact) -> String

#
ModelArtifact::new

fn ModelArtifact::new(name : String, version : String, checksum : String, created_at : String) -> ModelArtifact

#
ModelArtifact::set_stage

fn ModelArtifact::set_stage(self : ModelArtifact, stage : String) -> Unit

#
ModelArtifact::stage

fn ModelArtifact::stage(self : ModelArtifact) -> String

#
ModelArtifact::version

fn ModelArtifact::version(self : ModelArtifact) -> String

#
ModelCard

pub struct ModelCard {
name : String
version : String
task : String
owner : String
features : Array[String]
guarantees : Array[String]
notes : Array[String]
}

#
ModelCard::add_feature

fn ModelCard::add_feature(self : ModelCard, feature : String) -> Unit

#
ModelCard::add_guarantee

fn ModelCard::add_guarantee(self : ModelCard, guarantee : String) -> Unit

#
ModelCard::add_note

fn ModelCard::add_note(self : ModelCard, note : String) -> Unit

#
ModelCard::features

fn ModelCard::features(self : ModelCard) -> Array[String]

#
ModelCard::guarantees

fn ModelCard::guarantees(self : ModelCard) -> Array[String]

#
ModelCard::name

fn ModelCard::name(self : ModelCard) -> String

#
ModelCard::new

fn ModelCard::new(name : String, version : String, task : String, owner : String) -> ModelCard

#
ModelCard::notes

fn ModelCard::notes(self : ModelCard) -> Array[String]

#
ModelCard::owner

fn ModelCard::owner(self : ModelCard) -> String

#
ModelCard::task

fn ModelCard::task(self : ModelCard) -> String

#
ModelCard::version

fn ModelCard::version(self : ModelCard) -> String

#
ModelHealth

pub struct ModelHealth {
accepted : Int
rejected : Int
prediction_errors : Int
inference_failures : Int
latency : MetricSeries
loss : MetricSeries
}

#
ModelHealth::acceptance_rate

fn ModelHealth::acceptance_rate(self : ModelHealth) -> Double

#
ModelHealth::accepted

fn ModelHealth::accepted(self : ModelHealth) -> Int

#
ModelHealth::inference_failures

fn ModelHealth::inference_failures(self : ModelHealth) -> Int

#
ModelHealth::mean_loss

fn ModelHealth::mean_loss(self : ModelHealth) -> Double

#
ModelHealth::new

#
ModelHealth::p95_latency

fn ModelHealth::p95_latency(self : ModelHealth) -> Double

#
ModelHealth::record_error

fn ModelHealth::record_error(self : ModelHealth) -> Unit

#
ModelHealth::record_prediction_error

fn ModelHealth::record_prediction_error(self : ModelHealth) -> Unit

#
ModelHealth::record_sample

fn ModelHealth::record_sample(self : ModelHealth, accepted : Bool, loss : Double, latency_ms : Double) -> Unit

#
ModelHealth::rejected

fn ModelHealth::rejected(self : ModelHealth) -> Int

#
ModelHealth::reset

fn ModelHealth::reset(self : ModelHealth) -> Unit

#
ModelMonitor

pub struct ModelMonitor {
name : String
metrics : Map[String, RunningMoments]
rules : Array[AlertRule]
snapshots : Int
alerts : Int
}

#
ModelMonitor::add_rule

fn ModelMonitor::add_rule(self : ModelMonitor, rule : AlertRule) -> Unit

#
ModelMonitor::alert_count

fn ModelMonitor::alert_count(self : ModelMonitor) -> Int

#
ModelMonitor::mean

fn ModelMonitor::mean(self : ModelMonitor, metric : String) -> Double

#
ModelMonitor::new

fn ModelMonitor::new(name : String) -> ModelMonitor

#
ModelMonitor::observe

fn ModelMonitor::observe(self : ModelMonitor, snapshot : MetricSnapshot, now : Int64) -> Array[String]

#
ModelMonitor::reset

fn ModelMonitor::reset(self : ModelMonitor) -> Unit

#
ModelMonitor::snapshot_count

fn ModelMonitor::snapshot_count(self : ModelMonitor) -> Int

#
ModelMonitor::variance

fn ModelMonitor::variance(self : ModelMonitor, metric : String) -> Double

#
ModelRegistry

pub struct ModelRegistry {
artifacts : Map[String, ModelArtifact]
registrations : Int
}

#
ModelRegistry::clear

fn ModelRegistry::clear(self : ModelRegistry) -> Unit

#
ModelRegistry::get

fn ModelRegistry::get(self : ModelRegistry, name : String, version : String) -> ModelArtifact?

#
ModelRegistry::new

#
ModelRegistry::promote

fn ModelRegistry::promote(self : ModelRegistry, name : String, version : String, stage : String) -> Bool

#
ModelRegistry::register

fn ModelRegistry::register(self : ModelRegistry, artifact : ModelArtifact) -> Bool

#
ModelRegistry::registrations

fn ModelRegistry::registrations(self : ModelRegistry) -> Int

#
ModelRegistry::size

fn ModelRegistry::size(self : ModelRegistry) -> Int

#
ModelRegistry::versions

fn ModelRegistry::versions(self : ModelRegistry, name : String) -> Array[String]

#
MomentumOptimizer

pub struct MomentumOptimizer {
learning_rate : Double
momentum : Double
dampening : Double
velocity : Array[Double]
clipper : GradientClipper
step_count : Int
}

#
MomentumOptimizer::apply

fn MomentumOptimizer::apply(self : MomentumOptimizer, parameters : Array[Double], gradients : Array[Double]) -> Unit

#
MomentumOptimizer::new

fn MomentumOptimizer::new(dimension : Int, learning_rate? : Double, momentum? : Double, dampening? : Double, clipper? : GradientClipper) -> MomentumOptimizer

#
MomentumOptimizer::reset

fn MomentumOptimizer::reset(self : MomentumOptimizer) -> Unit

#
MomentumOptimizer::update

fn MomentumOptimizer::update(self : MomentumOptimizer, gradients : Array[Double]) -> Array[Double]

#
MomentumOptimizer::velocity

fn MomentumOptimizer::velocity(self : MomentumOptimizer) -> Array[Double]

#
MultivariateAnomalyDetector

pub struct MultivariateAnomalyDetector {
moments : VectorMoments
threshold : Double
anomalies : Int
}

Diagonal multivariate z-score detector for low-memory edge deployments.

#
MultivariateAnomalyDetector::anomalies

#
MultivariateAnomalyDetector::mean

#
MultivariateAnomalyDetector::new

fn MultivariateAnomalyDetector::new(dimension : Int, threshold? : Double) -> MultivariateAnomalyDetector

#
MultivariateAnomalyDetector::reset

#
MultivariateAnomalyDetector::score

fn MultivariateAnomalyDetector::score(self : MultivariateAnomalyDetector, values : Array[Double]) -> Double

#
MultivariateAnomalyDetector::update

fn MultivariateAnomalyDetector::update(self : MultivariateAnomalyDetector, values : Array[Double]) -> Bool

#
ObjectiveKind

pub enum ObjectiveKind {
Squared
Logistic
Huber(delta~ : Double)
Quantile(probability~ : Double)
Hinge
} derive(Eq, ToJson,
Debug
,
FromJson
)

#
ObjectiveKind::gradient

fn ObjectiveKind::gradient(self : ObjectiveKind, prediction : Double, label : Double) -> Double

#
ObjectiveKind::loss

fn ObjectiveKind::loss(self : ObjectiveKind, prediction : Double, label : Double) -> Double

#
ObjectiveTracker

pub struct ObjectiveTracker {
objective : ObjectiveKind
count : Double
total : Double
last : Double
}

#
ObjectiveTracker::count

fn ObjectiveTracker::count(self : ObjectiveTracker) -> Double

#
ObjectiveTracker::last

fn ObjectiveTracker::last(self : ObjectiveTracker) -> Double

#
ObjectiveTracker::mean

fn ObjectiveTracker::mean(self : ObjectiveTracker) -> Double

#
ObjectiveTracker::new

#
ObjectiveTracker::observe

fn ObjectiveTracker::observe(self : ObjectiveTracker, prediction : Double, label : Double, weight? : Double) -> Unit

#
ObjectiveTracker::reset

fn ObjectiveTracker::reset(self : ObjectiveTracker) -> Unit

#
OnlineAR

pub struct OnlineAR {
lags : Int
coefficients : Array[Double]
history : SequenceWindow
learning_rate : Double
observations : Int
squared_error : Double
}

#
OnlineAR::coefficients

fn OnlineAR::coefficients(self : OnlineAR) -> Array[Double]

#
OnlineAR::new

fn OnlineAR::new(lags : Int, learning_rate? : Double) -> OnlineAR

#
OnlineAR::observations

fn OnlineAR::observations(self : OnlineAR) -> Int

#
OnlineAR::predict

fn OnlineAR::predict(self : OnlineAR) -> Double

#
OnlineAR::reset

fn OnlineAR::reset(self : OnlineAR) -> Unit

#
OnlineAR::rmse

fn OnlineAR::rmse(self : OnlineAR) -> Double

#
OnlineAR::update

fn OnlineAR::update(self : OnlineAR, value : Double) -> Double

#
OnlineAutoregressive

pub struct OnlineAutoregressive {
lags : Int
weights : Array[Double]
history : Array[Double]
learning_rate : Double
l2 : Double
steps : Int
}

Online autoregressive model with a fixed lag window.

#
OnlineAutoregressive::feature_vector

fn OnlineAutoregressive::feature_vector(self : OnlineAutoregressive) -> Array[Double]

#
OnlineAutoregressive::forecast

fn OnlineAutoregressive::forecast(self : OnlineAutoregressive, horizon : Int) -> Array[Double]

#
OnlineAutoregressive::history

fn OnlineAutoregressive::history(self : OnlineAutoregressive) -> Array[Double]

#
OnlineAutoregressive::lags

#
OnlineAutoregressive::new

fn OnlineAutoregressive::new(lags : Int, learning_rate? : Double, l2? : Double) -> OnlineAutoregressive

#
OnlineAutoregressive::predict

fn OnlineAutoregressive::predict(self : OnlineAutoregressive) -> Double

#
OnlineAutoregressive::reset

fn OnlineAutoregressive::reset(self : OnlineAutoregressive) -> Unit

#
OnlineAutoregressive::steps

#
OnlineAutoregressive::update

fn OnlineAutoregressive::update(self : OnlineAutoregressive, value : Double) -> Double

#
OnlineAutoregressive::weights

fn OnlineAutoregressive::weights(self : OnlineAutoregressive) -> Array[Double]

#
OnlineBaggingClassifier

pub struct OnlineBaggingClassifier {
models : Array[AdagradLogisticRegression]
rng : DeterministicRng
observations : Int
}

Online bagging around Adagrad logistic learners.

#
OnlineBaggingClassifier::member_predictions

fn OnlineBaggingClassifier::member_predictions(self : OnlineBaggingClassifier, features : Array[Double]) -> Array[Double]

#
OnlineBaggingClassifier::models

#
OnlineBaggingClassifier::new

fn OnlineBaggingClassifier::new(model_count : Int, dimension : Int, seed? : UInt64) -> OnlineBaggingClassifier

#
OnlineBaggingClassifier::observations

fn OnlineBaggingClassifier::observations(self : OnlineBaggingClassifier) -> Int

#
OnlineBaggingClassifier::predict

fn OnlineBaggingClassifier::predict(self : OnlineBaggingClassifier, features : Array[Double]) -> Double

#
OnlineBaggingClassifier::reset

#
OnlineBaggingClassifier::update

fn OnlineBaggingClassifier::update(self : OnlineBaggingClassifier, features : Array[Double], label : Double) -> Unit

#
OnlineBatchScorer

pub struct OnlineBatchScorer {
endpoint : LinearEndpoint
batcher : RequestBatcher
stats : ServingStats
}

#
OnlineBatchScorer::endpoint

#
OnlineBatchScorer::flush

#
OnlineBatchScorer::new

fn OnlineBatchScorer::new(weights : Array[Double], batch_size? : Int, version? : String) -> OnlineBatchScorer

#
OnlineBatchScorer::pending

fn OnlineBatchScorer::pending(self : OnlineBatchScorer) -> Int

#
OnlineBatchScorer::reset

fn OnlineBatchScorer::reset(self : OnlineBatchScorer) -> Unit

#
OnlineBatchScorer::stats

#
OnlineBatchScorer::submit

#
OnlineBernoulliNB

pub struct OnlineBernoulliNB {
ones : Array[Array[Double]]
counts : Array[Double]
smoothing : Double
steps : Int
}

Bernoulli Naive Bayes for binary sparse-style features.

#
OnlineBernoulliNB::feature_probability

fn OnlineBernoulliNB::feature_probability(self : OnlineBernoulliNB, label : Int, index : Int) -> Double

#
OnlineBernoulliNB::log_scores

fn OnlineBernoulliNB::log_scores(self : OnlineBernoulliNB, features : Array[Double]) -> Array[Double]

#
OnlineBernoulliNB::new

fn OnlineBernoulliNB::new(classes : Int, dimension : Int, smoothing? : Double) -> OnlineBernoulliNB

#
OnlineBernoulliNB::predict

fn OnlineBernoulliNB::predict(self : OnlineBernoulliNB, features : Array[Double]) -> Int?

#
OnlineBernoulliNB::predict_proba

fn OnlineBernoulliNB::predict_proba(self : OnlineBernoulliNB, features : Array[Double]) -> Array[Double]

#
OnlineBernoulliNB::reset

fn OnlineBernoulliNB::reset(self : OnlineBernoulliNB) -> Unit

#
OnlineBernoulliNB::steps

fn OnlineBernoulliNB::steps(self : OnlineBernoulliNB) -> Int

#
OnlineBernoulliNB::update

fn OnlineBernoulliNB::update(self : OnlineBernoulliNB, features : Array[Double], label : Int, weight? : Double) -> Bool

#
OnlineCounter

pub struct OnlineCounter {
values : Map[String, Double]
updates : Int
}

Generic weighted counters for stream dashboards.

#
OnlineCounter::add

fn OnlineCounter::add(self : OnlineCounter, key : String, value? : Double) -> Unit

#
OnlineCounter::get

fn OnlineCounter::get(self : OnlineCounter, key : String) -> Double

#
OnlineCounter::keys

fn OnlineCounter::keys(self : OnlineCounter) -> Array[String]

#
OnlineCounter::new

#
OnlineCounter::reset

fn OnlineCounter::reset(self : OnlineCounter) -> Unit

#
OnlineCounter::total

fn OnlineCounter::total(self : OnlineCounter) -> Double

#
OnlineCounter::updates

fn OnlineCounter::updates(self : OnlineCounter) -> Int

#
OnlineDecisionStump

pub struct OnlineDecisionStump {
feature : Int
threshold : Double
left_positive : Double
left_negative : Double
right_positive : Double
right_negative : Double
updates : Int
}

A streaming decision stump over one numeric feature.

#
OnlineDecisionStump::accuracy

fn OnlineDecisionStump::accuracy(self : OnlineDecisionStump) -> Double

#
OnlineDecisionStump::feature

fn OnlineDecisionStump::feature(self : OnlineDecisionStump) -> Int

#
OnlineDecisionStump::new

fn OnlineDecisionStump::new(feature : Int, threshold? : Double) -> OnlineDecisionStump

#
OnlineDecisionStump::predict

fn OnlineDecisionStump::predict(self : OnlineDecisionStump, features : Array[Double], smoothing? : Double) -> Double

#
OnlineDecisionStump::reset

fn OnlineDecisionStump::reset(self : OnlineDecisionStump) -> Unit

#
OnlineDecisionStump::threshold

fn OnlineDecisionStump::threshold(self : OnlineDecisionStump) -> Double

#
OnlineDecisionStump::update

fn OnlineDecisionStump::update(self : OnlineDecisionStump, features : Array[Double], label : Double, weight? : Double) -> Unit

#
OnlineDecisionStump::update_threshold

fn OnlineDecisionStump::update_threshold(self : OnlineDecisionStump, threshold : Double) -> Unit

#
OnlineDecisionStump::updates

fn OnlineDecisionStump::updates(self : OnlineDecisionStump) -> Int

#
OnlineEvaluationSession

pub struct OnlineEvaluationSession {
metrics : MetricsTracker
confusion : ConfusionMatrix
auc_tracker : AucTracker
calibration : CalibrationTracker
regression : RegressionMetrics
}

#
OnlineEvaluationSession::classification

#
OnlineEvaluationSession::new

#
OnlineEvaluationSession::observe_binary

fn OnlineEvaluationSession::observe_binary(self : OnlineEvaluationSession, probability : Double, label : Double) -> Unit

#
OnlineEvaluationSession::observe_regression

fn OnlineEvaluationSession::observe_regression(self : OnlineEvaluationSession, prediction : Double, label : Double) -> Unit

#
OnlineEvaluationSession::regression

#
OnlineEvaluationSession::reset

#
OnlineEvaluationSession::summary

#
OnlineFeatureSelector

pub struct OnlineFeatureSelector {
moments : VectorMoments
target : RunningMoments
cross : Array[Double]
observations : Double
}

Online absolute-correlation tracker for feature monitoring and pruning.

#
OnlineFeatureSelector::absolute_importance

fn OnlineFeatureSelector::absolute_importance(self : OnlineFeatureSelector) -> Array[Double]

#
OnlineFeatureSelector::correlations

fn OnlineFeatureSelector::correlations(self : OnlineFeatureSelector) -> Array[Double]

#
OnlineFeatureSelector::dimension

fn OnlineFeatureSelector::dimension(self : OnlineFeatureSelector) -> Int

#
OnlineFeatureSelector::new

fn OnlineFeatureSelector::new(dimension : Int) -> OnlineFeatureSelector

#
OnlineFeatureSelector::observations

fn OnlineFeatureSelector::observations(self : OnlineFeatureSelector) -> Double

#
OnlineFeatureSelector::rank

fn OnlineFeatureSelector::rank(self : OnlineFeatureSelector, top_k : Int) -> Array[Int]

#
OnlineFeatureSelector::reset

#
OnlineFeatureSelector::select

fn OnlineFeatureSelector::select(self : OnlineFeatureSelector, threshold : Double) -> Array[Int]

#
OnlineFeatureSelector::update

fn OnlineFeatureSelector::update(self : OnlineFeatureSelector, features : Array[Double], target : Double) -> Unit

#
OnlineGammaRegression

pub struct OnlineGammaRegression {
weights : Array[Double]
learning_rate : Double
l2 : Double
steps : Int
}

#
OnlineGammaRegression::loss

fn OnlineGammaRegression::loss(self : OnlineGammaRegression, features : Array[Double], value : Double) -> Double

#
OnlineGammaRegression::new

fn OnlineGammaRegression::new(dimension : Int, learning_rate? : Double, l2? : Double) -> OnlineGammaRegression

#
OnlineGammaRegression::predict

fn OnlineGammaRegression::predict(self : OnlineGammaRegression, features : Array[Double]) -> Double

#
OnlineGammaRegression::reset

#
OnlineGammaRegression::steps

#
OnlineGammaRegression::update

fn OnlineGammaRegression::update(self : OnlineGammaRegression, features : Array[Double], value : Double) -> Unit

#
OnlineGammaRegression::weights

fn OnlineGammaRegression::weights(self : OnlineGammaRegression) -> Array[Double]

#
OnlineGaussianNB

pub struct OnlineGaussianNB {
classes : Array[GaussianClassStats]
class_counts : Array[Double]
smoothing : Double
steps : Int
}

Incremental Gaussian Naive Bayes for categorical labels.

#
OnlineGaussianNB::class_counts

fn OnlineGaussianNB::class_counts(self : OnlineGaussianNB) -> Array[Double]

#
OnlineGaussianNB::classes

fn OnlineGaussianNB::classes(self : OnlineGaussianNB) -> Int

#
OnlineGaussianNB::dimension

fn OnlineGaussianNB::dimension(self : OnlineGaussianNB) -> Int

#
OnlineGaussianNB::log_priors

fn OnlineGaussianNB::log_priors(self : OnlineGaussianNB) -> Array[Double]

#
OnlineGaussianNB::log_scores

fn OnlineGaussianNB::log_scores(self : OnlineGaussianNB, features : Array[Double]) -> Array[Double]

#
OnlineGaussianNB::new

fn OnlineGaussianNB::new(classes : Int, dimension : Int, smoothing? : Double) -> OnlineGaussianNB

#
OnlineGaussianNB::predict

fn OnlineGaussianNB::predict(self : OnlineGaussianNB, features : Array[Double]) -> Int?

#
OnlineGaussianNB::predict_proba

fn OnlineGaussianNB::predict_proba(self : OnlineGaussianNB, features : Array[Double]) -> Array[Double]

#
OnlineGaussianNB::reset

fn OnlineGaussianNB::reset(self : OnlineGaussianNB) -> Unit

#
OnlineGaussianNB::steps

fn OnlineGaussianNB::steps(self : OnlineGaussianNB) -> Int

#
OnlineGaussianNB::update

fn OnlineGaussianNB::update(self : OnlineGaussianNB, features : Array[Double], label : Int, weight? : Double) -> Bool

#
OnlineHuberRegression

pub struct OnlineHuberRegression {
weights : Array[Double]
learning_rate : Double
delta : Double
l2 : Double
steps : Int
}

Robust online regression using the Huber loss.

#
OnlineHuberRegression::loss

fn OnlineHuberRegression::loss(self : OnlineHuberRegression, features : Array[Double], label : Double) -> Double

#
OnlineHuberRegression::new

fn OnlineHuberRegression::new(dimension : Int, learning_rate? : Double, delta? : Double, l2? : Double) -> OnlineHuberRegression

#
OnlineHuberRegression::predict

fn OnlineHuberRegression::predict(self : OnlineHuberRegression, features : Array[Double]) -> Double

#
OnlineHuberRegression::steps

#
OnlineHuberRegression::update

fn OnlineHuberRegression::update(self : OnlineHuberRegression, features : Array[Double], label : Double) -> Unit

#
OnlineHuberRegression::weights

fn OnlineHuberRegression::weights(self : OnlineHuberRegression) -> Array[Double]

#
OnlineIsotonicCalibrator

pub struct OnlineIsotonicCalibrator {
scores : Array[Double]
labels : Array[Double]
capacity : Int
}

#
OnlineIsotonicCalibrator::new

#
OnlineIsotonicCalibrator::predict

fn OnlineIsotonicCalibrator::predict(self : OnlineIsotonicCalibrator, score : Double) -> Double

#
OnlineIsotonicCalibrator::reset

#
OnlineIsotonicCalibrator::size

#
OnlineIsotonicCalibrator::update

fn OnlineIsotonicCalibrator::update(self : OnlineIsotonicCalibrator, score : Double, label : Double) -> Unit

#
OnlineKMeans

pub struct OnlineKMeans {
centroids : Array[Array[Double]]
counts : Array[Double]
learning_rate : Double
assignments : Int
}

Streaming k-means with bounded state and optional exponential adaptation.

#
OnlineKMeans::assignments

fn OnlineKMeans::assignments(self : OnlineKMeans) -> Int

#
OnlineKMeans::centroids

fn OnlineKMeans::centroids(self : OnlineKMeans) -> Array[Array[Double]]

#
OnlineKMeans::cluster_counts

fn OnlineKMeans::cluster_counts(self : OnlineKMeans) -> Array[Double]

#
OnlineKMeans::clusters

fn OnlineKMeans::clusters(self : OnlineKMeans) -> Int

#
OnlineKMeans::dimension

fn OnlineKMeans::dimension(self : OnlineKMeans) -> Int

#
OnlineKMeans::distance_to_nearest

fn OnlineKMeans::distance_to_nearest(self : OnlineKMeans, features : Array[Double]) -> Double

#
OnlineKMeans::nearest

fn OnlineKMeans::nearest(self : OnlineKMeans, features : Array[Double]) -> Int?

#
OnlineKMeans::new

fn OnlineKMeans::new(clusters : Int, dimension : Int, learning_rate? : Double) -> OnlineKMeans

#
OnlineKMeans::reset

fn OnlineKMeans::reset(self : OnlineKMeans) -> Unit

#
OnlineKMeans::update

fn OnlineKMeans::update(self : OnlineKMeans, features : Array[Double]) -> Int?

#
OnlineKernelClassifier

pub struct OnlineKernelClassifier {
kernel : KernelKind
budget : Int
supports : Array[KernelSupport]
learning_rate : Double
bias : Double
updates : Int
}

Budgeted kernel perceptron for non-linear binary classification.

#
OnlineKernelClassifier::loss

fn OnlineKernelClassifier::loss(self : OnlineKernelClassifier, features : Array[Double], label : Double) -> Double

#
OnlineKernelClassifier::new

fn OnlineKernelClassifier::new(kernel? : KernelKind, budget? : Int, learning_rate? : Double) -> OnlineKernelClassifier

#
OnlineKernelClassifier::predict

fn OnlineKernelClassifier::predict(self : OnlineKernelClassifier, features : Array[Double]) -> Double

#
OnlineKernelClassifier::predict_label

fn OnlineKernelClassifier::predict_label(self : OnlineKernelClassifier, features : Array[Double]) -> Double

#
OnlineKernelClassifier::reset

#
OnlineKernelClassifier::score

fn OnlineKernelClassifier::score(self : OnlineKernelClassifier, features : Array[Double]) -> Double

#
OnlineKernelClassifier::support_count

fn OnlineKernelClassifier::support_count(self : OnlineKernelClassifier) -> Int

#
OnlineKernelClassifier::update

fn OnlineKernelClassifier::update(self : OnlineKernelClassifier, features : Array[Double], label : Double) -> Bool

#
OnlineKernelClassifier::updates

#
OnlineMatrixFactorization

pub struct OnlineMatrixFactorization {
users : Array[Array[Double]]
items : Array[Array[Double]]
learning_rate : Double
regularization : Double
updates : Int
}

Online matrix factorization for implicit or explicit feedback streams.

#
OnlineMatrixFactorization::item_count

#
OnlineMatrixFactorization::item_vector

fn OnlineMatrixFactorization::item_vector(self : OnlineMatrixFactorization, item : Int) -> Array[Double]?

#
OnlineMatrixFactorization::new

fn OnlineMatrixFactorization::new(users : Int, items : Int, rank : Int, learning_rate? : Double, regularization? : Double) -> OnlineMatrixFactorization

#
OnlineMatrixFactorization::predict

fn OnlineMatrixFactorization::predict(self : OnlineMatrixFactorization, user : Int, item : Int) -> Double

#
OnlineMatrixFactorization::rank

#
OnlineMatrixFactorization::reset

#
OnlineMatrixFactorization::update

fn OnlineMatrixFactorization::update(self : OnlineMatrixFactorization, user : Int, item : Int, rating : Double) -> Bool

#
OnlineMatrixFactorization::updates

#
OnlineMatrixFactorization::user_count

#
OnlineMatrixFactorization::user_vector

fn OnlineMatrixFactorization::user_vector(self : OnlineMatrixFactorization, user : Int) -> Array[Double]?

#
OnlineMedoid

pub struct OnlineMedoid {
center : Array[Double]
count : Double
learning_rate : Double
cost : Double
}

#
OnlineMedoid::center

fn OnlineMedoid::center(self : OnlineMedoid) -> Array[Double]

#
OnlineMedoid::count

fn OnlineMedoid::count(self : OnlineMedoid) -> Double

#
OnlineMedoid::mean_cost

fn OnlineMedoid::mean_cost(self : OnlineMedoid) -> Double

#
OnlineMedoid::new

fn OnlineMedoid::new(dimension : Int, learning_rate? : Double) -> OnlineMedoid

#
OnlineMedoid::reset

fn OnlineMedoid::reset(self : OnlineMedoid) -> Unit

#
OnlineMedoid::update

fn OnlineMedoid::update(self : OnlineMedoid, features : Array[Double]) -> Double

#
OnlinePCA

pub struct OnlinePCA {
components : Array[Array[Double]]
mean : Array[Double]
learning_rate : Double
count : Double
explained : Array[Double]
}

Online principal-component analysis using Oja's rule.

#
OnlinePCA::component_vectors

fn OnlinePCA::component_vectors(self : OnlinePCA) -> Array[Array[Double]]

#
OnlinePCA::components

fn OnlinePCA::components(self : OnlinePCA) -> Int

#
OnlinePCA::count

fn OnlinePCA::count(self : OnlinePCA) -> Double

#
OnlinePCA::dimension

fn OnlinePCA::dimension(self : OnlinePCA) -> Int

#
OnlinePCA::explained_variance

fn OnlinePCA::explained_variance(self : OnlinePCA) -> Array[Double]

#
OnlinePCA::mean

fn OnlinePCA::mean(self : OnlinePCA) -> Array[Double]

#
OnlinePCA::new

fn OnlinePCA::new(components : Int, dimension : Int, learning_rate? : Double) -> OnlinePCA

#
OnlinePCA::reconstruct

fn OnlinePCA::reconstruct(self : OnlinePCA, transformed : Array[Double]) -> Array[Double]

#
OnlinePCA::reset

fn OnlinePCA::reset(self : OnlinePCA) -> Unit

#
OnlinePCA::transform

fn OnlinePCA::transform(self : OnlinePCA, values : Array[Double]) -> Array[Double]

#
OnlinePCA::update

fn OnlinePCA::update(self : OnlinePCA, values : Array[Double]) -> Unit

#
OnlinePlattScaler

pub struct OnlinePlattScaler {
slope : Double
intercept : Double
learning_rate : Double
steps : Int
}

Online Platt scaling for turning arbitrary scores into calibrated probabilities.

#
OnlinePlattScaler::intercept

fn OnlinePlattScaler::intercept(self : OnlinePlattScaler) -> Double

#
OnlinePlattScaler::new

fn OnlinePlattScaler::new(learning_rate? : Double) -> OnlinePlattScaler

#
OnlinePlattScaler::predict

fn OnlinePlattScaler::predict(self : OnlinePlattScaler, score : Double) -> Double

#
OnlinePlattScaler::reset

fn OnlinePlattScaler::reset(self : OnlinePlattScaler) -> Unit

#
OnlinePlattScaler::slope

fn OnlinePlattScaler::slope(self : OnlinePlattScaler) -> Double

#
OnlinePlattScaler::steps

fn OnlinePlattScaler::steps(self : OnlinePlattScaler) -> Int

#
OnlinePlattScaler::update

fn OnlinePlattScaler::update(self : OnlinePlattScaler, score : Double, label : Double) -> Unit

#
OnlinePoissonRegression

pub struct OnlinePoissonRegression {
weights : Array[Double]
learning_rate : Double
l2 : Double
steps : Int
}

Online Poisson regression for count-valued event streams.

#
OnlinePoissonRegression::loss

fn OnlinePoissonRegression::loss(self : OnlinePoissonRegression, features : Array[Double], count : Double) -> Double

#
OnlinePoissonRegression::new

fn OnlinePoissonRegression::new(dimension : Int, learning_rate? : Double, l2? : Double) -> OnlinePoissonRegression

#
OnlinePoissonRegression::predict

fn OnlinePoissonRegression::predict(self : OnlinePoissonRegression, features : Array[Double]) -> Double

#
OnlinePoissonRegression::rate

fn OnlinePoissonRegression::rate(self : OnlinePoissonRegression, features : Array[Double]) -> Double

#
OnlinePoissonRegression::reset

#
OnlinePoissonRegression::steps

#
OnlinePoissonRegression::update

fn OnlinePoissonRegression::update(self : OnlinePoissonRegression, features : Array[Double], count : Double) -> Unit

#
OnlinePoissonRegression::weights

#
OnlineQuantileInterval

pub struct OnlineQuantileInterval {
lower : OnlineQuantileRegression
upper : OnlineQuantileRegression
observations : Int
}

#
OnlineQuantileInterval::contains

fn OnlineQuantileInterval::contains(self : OnlineQuantileInterval, features : Array[Double], label : Double) -> Bool

#
OnlineQuantileInterval::new

fn OnlineQuantileInterval::new(dimension : Int, coverage? : Double, learning_rate? : Double) -> OnlineQuantileInterval

#
OnlineQuantileInterval::observations

fn OnlineQuantileInterval::observations(self : OnlineQuantileInterval) -> Int

#
OnlineQuantileInterval::predict

fn OnlineQuantileInterval::predict(self : OnlineQuantileInterval, features : Array[Double]) -> (Double, Double)

#
OnlineQuantileInterval::reset

#
OnlineQuantileInterval::update

fn OnlineQuantileInterval::update(self : OnlineQuantileInterval, features : Array[Double], label : Double) -> Unit

#
OnlineQuantileRegression

pub struct OnlineQuantileRegression {
weights : Array[Double]
learning_rate : Double
quantile : Double
l2 : Double
steps : Int
}

Online quantile regression for prediction intervals and tail forecasting.

#
OnlineQuantileRegression::new

fn OnlineQuantileRegression::new(dimension : Int, quantile? : Double, learning_rate? : Double, l2? : Double) -> OnlineQuantileRegression

#
OnlineQuantileRegression::pinball_loss

fn OnlineQuantileRegression::pinball_loss(self : OnlineQuantileRegression, features : Array[Double], label : Double) -> Double

#
OnlineQuantileRegression::predict

fn OnlineQuantileRegression::predict(self : OnlineQuantileRegression, features : Array[Double]) -> Double

#
OnlineQuantileRegression::quantile

fn OnlineQuantileRegression::quantile(self : OnlineQuantileRegression) -> Double

#
OnlineQuantileRegression::update

fn OnlineQuantileRegression::update(self : OnlineQuantileRegression, features : Array[Double], label : Double) -> Unit

#
OnlineQuantileRegression::weights

#
OnlineQuantileSketch

pub struct OnlineQuantileSketch {
capacity : Int
values : Array[Double]
seen : Int
}

#
OnlineQuantileSketch::median

fn OnlineQuantileSketch::median(self : OnlineQuantileSketch) -> Double?

#
OnlineQuantileSketch::new

fn OnlineQuantileSketch::new(capacity? : Int) -> OnlineQuantileSketch

#
OnlineQuantileSketch::quantile

fn OnlineQuantileSketch::quantile(self : OnlineQuantileSketch, probability : Double) -> Double?

#
OnlineQuantileSketch::reset

fn OnlineQuantileSketch::reset(self : OnlineQuantileSketch) -> Unit

#
OnlineQuantileSketch::seen

#
OnlineQuantileSketch::update

fn OnlineQuantileSketch::update(self : OnlineQuantileSketch, value : Double) -> Unit

#
OnlineRidgeRegression

pub struct OnlineRidgeRegression {
weights : Array[Double]
diagonal : Array[Double]
learning_rate : Double
l2 : Double
intercept : Double
intercept_diagonal : Double
steps : Int
}

Streaming ridge regression with a diagonal preconditioner.

#
OnlineRidgeRegression::dimension

fn OnlineRidgeRegression::dimension(self : OnlineRidgeRegression) -> Int

#
OnlineRidgeRegression::intercept

fn OnlineRidgeRegression::intercept(self : OnlineRidgeRegression) -> Double

#
OnlineRidgeRegression::loss

fn OnlineRidgeRegression::loss(self : OnlineRidgeRegression, features : Array[Double], label : Double) -> Double

#
OnlineRidgeRegression::new

fn OnlineRidgeRegression::new(dimension : Int, learning_rate? : Double, l2? : Double) -> OnlineRidgeRegression

#
OnlineRidgeRegression::predict

fn OnlineRidgeRegression::predict(self : OnlineRidgeRegression, features : Array[Double]) -> Double

#
OnlineRidgeRegression::reset

#
OnlineRidgeRegression::residual

fn OnlineRidgeRegression::residual(self : OnlineRidgeRegression, features : Array[Double], label : Double) -> Double

#
OnlineRidgeRegression::rmse

fn OnlineRidgeRegression::rmse(self : OnlineRidgeRegression, samples : Array[Array[Double]], labels : Array[Double]) -> Double

#
OnlineRidgeRegression::steps

#
OnlineRidgeRegression::update

fn OnlineRidgeRegression::update(self : OnlineRidgeRegression, features : Array[Double], label : Double) -> Unit

#
OnlineRidgeRegression::update_weighted

fn OnlineRidgeRegression::update_weighted(self : OnlineRidgeRegression, features : Array[Double], label : Double, sample_weight : Double) -> Unit

#
OnlineRidgeRegression::weights

fn OnlineRidgeRegression::weights(self : OnlineRidgeRegression) -> Array[Double]

#
OnlineSoftmaxRegression

pub struct OnlineSoftmaxRegression {
weights : Array[Array[Double]]
learning_rate : Double
l2 : Double
steps : Int
}

Online multiclass softmax regression.

The implementation uses a stable log-sum-exp softmax and updates all classes for each event. This makes it suitable for streaming routing, intent classification, and low-latency edge inference.

#
OnlineSoftmaxRegression::accuracy_on

fn OnlineSoftmaxRegression::accuracy_on(self : OnlineSoftmaxRegression, samples : Array[Array[Double]], labels : Array[Int]) -> Double

#
OnlineSoftmaxRegression::classes

#
OnlineSoftmaxRegression::dimension

#
OnlineSoftmaxRegression::logits

fn OnlineSoftmaxRegression::logits(self : OnlineSoftmaxRegression, features : Array[Double]) -> Array[Double]

#
OnlineSoftmaxRegression::loss

fn OnlineSoftmaxRegression::loss(self : OnlineSoftmaxRegression, features : Array[Double], label : Int) -> Double

#
OnlineSoftmaxRegression::new

fn OnlineSoftmaxRegression::new(classes : Int, dimension : Int, learning_rate? : Double, l2? : Double) -> OnlineSoftmaxRegression

#
OnlineSoftmaxRegression::predict_class

fn OnlineSoftmaxRegression::predict_class(self : OnlineSoftmaxRegression, features : Array[Double]) -> Int?

#
OnlineSoftmaxRegression::predict_proba

fn OnlineSoftmaxRegression::predict_proba(self : OnlineSoftmaxRegression, features : Array[Double]) -> Array[Double]

#
OnlineSoftmaxRegression::predict_top_k

fn OnlineSoftmaxRegression::predict_top_k(self : OnlineSoftmaxRegression, features : Array[Double], k : Int) -> Array[Int]

#
OnlineSoftmaxRegression::reset

#
OnlineSoftmaxRegression::steps

#
OnlineSoftmaxRegression::top_k_accuracy

fn OnlineSoftmaxRegression::top_k_accuracy(self : OnlineSoftmaxRegression, samples : Array[Array[Double]], labels : Array[Int], k : Int) -> Double

#
OnlineSoftmaxRegression::update

fn OnlineSoftmaxRegression::update(self : OnlineSoftmaxRegression, features : Array[Double], label : Int) -> Bool

#
OnlineSoftmaxRegression::update_weighted

fn OnlineSoftmaxRegression::update_weighted(self : OnlineSoftmaxRegression, features : Array[Double], label : Int, weight : Double) -> Bool

#
OnlineSoftmaxRegression::weight_norm_squared

fn OnlineSoftmaxRegression::weight_norm_squared(self : OnlineSoftmaxRegression) -> Double

#
OnlineSoftmaxRegression::weights

#
OnlineStumpEnsemble

pub struct OnlineStumpEnsemble {
stumps : Array[OnlineDecisionStump]
rng : DeterministicRng
updates : Int
}

A small random stump ensemble for bounded-memory online classification.

#
OnlineStumpEnsemble::accuracy

fn OnlineStumpEnsemble::accuracy(self : OnlineStumpEnsemble) -> Double

#
OnlineStumpEnsemble::feature_indices

fn OnlineStumpEnsemble::feature_indices(self : OnlineStumpEnsemble) -> Array[Int]

#
OnlineStumpEnsemble::new

fn OnlineStumpEnsemble::new(stump_count : Int, dimension : Int, seed? : UInt64) -> OnlineStumpEnsemble

#
OnlineStumpEnsemble::predict

fn OnlineStumpEnsemble::predict(self : OnlineStumpEnsemble, features : Array[Double]) -> Double

#
OnlineStumpEnsemble::predict_label

fn OnlineStumpEnsemble::predict_label(self : OnlineStumpEnsemble, features : Array[Double], threshold? : Double) -> Double

#
OnlineStumpEnsemble::reset

fn OnlineStumpEnsemble::reset(self : OnlineStumpEnsemble) -> Unit

#
OnlineStumpEnsemble::size

#
OnlineStumpEnsemble::thresholds

fn OnlineStumpEnsemble::thresholds(self : OnlineStumpEnsemble) -> Array[Double]

#
OnlineStumpEnsemble::update

fn OnlineStumpEnsemble::update(self : OnlineStumpEnsemble, features : Array[Double], label : Double, weight? : Double) -> Unit

#
OnlineStumpEnsemble::updates

fn OnlineStumpEnsemble::updates(self : OnlineStumpEnsemble) -> Int

#
OptimizerStatistics

pub struct OptimizerStatistics {
steps : Int
gradient_l1 : Double
gradient_l2 : Double
update_l2 : Double
}

#
OptimizerStatistics::mean_gradient_l1

fn OptimizerStatistics::mean_gradient_l1(self : OptimizerStatistics) -> Double

#
OptimizerStatistics::mean_gradient_l2

fn OptimizerStatistics::mean_gradient_l2(self : OptimizerStatistics) -> Double

#
OptimizerStatistics::mean_update_l2

fn OptimizerStatistics::mean_update_l2(self : OptimizerStatistics) -> Double

#
OptimizerStatistics::new

#
OptimizerStatistics::record

fn OptimizerStatistics::record(self : OptimizerStatistics, gradient : Array[Double], update : Array[Double]) -> Unit

#
OptimizerStatistics::steps

fn OptimizerStatistics::steps(self : OptimizerStatistics) -> Int

#
PageHinkleyDetector

pub struct PageHinkleyDetector {
threshold : Double
delta : Double
mean : Double
cumulative : Double
minimum : Double
count : Double
}

Page-Hinkley change detector for gradual concept drift.

#
PageHinkleyDetector::count

fn PageHinkleyDetector::count(self : PageHinkleyDetector) -> Double

#
PageHinkleyDetector::mean

fn PageHinkleyDetector::mean(self : PageHinkleyDetector) -> Double

#
PageHinkleyDetector::new

fn PageHinkleyDetector::new(threshold? : Double, delta? : Double) -> PageHinkleyDetector

#
PageHinkleyDetector::reset

fn PageHinkleyDetector::reset(self : PageHinkleyDetector) -> Unit

#
PageHinkleyDetector::update

fn PageHinkleyDetector::update(self : PageHinkleyDetector, value : Double) -> Bool

#
PairwiseRanker

pub struct PairwiseRanker {
weights : Array[Double]
learning_rate : Double
margin : Double
l2 : Double
updates : Int
}

Online pairwise ranking model trained with a hinge objective.

#
PairwiseRanker::compare

fn PairwiseRanker::compare(self : PairwiseRanker, left : Array[Double], right : Array[Double]) -> Double

#
PairwiseRanker::dimension

fn PairwiseRanker::dimension(self : PairwiseRanker) -> Int

#
PairwiseRanker::loss

fn PairwiseRanker::loss(self : PairwiseRanker, positive : Array[Double], negative : Array[Double]) -> Double

#
PairwiseRanker::new

fn PairwiseRanker::new(dimension : Int, learning_rate? : Double, margin? : Double, l2? : Double) -> PairwiseRanker

#
PairwiseRanker::reset

fn PairwiseRanker::reset(self : PairwiseRanker) -> Unit

#
PairwiseRanker::score

fn PairwiseRanker::score(self : PairwiseRanker, features : Array[Double]) -> Double

#
PairwiseRanker::update

fn PairwiseRanker::update(self : PairwiseRanker, positive : Array[Double], negative : Array[Double]) -> Bool

#
PairwiseRanker::updates

fn PairwiseRanker::updates(self : PairwiseRanker) -> Int

#
PairwiseRanker::weights

fn PairwiseRanker::weights(self : PairwiseRanker) -> Array[Double]

#
PassiveAggressiveRegressor

pub struct PassiveAggressiveRegressor {
weights : Array[Double]
aggressiveness : Double
epsilon : Double
l2 : Double
updates : Int
}

Passive-aggressive online regression with robust step sizing.

#
PassiveAggressiveRegressor::new

fn PassiveAggressiveRegressor::new(dimension : Int, aggressiveness? : Double, epsilon? : Double, l2? : Double) -> PassiveAggressiveRegressor

#
PassiveAggressiveRegressor::predict

fn PassiveAggressiveRegressor::predict(self : PassiveAggressiveRegressor, features : Array[Double]) -> Double

#
PassiveAggressiveRegressor::reset

#
PassiveAggressiveRegressor::update

fn PassiveAggressiveRegressor::update(self : PassiveAggressiveRegressor, features : Array[Double], label : Double) -> Bool

#
PassiveAggressiveRegressor::updates

#
PassiveAggressiveRegressor::weights

#
PredictionGuard

pub struct PredictionGuard {
lower : Double
upper : Double
repaired : Int
}

#
PredictionGuard::apply

fn PredictionGuard::apply(self : PredictionGuard, prediction : Double) -> Double

#
PredictionGuard::new

fn PredictionGuard::new(lower : Double, upper : Double) -> PredictionGuard

#
PredictionGuard::repaired

fn PredictionGuard::repaired(self : PredictionGuard) -> Int

#
PredictionGuard::reset

fn PredictionGuard::reset(self : PredictionGuard) -> Unit

#
PredictionRequest

pub struct PredictionRequest {
request_id : String
features : Array[Double]
timestamp : Int64
group : String
}

Deterministic model-serving helpers for embedding online models in services.

#
PredictionRequest::features

fn PredictionRequest::features(self : PredictionRequest) -> Array[Double]

#
PredictionRequest::group

fn PredictionRequest::group(self : PredictionRequest) -> String

#
PredictionRequest::new

fn PredictionRequest::new(request_id : String, features : Array[Double], timestamp : Int64, group? : String) -> PredictionRequest

#
PredictionRequest::request_id

fn PredictionRequest::request_id(self : PredictionRequest) -> String

#
PredictionRequest::timestamp

fn PredictionRequest::timestamp(self : PredictionRequest) -> Int64

#
PredictionResponse

pub struct PredictionResponse {
request_id : String
prediction : Double
probability : Double
model_version : String
latency_ms : Double
accepted : Bool
}

#
PredictionResponse::accepted

fn PredictionResponse::accepted(self : PredictionResponse) -> Bool

#
PredictionResponse::latency_ms

fn PredictionResponse::latency_ms(self : PredictionResponse) -> Double

#
PredictionResponse::model_version

fn PredictionResponse::model_version(self : PredictionResponse) -> String

#
PredictionResponse::new

fn PredictionResponse::new(request_id : String, prediction : Double, model_version : String, latency_ms? : Double, accepted? : Bool) -> PredictionResponse

#
PredictionResponse::prediction

fn PredictionResponse::prediction(self : PredictionResponse) -> Double

#
PredictionResponse::probability

fn PredictionResponse::probability(self : PredictionResponse) -> Double

#
PredictionResponse::request_id

fn PredictionResponse::request_id(self : PredictionResponse) -> String

#
PredictionSet

pub struct PredictionSet {
labels : Array[Int]
probabilities : Array[Double]
threshold : Double
}

#
PredictionSet::contains

fn PredictionSet::contains(self : PredictionSet, label : Int) -> Bool

#
PredictionSet::labels

fn PredictionSet::labels(self : PredictionSet) -> Array[Int]

#
PredictionSet::new

fn PredictionSet::new(probabilities : Array[Double], threshold? : Double) -> PredictionSet

#
PredictionSet::probability

fn PredictionSet::probability(self : PredictionSet, label : Int) -> Double

#
PredictionSet::size

fn PredictionSet::size(self : PredictionSet) -> Int

#
PrivacyBudget

pub struct PrivacyBudget {
total : Double
remaining_budget : Double
queries : Int
rejected : Int
}

#
PrivacyBudget::consume

fn PrivacyBudget::consume(self : PrivacyBudget, cost : Double) -> Bool

#
PrivacyBudget::exhausted

fn PrivacyBudget::exhausted(self : PrivacyBudget) -> Bool

#
PrivacyBudget::new

fn PrivacyBudget::new(epsilon : Double) -> PrivacyBudget

#
PrivacyBudget::queries

fn PrivacyBudget::queries(self : PrivacyBudget) -> Int

#
PrivacyBudget::rejected

fn PrivacyBudget::rejected(self : PrivacyBudget) -> Int

#
PrivacyBudget::remaining

fn PrivacyBudget::remaining(self : PrivacyBudget) -> Double

#
PrivacyBudget::reset

fn PrivacyBudget::reset(self : PrivacyBudget) -> Unit

#
PrivacyBudget::spent

fn PrivacyBudget::spent(self : PrivacyBudget) -> Double

#
PrivacyBudget::total

fn PrivacyBudget::total(self : PrivacyBudget) -> Double

#
PromotionGate

pub struct PromotionGate {
minimum_auc : Double
maximum_log_loss : Double
minimum_samples : Int
}

#
PromotionGate::accept

fn PromotionGate::accept(self : PromotionGate, summary : EvaluationSummary) -> Bool

#
PromotionGate::new

fn PromotionGate::new(minimum_auc? : Double, maximum_log_loss? : Double, minimum_samples? : Int) -> PromotionGate

#
QualityGate

pub struct QualityGate {
dimension : Int
min_weight : Double
max_weight : Double
allow_nan_like : Bool
}

#
QualityGate::dimension

fn QualityGate::dimension(self : QualityGate) -> Int

#
QualityGate::new

fn QualityGate::new(dimension : Int, min_weight? : Double, max_weight? : Double) -> QualityGate

#
QualityGate::validate_features

fn QualityGate::validate_features(self : QualityGate, features : Array[Double]) -> ValidationReport

#
QualityGate::validate_sample

fn QualityGate::validate_sample(self : QualityGate, features : Array[Double], weight : Double) -> ValidationReport

#
QualityGate::validate_weight

fn QualityGate::validate_weight(self : QualityGate, weight : Double) -> ValidationReport

#
QuantileBinner

pub struct QuantileBinner {
boundaries : Array[Double]
}

#
QuantileBinner::bin

fn QuantileBinner::bin(self : QuantileBinner, value : Double) -> Int

#
QuantileBinner::bins

fn QuantileBinner::bins(self : QuantileBinner) -> Int

#
QuantileBinner::boundaries

fn QuantileBinner::boundaries(self : QuantileBinner) -> Array[Double]

#
QuantileBinner::new

fn QuantileBinner::new(boundaries : Array[Double]) -> QuantileBinner

#
QuantileBinner::one_hot

fn QuantileBinner::one_hot(self : QuantileBinner, value : Double) -> Array[Double]

#
RLS

pub struct RLS {
weights : Array[Double]
p : Array[Array[Double]]
lambda : Double
} derive(ToJson,
FromJson
)

Recursive Least Squares (RLS) model for online linear regression.

#
RLS::new

fn RLS::new(dim : Int, lambda? : Double, alpha? : Double) -> RLS

Create a new RLS model with dim features. lambda is the forgetting factor (default 1.0). alpha is the initial ridge regression penalty (default 1.0).

#
RLS::predict

fn RLS::predict(self : RLS, features : Array[Double]) -> Double

Predict the output for a given feature vector.

#
RLS::update

fn RLS::update(self : RLS, features : Array[Double], label : Double) -> Unit

Update the model with a single sample (features and label).

#
RMSPropOptimizer

pub struct RMSPropOptimizer {
learning_rate : Double
decay : Double
epsilon : Double
mean_square : Array[Double]
clipper : GradientClipper
step_count : Int
}

#
RMSPropOptimizer::apply

fn RMSPropOptimizer::apply(self : RMSPropOptimizer, parameters : Array[Double], gradients : Array[Double]) -> Unit

#
RMSPropOptimizer::mean_square

fn RMSPropOptimizer::mean_square(self : RMSPropOptimizer) -> Array[Double]

#
RMSPropOptimizer::new

fn RMSPropOptimizer::new(dimension : Int, learning_rate? : Double, decay? : Double, epsilon? : Double, clipper? : GradientClipper) -> RMSPropOptimizer

#
RMSPropOptimizer::reset

fn RMSPropOptimizer::reset(self : RMSPropOptimizer) -> Unit

#
RMSPropOptimizer::update

fn RMSPropOptimizer::update(self : RMSPropOptimizer, gradients : Array[Double]) -> Array[Double]

#
RandomFourierFeatures

pub struct RandomFourierFeatures {
input_dimension : Int
output_dimension : Int
weights : Array[Array[Double]]
phases : Array[Double]
scale : Double
rng : DeterministicRng
}

Random Fourier feature map for approximating a Gaussian kernel.

#
RandomFourierFeatures::input_dimension

fn RandomFourierFeatures::input_dimension(self : RandomFourierFeatures) -> Int

#
RandomFourierFeatures::new

fn RandomFourierFeatures::new(input_dimension : Int, output_dimension : Int, width? : Double, seed? : UInt64) -> RandomFourierFeatures

#
RandomFourierFeatures::output_dimension

fn RandomFourierFeatures::output_dimension(self : RandomFourierFeatures) -> Int

#
RandomFourierFeatures::transform

fn RandomFourierFeatures::transform(self : RandomFourierFeatures, features : Array[Double]) -> Array[Double]

#
RandomFourierFeatures::weight_matrix

fn RandomFourierFeatures::weight_matrix(self : RandomFourierFeatures) -> Array[Array[Double]]

#
RankingMetrics

pub struct RankingMetrics {
queries : Double
reciprocal_rank : Double
ndcg_sum : Double
hits : Array[Double]
}

#
RankingMetrics::mrr

fn RankingMetrics::mrr(self : RankingMetrics) -> Double

#
RankingMetrics::ndcg

fn RankingMetrics::ndcg(self : RankingMetrics) -> Double

#
RankingMetrics::new

fn RankingMetrics::new(max_k? : Int) -> RankingMetrics

#
RankingMetrics::observe

fn RankingMetrics::observe(self : RankingMetrics, relevances : Array[Double]) -> Unit

#
RankingMetrics::queries

fn RankingMetrics::queries(self : RankingMetrics) -> Double

#
RankingMetrics::recall_at

fn RankingMetrics::recall_at(self : RankingMetrics, k : Int) -> Double

#
RankingMetrics::reset

fn RankingMetrics::reset(self : RankingMetrics) -> Unit

#
RateLimiter

pub struct RateLimiter {
limit : Int
period : Int
ticks : Int
accepted : Int
}

#
RateLimiter::accepted

fn RateLimiter::accepted(self : RateLimiter) -> Int

#
RateLimiter::allow

fn RateLimiter::allow(self : RateLimiter) -> Bool

#
RateLimiter::new

fn RateLimiter::new(limit : Int, period : Int) -> RateLimiter

#
RateLimiter::reset

fn RateLimiter::reset(self : RateLimiter) -> Unit

#
RegressionMetrics

pub struct RegressionMetrics {
count : Double
absolute_error : Double
squared_error : Double
label_sum : Double
label_squared_sum : Double
minimum_error : Double
maximum_error : Double
}

Regression metrics that remain stable under incremental updates.

#
RegressionMetrics::count

fn RegressionMetrics::count(self : RegressionMetrics) -> Double

#
RegressionMetrics::mae

fn RegressionMetrics::mae(self : RegressionMetrics) -> Double

#
RegressionMetrics::maximum_error

fn RegressionMetrics::maximum_error(self : RegressionMetrics) -> Double

#
RegressionMetrics::minimum_error

fn RegressionMetrics::minimum_error(self : RegressionMetrics) -> Double

#
RegressionMetrics::mse

fn RegressionMetrics::mse(self : RegressionMetrics) -> Double

#
RegressionMetrics::new

#
RegressionMetrics::r2

fn RegressionMetrics::r2(self : RegressionMetrics) -> Double

#
RegressionMetrics::reset

fn RegressionMetrics::reset(self : RegressionMetrics) -> Unit

#
RegressionMetrics::rmse

fn RegressionMetrics::rmse(self : RegressionMetrics) -> Double

#
RegressionMetrics::update

fn RegressionMetrics::update(self : RegressionMetrics, prediction : Double, label : Double, weight? : Double) -> Unit

#
Regularizer

pub struct Regularizer {
l1 : Double
l2 : Double
}

#
Regularizer::gradient

fn Regularizer::gradient(self : Regularizer, weights : Array[Double], index : Int) -> Double

#
Regularizer::new

fn Regularizer::new(l1? : Double, l2? : Double) -> Regularizer

#
Regularizer::penalty

fn Regularizer::penalty(self : Regularizer, weights : Array[Double]) -> Double

#
Regularizer::proximal

fn Regularizer::proximal(self : Regularizer, value : Double, step : Double) -> Double

#
ReproducibilityManifest

pub struct ReproducibilityManifest {
model : String
version : String
source_checksum : String
data_checksum : String
seed : Int
parameters : Map[String, String]
}

#
ReproducibilityManifest::data_checksum

fn ReproducibilityManifest::data_checksum(self : ReproducibilityManifest) -> String

#
ReproducibilityManifest::fingerprint

fn ReproducibilityManifest::fingerprint(self : ReproducibilityManifest) -> String

#
ReproducibilityManifest::model

#
ReproducibilityManifest::new

fn ReproducibilityManifest::new(model : String, version : String, source_checksum : String, data_checksum : String, seed : Int) -> ReproducibilityManifest

#
ReproducibilityManifest::parameter

fn ReproducibilityManifest::parameter(self : ReproducibilityManifest, key : String) -> String

#
ReproducibilityManifest::parameter_count

fn ReproducibilityManifest::parameter_count(self : ReproducibilityManifest) -> Int

#
ReproducibilityManifest::seed

#
ReproducibilityManifest::set

fn ReproducibilityManifest::set(self : ReproducibilityManifest, key : String, value : String) -> Unit

#
ReproducibilityManifest::source_checksum

fn ReproducibilityManifest::source_checksum(self : ReproducibilityManifest) -> String

#
ReproducibilityManifest::version

fn ReproducibilityManifest::version(self : ReproducibilityManifest) -> String

#
RequestBatcher

pub struct RequestBatcher {
capacity : Int
requests : Array[PredictionRequest]
flushed : Int
dropped : Int
}

#
RequestBatcher::add

fn RequestBatcher::add(self : RequestBatcher, request : PredictionRequest) -> Bool

#
RequestBatcher::dropped

fn RequestBatcher::dropped(self : RequestBatcher) -> Int

#
RequestBatcher::flush

#
RequestBatcher::flushed

fn RequestBatcher::flushed(self : RequestBatcher) -> Int

#
RequestBatcher::new

fn RequestBatcher::new(capacity : Int) -> RequestBatcher

#
RequestBatcher::pending

fn RequestBatcher::pending(self : RequestBatcher) -> Int

#
RequestBatcher::ready

fn RequestBatcher::ready(self : RequestBatcher) -> Bool

#
RequestBatcher::reset

fn RequestBatcher::reset(self : RequestBatcher) -> Unit

#
ReservoirSampler

pub struct ReservoirSampler {
capacity : Int
values : Array[Double]
seen : Int
rng : DeterministicRng
}

#
ReservoirSampler::capacity

fn ReservoirSampler::capacity(self : ReservoirSampler) -> Int

#
ReservoirSampler::new

fn ReservoirSampler::new(capacity : Int, seed? : UInt64) -> ReservoirSampler

#
ReservoirSampler::observe

fn ReservoirSampler::observe(self : ReservoirSampler, value : Double) -> Bool

#
ReservoirSampler::reset

fn ReservoirSampler::reset(self : ReservoirSampler) -> Unit

#
ReservoirSampler::sample

fn ReservoirSampler::sample(self : ReservoirSampler) -> Array[Double]

#
ReservoirSampler::seen

fn ReservoirSampler::seen(self : ReservoirSampler) -> Int

#
RollbackPolicy

pub struct RollbackPolicy {
minimum_accuracy : Double
maximum_loss : Double
maximum_error_rate : Double
}

#
RollbackPolicy::new

fn RollbackPolicy::new(minimum_accuracy? : Double, maximum_loss? : Double, maximum_error_rate? : Double) -> RollbackPolicy

#
RollbackPolicy::should_rollback

fn RollbackPolicy::should_rollback(self : RollbackPolicy, accuracy : Double, loss : Double, error_rate : Double) -> Bool

#
RollingWindow

pub struct RollingWindow {
capacity : Int
features : Array[Array[Double]]
labels : Array[Double]
weights : Array[Double]
dropped : Int
}

#
RollingWindow::batch

#
RollingWindow::capacity

fn RollingWindow::capacity(self : RollingWindow) -> Int

#
RollingWindow::clear

fn RollingWindow::clear(self : RollingWindow) -> Unit

#
RollingWindow::dropped

fn RollingWindow::dropped(self : RollingWindow) -> Int

#
RollingWindow::new

fn RollingWindow::new(capacity : Int) -> RollingWindow

#
RollingWindow::push

fn RollingWindow::push(self : RollingWindow, features : Array[Double], label : Double, weight? : Double) -> Bool

#
RollingWindow::size

fn RollingWindow::size(self : RollingWindow) -> Int

#
RunningMean

pub struct RunningMean {
count : Double
mean : Double
}

#
RunningMean::count

fn RunningMean::count(self : RunningMean) -> Double

#
RunningMean::merge

fn RunningMean::merge(self : RunningMean, other : RunningMean) -> Unit

#
RunningMean::new

#
RunningMean::update

fn RunningMean::update(self : RunningMean, value : Double) -> Unit

#
RunningMean::value

fn RunningMean::value(self : RunningMean) -> Double

#
RunningMoments

pub struct RunningMoments {
count : Double
mean : Double
m2 : Double
minimum : Double
maximum : Double
}

Numerically stable scalar moments using Welford's recurrence.

#
RunningMoments::count

fn RunningMoments::count(self : RunningMoments) -> Double

#
RunningMoments::maximum

fn RunningMoments::maximum(self : RunningMoments) -> Double

#
RunningMoments::mean

fn RunningMoments::mean(self : RunningMoments) -> Double

#
RunningMoments::merge

fn RunningMoments::merge(self : RunningMoments, other : RunningMoments) -> Unit

#
RunningMoments::minimum

fn RunningMoments::minimum(self : RunningMoments) -> Double

#
RunningMoments::new

#
RunningMoments::population_variance

fn RunningMoments::population_variance(self : RunningMoments) -> Double

#
RunningMoments::range

fn RunningMoments::range(self : RunningMoments) -> Double

#
RunningMoments::reset

fn RunningMoments::reset(self : RunningMoments) -> Unit

#
RunningMoments::standard_deviation

fn RunningMoments::standard_deviation(self : RunningMoments) -> Double

#
RunningMoments::update

fn RunningMoments::update(self : RunningMoments, value : Double, weight? : Double) -> Unit

#
RunningMoments::variance

fn RunningMoments::variance(self : RunningMoments) -> Double

#
RunningMoments::z_score

fn RunningMoments::z_score(self : RunningMoments, value : Double) -> Double

#
SGDLogisticRegression

pub struct SGDLogisticRegression {
weights : Array[Double]
alpha : Double
} derive(ToJson,
FromJson
)

Online Logistic Regression using Stochastic Gradient Descent.

#
SGDLogisticRegression::new

fn SGDLogisticRegression::new(dim : Int, alpha? : Double) -> SGDLogisticRegression

Create a new SGD Logistic Regression model.

#
SGDLogisticRegression::predict

fn SGDLogisticRegression::predict(self : SGDLogisticRegression, features : Array[Double]) -> Double

Predict the probability (0 to 1) for a given feature vector.

#
SGDLogisticRegression::update

fn SGDLogisticRegression::update(self : SGDLogisticRegression, features : Array[Double], label : Double) -> Unit

Update the model with a single sample (features and label). Label should be 0.0 or 1.0.

#
SeasonalMean

pub struct SeasonalMean {
sums : Array[Double]
counts : Array[Double]
observations : Int
}

Seasonal baseline using per-phase running means.

#
SeasonalMean::forecast

fn SeasonalMean::forecast(self : SeasonalMean, horizon : Int) -> Array[Double]

#
SeasonalMean::mean_at

fn SeasonalMean::mean_at(self : SeasonalMean, index : Int) -> Double

#
SeasonalMean::new

fn SeasonalMean::new(period : Int) -> SeasonalMean

#
SeasonalMean::observations

fn SeasonalMean::observations(self : SeasonalMean) -> Int

#
SeasonalMean::period

fn SeasonalMean::period(self : SeasonalMean) -> Int

#
SeasonalMean::reset

fn SeasonalMean::reset(self : SeasonalMean) -> Unit

#
SeasonalMean::update

fn SeasonalMean::update(self : SeasonalMean, value : Double) -> Double

#
SequenceFeatureBuilder

pub struct SequenceFeatureBuilder {
lags : Int
include_delta : Bool
include_mean : Bool
include_variance : Bool
window : SequenceWindow
}

#
SequenceFeatureBuilder::feature_count

fn SequenceFeatureBuilder::feature_count(self : SequenceFeatureBuilder) -> Int

#
SequenceFeatureBuilder::new

fn SequenceFeatureBuilder::new(lags : Int, include_delta? : Bool, include_mean? : Bool, include_variance? : Bool) -> SequenceFeatureBuilder

#
SequenceFeatureBuilder::reset

#
SequenceFeatureBuilder::transform

fn SequenceFeatureBuilder::transform(self : SequenceFeatureBuilder, value : Double) -> Array[Double]

#
SequenceWindow

pub struct SequenceWindow {
capacity : Int
values : Array[Double]
total : Double
sum_squares : Double
}

Compact sequence-learning primitives for event streams and demand signals.

#
SequenceWindow::capacity

fn SequenceWindow::capacity(self : SequenceWindow) -> Int

#
SequenceWindow::clear

fn SequenceWindow::clear(self : SequenceWindow) -> Unit

#
SequenceWindow::last

fn SequenceWindow::last(self : SequenceWindow) -> Double

#
SequenceWindow::mean

fn SequenceWindow::mean(self : SequenceWindow) -> Double

#
SequenceWindow::new

fn SequenceWindow::new(capacity : Int) -> SequenceWindow

#
SequenceWindow::push

fn SequenceWindow::push(self : SequenceWindow, value : Double) -> Unit

#
SequenceWindow::size

fn SequenceWindow::size(self : SequenceWindow) -> Int

#
SequenceWindow::values

fn SequenceWindow::values(self : SequenceWindow) -> Array[Double]

#
SequenceWindow::variance

fn SequenceWindow::variance(self : SequenceWindow) -> Double

#
ServingStats

pub struct ServingStats {
requests : Int
successes : Int
failures : Int
total_latency : Double
max_latency : Double
bytes : Int
}

#
ServingStats::bytes

fn ServingStats::bytes(self : ServingStats) -> Int

#
ServingStats::max_latency

fn ServingStats::max_latency(self : ServingStats) -> Double

#
ServingStats::mean_latency

fn ServingStats::mean_latency(self : ServingStats) -> Double

#
ServingStats::new

#
ServingStats::observe

fn ServingStats::observe(self : ServingStats, response : PredictionResponse, payload_bytes? : Int) -> Unit

#
ServingStats::requests

fn ServingStats::requests(self : ServingStats) -> Int

#
ServingStats::reset

fn ServingStats::reset(self : ServingStats) -> Unit

#
ServingStats::success_rate

fn ServingStats::success_rate(self : ServingStats) -> Double

#
ShadowEvaluator

pub struct ShadowEvaluator {
primary_version : String
shadow_version : String
comparisons : Int
disagreements : Int
absolute_difference : Double
}

#
ShadowEvaluator::comparisons

fn ShadowEvaluator::comparisons(self : ShadowEvaluator) -> Int

#
ShadowEvaluator::disagreement_rate

fn ShadowEvaluator::disagreement_rate(self : ShadowEvaluator) -> Double

#
ShadowEvaluator::disagreements

fn ShadowEvaluator::disagreements(self : ShadowEvaluator) -> Int

#
ShadowEvaluator::mean_absolute_difference

fn ShadowEvaluator::mean_absolute_difference(self : ShadowEvaluator) -> Double

#
ShadowEvaluator::new

fn ShadowEvaluator::new(primary_version : String, shadow_version : String) -> ShadowEvaluator

#
ShadowEvaluator::observe

fn ShadowEvaluator::observe(self : ShadowEvaluator, primary : Double, shadow : Double, tolerance? : Double) -> Bool

#
ShadowEvaluator::reset

fn ShadowEvaluator::reset(self : ShadowEvaluator) -> Unit

#
ShadowEvaluator::versions

fn ShadowEvaluator::versions(self : ShadowEvaluator) -> (String, String)

#
SnapshotCatalog

pub struct SnapshotCatalog {
snapshots : Map[String, SnapshotEnvelope]
writes : Int
}

#
SnapshotCatalog::clear

fn SnapshotCatalog::clear(self : SnapshotCatalog) -> Unit

#
SnapshotCatalog::get

fn SnapshotCatalog::get(self : SnapshotCatalog, key : String) -> SnapshotEnvelope?

#
SnapshotCatalog::keys

fn SnapshotCatalog::keys(self : SnapshotCatalog) -> Array[String]

#
SnapshotCatalog::new

#
SnapshotCatalog::put

fn SnapshotCatalog::put(self : SnapshotCatalog, key : String, snapshot : SnapshotEnvelope) -> Bool

#
SnapshotCatalog::size

fn SnapshotCatalog::size(self : SnapshotCatalog) -> Int

#
SnapshotCatalog::writes

fn SnapshotCatalog::writes(self : SnapshotCatalog) -> Int

#
SnapshotEnvelope

pub struct SnapshotEnvelope {
schema : String
model : String
version : String
payload : String
checksum : String
} derive(ToJson,
Debug
,
FromJson
)

A small, versioned envelope for application-owned model snapshots.

#
SnapshotEnvelope::checksum

fn SnapshotEnvelope::checksum(self : SnapshotEnvelope) -> String

#
SnapshotEnvelope::is_compatible

fn SnapshotEnvelope::is_compatible(self : SnapshotEnvelope, schema : String, model : String) -> Bool

#
SnapshotEnvelope::model

fn SnapshotEnvelope::model(self : SnapshotEnvelope) -> String

#
SnapshotEnvelope::new

fn SnapshotEnvelope::new(schema : String, model : String, version : String, payload : String, checksum : String) -> SnapshotEnvelope

#
SnapshotEnvelope::payload

fn SnapshotEnvelope::payload(self : SnapshotEnvelope) -> String

#
SnapshotEnvelope::schema

fn SnapshotEnvelope::schema(self : SnapshotEnvelope) -> String

#
SnapshotEnvelope::to_json_string

fn SnapshotEnvelope::to_json_string(self : SnapshotEnvelope) -> String

#
SnapshotEnvelope::version

fn SnapshotEnvelope::version(self : SnapshotEnvelope) -> String

#
SparseAccumulator

pub struct SparseAccumulator {
dimension : Int
values : Map[Int, Double]
}

#
SparseAccumulator::add

fn SparseAccumulator::add(self : SparseAccumulator, index : Int, value : Double) -> Bool

#
SparseAccumulator::clear

fn SparseAccumulator::clear(self : SparseAccumulator) -> Unit

#
SparseAccumulator::dimension

fn SparseAccumulator::dimension(self : SparseAccumulator) -> Int

#
SparseAccumulator::get

fn SparseAccumulator::get(self : SparseAccumulator, index : Int) -> Double

#
SparseAccumulator::new

fn SparseAccumulator::new(dimension : Int) -> SparseAccumulator

#
SparseAccumulator::to_vector

#
SparseAdagradClassifier

pub struct SparseAdagradClassifier {
weights : Array[Double]
accumulator : Array[Double]
learning_rate : Double
epsilon : Double
l2 : Double
steps : Int
}

Sparse Adagrad logistic regression with a dense accumulator for predictable inference and sparse updates.

#
SparseAdagradClassifier::new

fn SparseAdagradClassifier::new(dimension : Int, learning_rate? : Double, epsilon? : Double, l2? : Double) -> SparseAdagradClassifier

#
SparseAdagradClassifier::predict

fn SparseAdagradClassifier::predict(self : SparseAdagradClassifier, features : SparseVector) -> Double

#
SparseAdagradClassifier::reset

#
SparseAdagradClassifier::steps

#
SparseAdagradClassifier::update

fn SparseAdagradClassifier::update(self : SparseAdagradClassifier, features : SparseVector, label : Double) -> Unit

#
SparseAdagradClassifier::weight

fn SparseAdagradClassifier::weight(self : SparseAdagradClassifier, index : Int) -> Double

#
SparseAdagradClassifier::weights

#
SparseEntry

pub struct SparseEntry {
index : Int
value : Double
} derive(ToJson,
Debug
,
FromJson
)

A sparse feature entry. Indices are zero-based and values equal to zero are omitted from canonical sparse vectors.

#
SparseEntry::index

fn SparseEntry::index(self : SparseEntry) -> Int

#
SparseEntry::new

fn SparseEntry::new(index : Int, value : Double) -> SparseEntry

#
SparseEntry::value

fn SparseEntry::value(self : SparseEntry) -> Double

#
SparseFTRL

pub struct SparseFTRL {
dimension : Int
alpha : Double
beta : Double
l1 : Double
l2 : Double
z : Array[Double]
n : Array[Double]
steps : Int
}

FTRL-Proximal for sparse vectors. Only non-zero coordinates are touched during an update, which keeps the per-event cost O(nnz).

#
SparseFTRL::dimension

fn SparseFTRL::dimension(self : SparseFTRL) -> Int

#
SparseFTRL::new

fn SparseFTRL::new(dimension : Int, alpha? : Double, beta? : Double, l1? : Double, l2? : Double) -> SparseFTRL

#
SparseFTRL::non_zero_weights

fn SparseFTRL::non_zero_weights(self : SparseFTRL, tolerance? : Double) -> SparseVector

#
SparseFTRL::predict

fn SparseFTRL::predict(self : SparseFTRL, features : SparseVector) -> Double

#
SparseFTRL::reset

fn SparseFTRL::reset(self : SparseFTRL) -> Unit

#
SparseFTRL::steps

fn SparseFTRL::steps(self : SparseFTRL) -> Int

#
SparseFTRL::update

fn SparseFTRL::update(self : SparseFTRL, features : SparseVector, label : Double) -> Unit

#
SparseFTRL::weight

fn SparseFTRL::weight(self : SparseFTRL, index : Int) -> Double

#
SparseVector

pub struct SparseVector {
dimension : Int
entries : Array[SparseEntry]
} derive(ToJson,
Debug
,
FromJson
)

#
SparseVector::add

#
SparseVector::contains

fn SparseVector::contains(self : SparseVector, index : Int) -> Bool

#
SparseVector::cosine

fn SparseVector::cosine(self : SparseVector, other : SparseVector) -> Double

#
SparseVector::dimension

fn SparseVector::dimension(self : SparseVector) -> Int

#
SparseVector::distance_squared

fn SparseVector::distance_squared(self : SparseVector, other : SparseVector) -> Double

#
SparseVector::dot_dense

fn SparseVector::dot_dense(self : SparseVector, values : Array[Double]) -> Double

#
SparseVector::dot_sparse

fn SparseVector::dot_sparse(self : SparseVector, other : SparseVector) -> Double

#
SparseVector::entries

fn SparseVector::entries(self : SparseVector) -> Array[SparseEntry]

#
SparseVector::from_dense

fn SparseVector::from_dense(values : Array[Double], threshold? : Double) -> SparseVector

#
SparseVector::from_entries

fn SparseVector::from_entries(dimension : Int, entries : Array[SparseEntry]) -> SparseVector

#
SparseVector::get

fn SparseVector::get(self : SparseVector, index : Int) -> Double

#
SparseVector::is_empty

fn SparseVector::is_empty(self : SparseVector) -> Bool

#
SparseVector::is_sorted

fn SparseVector::is_sorted(self : SparseVector) -> Bool

#
SparseVector::l1_norm

fn SparseVector::l1_norm(self : SparseVector) -> Double

#
SparseVector::l2_norm

fn SparseVector::l2_norm(self : SparseVector) -> Double

#
SparseVector::map

fn SparseVector::map(self : SparseVector, transform : (Double) -> Double) -> SparseVector

#
SparseVector::max_abs

fn SparseVector::max_abs(self : SparseVector) -> Double

#
SparseVector::new

fn SparseVector::new(dimension : Int) -> SparseVector

#
SparseVector::nnz

fn SparseVector::nnz(self : SparseVector) -> Int

#
SparseVector::normalize

fn SparseVector::normalize(self : SparseVector) -> SparseVector

#
SparseVector::scale

fn SparseVector::scale(self : SparseVector, factor : Double) -> SparseVector

#
SparseVector::set

fn SparseVector::set(self : SparseVector, index : Int, value : Double) -> SparseVector

#
SparseVector::subtract

fn SparseVector::subtract(self : SparseVector, other : SparseVector) -> SparseVector

#
SparseVector::threshold

fn SparseVector::threshold(self : SparseVector, limit : Double) -> SparseVector

#
SparseVector::to_dense

fn SparseVector::to_dense(self : SparseVector) -> Array[Double]

#
StabilityTracker

pub struct StabilityTracker {
previous : Array[Double]
observations : Int
drift : Double
}

#
StabilityTracker::mean_drift

fn StabilityTracker::mean_drift(self : StabilityTracker) -> Double

#
StabilityTracker::new

fn StabilityTracker::new(dimension : Int) -> StabilityTracker

#
StabilityTracker::observations

fn StabilityTracker::observations(self : StabilityTracker) -> Int

#
StabilityTracker::observe

fn StabilityTracker::observe(self : StabilityTracker, values : Array[Double]) -> Double

#
StabilityTracker::reset

fn StabilityTracker::reset(self : StabilityTracker) -> Unit

#
Standardizer

pub struct Standardizer {
count : Double
mean : Array[Double]
m2 : Array[Double]
} derive(ToJson,
FromJson
)

A standardizer that tracks running mean and variance to standardize features incrementally using Welford's online algorithm.

#
Standardizer::count

fn Standardizer::count(self : Standardizer) -> Double

#
Standardizer::mean

fn Standardizer::mean(self : Standardizer) -> Array[Double]

Return a copy of the current running means.

#
Standardizer::new

fn Standardizer::new(dim : Int) -> Standardizer

Create a new feature standardizer for dim features.

#
Standardizer::reset

fn Standardizer::reset(self : Standardizer) -> Unit

#
Standardizer::update_and_transform

fn Standardizer::update_and_transform(self : Standardizer, features : Array[Double]) -> Array[Double]

Update the standardizer with a new feature vector, returning the standardized features.

#
Standardizer::variance

fn Standardizer::variance(self : Standardizer) -> Array[Double]

Return the unbiased running variance for every feature.

#
StratifiedSampler

pub struct StratifiedSampler {
capacity_per_class : Int
samples : Map[Int, Array[Array[Double]]]
seen : Int
rng : DeterministicRng
}

#
StratifiedSampler::class_count

fn StratifiedSampler::class_count(self : StratifiedSampler, label : Int) -> Int

#
StratifiedSampler::classes

fn StratifiedSampler::classes(self : StratifiedSampler) -> Array[Int]

#
StratifiedSampler::new

fn StratifiedSampler::new(capacity_per_class : Int, seed? : UInt64) -> StratifiedSampler

#
StratifiedSampler::observe

fn StratifiedSampler::observe(self : StratifiedSampler, label : Int, features : Array[Double]) -> Bool

#
StratifiedSampler::reset

fn StratifiedSampler::reset(self : StratifiedSampler) -> Unit

#
StratifiedSampler::samples

fn StratifiedSampler::samples(self : StratifiedSampler, label : Int) -> Array[Array[Double]]

#
StratifiedSampler::seen

fn StratifiedSampler::seen(self : StratifiedSampler) -> Int

#
StreamCounters

pub struct StreamCounters {
rows : Int
accepted : Int
rejected : Int
positive : Int
negative : Int
}

#
StreamCounters::acceptance_rate

fn StreamCounters::acceptance_rate(self : StreamCounters) -> Double

#
StreamCounters::accepted

fn StreamCounters::accepted(self : StreamCounters) -> Int

#
StreamCounters::new

#
StreamCounters::observe

fn StreamCounters::observe(self : StreamCounters, accepted : Bool, label? : Double) -> Unit

#
StreamCounters::rejected

fn StreamCounters::rejected(self : StreamCounters) -> Int

#
StreamCounters::rows

fn StreamCounters::rows(self : StreamCounters) -> Int

#
StreamWatermark

pub struct StreamWatermark {
current : Int64
allowed_lateness : Int64
late_events : Int
}

#
StreamWatermark::current

fn StreamWatermark::current(self : StreamWatermark) -> Int64

#
StreamWatermark::late_events

fn StreamWatermark::late_events(self : StreamWatermark) -> Int

#
StreamWatermark::new

fn StreamWatermark::new(allowed_lateness : Int64) -> StreamWatermark

#
StreamWatermark::observe

fn StreamWatermark::observe(self : StreamWatermark, timestamp : Int64) -> Bool

#
StreamWatermark::reset

fn StreamWatermark::reset(self : StreamWatermark) -> Unit

#
TargetEncoder

pub struct TargetEncoder {
sums : Map[String, Double]
counts : Map[String, Double]
prior : RunningMean
smoothing : Double
}

#
TargetEncoder::encode

fn TargetEncoder::encode(self : TargetEncoder, category : String) -> Double

#
TargetEncoder::known_categories

fn TargetEncoder::known_categories(self : TargetEncoder) -> Int

#
TargetEncoder::new

fn TargetEncoder::new(smoothing? : Double) -> TargetEncoder

#
TargetEncoder::reset

fn TargetEncoder::reset(self : TargetEncoder) -> Unit

#
TargetEncoder::update

fn TargetEncoder::update(self : TargetEncoder, category : String, target : Double, weight? : Double) -> Unit

#
TextStatistics

pub struct TextStatistics {
documents : Int
tokens : Int
vocabulary : Map[String, Int]
}

#
TextStatistics::documents

fn TextStatistics::documents(self : TextStatistics) -> Int

#
TextStatistics::frequency

fn TextStatistics::frequency(self : TextStatistics, word : String) -> Int

#
TextStatistics::new

#
TextStatistics::observe

fn TextStatistics::observe(self : TextStatistics, words : Array[String]) -> Unit

#
TextStatistics::reset

fn TextStatistics::reset(self : TextStatistics) -> Unit

#
TextStatistics::tokens

fn TextStatistics::tokens(self : TextStatistics) -> Int

#
TextStatistics::top_words

fn TextStatistics::top_words(self : TextStatistics, k : Int) -> Array[String]

#
TextStatistics::vocabulary_size

fn TextStatistics::vocabulary_size(self : TextStatistics) -> Int

#
ThresholdOptimizer

pub struct ThresholdOptimizer {
costs : ClassCost
minimum : Double
maximum : Double
steps : Int
best_threshold : Double
best_cost : Double
}

#
ThresholdOptimizer::cost

fn ThresholdOptimizer::cost(self : ThresholdOptimizer) -> Double

#
ThresholdOptimizer::fit

fn ThresholdOptimizer::fit(self : ThresholdOptimizer, predictions : Array[Double], labels : Array[Double]) -> Double

#
ThresholdOptimizer::new

fn ThresholdOptimizer::new(costs? : ClassCost, minimum? : Double, maximum? : Double, steps? : Int) -> ThresholdOptimizer

#
ThresholdOptimizer::reset

fn ThresholdOptimizer::reset(self : ThresholdOptimizer) -> Unit

#
ThresholdOptimizer::threshold

fn ThresholdOptimizer::threshold(self : ThresholdOptimizer) -> Double

#
ThroughputTracker

pub struct ThroughputTracker {
capacity : Int
events : SequenceWindow
accepted : Int
dropped : Int
}

#
ThroughputTracker::accepted

fn ThroughputTracker::accepted(self : ThroughputTracker) -> Int

#
ThroughputTracker::dropped

fn ThroughputTracker::dropped(self : ThroughputTracker) -> Int

#
ThroughputTracker::new

fn ThroughputTracker::new(capacity? : Int) -> ThroughputTracker

#
ThroughputTracker::observe

fn ThroughputTracker::observe(self : ThroughputTracker, timestamp : Int64) -> Bool

#
ThroughputTracker::rate

fn ThroughputTracker::rate(self : ThroughputTracker, duration : Double) -> Double

#
TimeWindowAggregate

pub struct TimeWindowAggregate {
start : Int64
end : Int64
events : Int
positives : Double
weight : Double
loss : RegressionMetrics
}

#
TimeWindowAggregate::contains

fn TimeWindowAggregate::contains(self : TimeWindowAggregate, timestamp : Int64) -> Bool

#
TimeWindowAggregate::events

fn TimeWindowAggregate::events(self : TimeWindowAggregate) -> Int

#
TimeWindowAggregate::mae

fn TimeWindowAggregate::mae(self : TimeWindowAggregate) -> Double

#
TimeWindowAggregate::new

fn TimeWindowAggregate::new(start : Int64, end : Int64) -> TimeWindowAggregate

#
TimeWindowAggregate::observe

fn TimeWindowAggregate::observe(self : TimeWindowAggregate, event : TrainingEvent, prediction : Double) -> Bool

#
TimeWindowAggregate::rmse

fn TimeWindowAggregate::rmse(self : TimeWindowAggregate) -> Double

#
TimeWindowAggregate::weighted_positive_rate

fn TimeWindowAggregate::weighted_positive_rate(self : TimeWindowAggregate) -> Double

#
TopKMetrics

pub struct TopKMetrics {
total : Double
hits : Array[Double]
}

#
TopKMetrics::accuracy

fn TopKMetrics::accuracy(self : TopKMetrics, k : Int) -> Double

#
TopKMetrics::new

fn TopKMetrics::new(max_k? : Int) -> TopKMetrics

#
TopKMetrics::reset

fn TopKMetrics::reset(self : TopKMetrics) -> Unit

#
TopKMetrics::total

fn TopKMetrics::total(self : TopKMetrics) -> Double

#
TopKMetrics::update

fn TopKMetrics::update(self : TopKMetrics, ranked : Array[Int], label : Int) -> Unit

#
TrafficSplitter

pub struct TrafficSplitter {
buckets : Map[String, Double]
default_version : String
assigned : Int
}

#
TrafficSplitter::assigned

fn TrafficSplitter::assigned(self : TrafficSplitter) -> Int

#
TrafficSplitter::new

fn TrafficSplitter::new(default_version : String) -> TrafficSplitter

#
TrafficSplitter::reset

fn TrafficSplitter::reset(self : TrafficSplitter) -> Unit

#
TrafficSplitter::route

fn TrafficSplitter::route(self : TrafficSplitter, hash : Int) -> String

#
TrafficSplitter::set

fn TrafficSplitter::set(self : TrafficSplitter, version : String, share : Double) -> Unit

#
TrafficSplitter::share

fn TrafficSplitter::share(self : TrafficSplitter, version : String) -> Double

#
TrainingEvent

pub struct TrainingEvent {
id : String
timestamp : Int64
features : Array[Double]
label : Double
weight : Double
} derive(ToJson,
Debug
,
FromJson
)

Immutable training event that can be replayed for deterministic validation.

#
TrainingEvent::features

fn TrainingEvent::features(self : TrainingEvent) -> Array[Double]

#
TrainingEvent::id

fn TrainingEvent::id(self : TrainingEvent) -> String

#
TrainingEvent::label

fn TrainingEvent::label(self : TrainingEvent) -> Double

#
TrainingEvent::new

fn TrainingEvent::new(id : String, timestamp : Int64, features : Array[Double], label : Double, weight? : Double) -> TrainingEvent

#
TrainingEvent::timestamp

fn TrainingEvent::timestamp(self : TrainingEvent) -> Int64

#
TrainingEvent::weight

fn TrainingEvent::weight(self : TrainingEvent) -> Double

#
TrainingReport

pub struct TrainingReport {
samples : Int
accepted : Int
rejected : Int
total_loss : Double
final_loss : Double
elapsed_steps : Int
} derive(ToJson,
Debug
,
FromJson
)

#
TrainingReport::accepted

fn TrainingReport::accepted(self : TrainingReport) -> Int

#
TrainingReport::final_loss

fn TrainingReport::final_loss(self : TrainingReport) -> Double

#
TrainingReport::mean_loss

fn TrainingReport::mean_loss(self : TrainingReport) -> Double

#
TrainingReport::new

#
TrainingReport::record

fn TrainingReport::record(self : TrainingReport, accepted : Bool, loss : Double) -> Unit

#
TrainingReport::rejected

fn TrainingReport::rejected(self : TrainingReport) -> Int

#
TrainingReport::reset

fn TrainingReport::reset(self : TrainingReport) -> Unit

#
TrainingReport::samples

fn TrainingReport::samples(self : TrainingReport) -> Int

#
ValidationReport

pub struct ValidationReport {
valid : Bool
message : String
} derive(Eq, ToJson,
Debug
,
FromJson
)

#
ValidationReport::error

fn ValidationReport::error(message : String) -> ValidationReport

#
ValidationReport::is_valid

fn ValidationReport::is_valid(self : ValidationReport) -> Bool

#
ValidationReport::message

fn ValidationReport::message(self : ValidationReport) -> String

#
ValidationReport::ok

#
VectorMoments

pub struct VectorMoments {
moments : Array[RunningMoments]
}

Per-feature running statistics for dense streams.

#
VectorMoments::dimension

fn VectorMoments::dimension(self : VectorMoments) -> Int

#
VectorMoments::mean

fn VectorMoments::mean(self : VectorMoments) -> Array[Double]

#
VectorMoments::moment

fn VectorMoments::moment(self : VectorMoments, index : Int) -> RunningMoments?

#
VectorMoments::new

fn VectorMoments::new(dimension : Int) -> VectorMoments

#
VectorMoments::reset

fn VectorMoments::reset(self : VectorMoments) -> Unit

#
VectorMoments::standardize

fn VectorMoments::standardize(self : VectorMoments, values : Array[Double]) -> Array[Double]

#
VectorMoments::update

fn VectorMoments::update(self : VectorMoments, values : Array[Double], weight? : Double) -> Unit

#
VectorMoments::variance

fn VectorMoments::variance(self : VectorMoments) -> Array[Double]

#
WeightedHistogram

pub struct WeightedHistogram {
lower : Double
upper : Double
bins : Array[Double]
total : Double
}

#
WeightedHistogram::counts

fn WeightedHistogram::counts(self : WeightedHistogram) -> Array[Double]

#
WeightedHistogram::new

fn WeightedHistogram::new(lower? : Double, upper? : Double, bins? : Int) -> WeightedHistogram

#
WeightedHistogram::observe

fn WeightedHistogram::observe(self : WeightedHistogram, value : Double, weight? : Double) -> Unit

#
WeightedHistogram::probabilities

fn WeightedHistogram::probabilities(self : WeightedHistogram) -> Array[Double]

#
WeightedHistogram::quantile

fn WeightedHistogram::quantile(self : WeightedHistogram, probability : Double) -> Double

#
WeightedHistogram::reset

fn WeightedHistogram::reset(self : WeightedHistogram) -> Unit

#
WeightedHistogram::total

fn WeightedHistogram::total(self : WeightedHistogram) -> Double

#
WeightedProbabilityEnsemble

pub struct WeightedProbabilityEnsemble {
weights : Array[Double]
observations : Int
}

Weighted probability ensemble with online expert reweighting.

#
WeightedProbabilityEnsemble::experts

#
WeightedProbabilityEnsemble::new

#
WeightedProbabilityEnsemble::normalized_weights

fn WeightedProbabilityEnsemble::normalized_weights(self : WeightedProbabilityEnsemble) -> Array[Double]

#
WeightedProbabilityEnsemble::observations

#
WeightedProbabilityEnsemble::predict

fn WeightedProbabilityEnsemble::predict(self : WeightedProbabilityEnsemble, predictions : Array[Double]) -> Double

#
WeightedProbabilityEnsemble::reset

#
WeightedProbabilityEnsemble::update

fn WeightedProbabilityEnsemble::update(self : WeightedProbabilityEnsemble, predictions : Array[Double], label : Double, learning_rate? : Double) -> Unit

#
WeightedProbabilityEnsemble::weights

#
absolute_error

fn absolute_error(prediction : Double, label : Double) -> Double

#
add_scaled_in_place

fn add_scaled_in_place(target : Array[Double], source : Array[Double], scale : Double) -> Unit

#
add_values

fn add_values(left : Array[Double], right : Array[Double]) -> Array[Double]

#
alert_condition_catalog

fn alert_condition_catalog() -> Array[AlertCondition]

#
alert_severity_catalog

fn alert_severity_catalog() -> Array[AlertSeverity]

#
all_close

fn all_close(left : Array[Double], right : Array[Double], tolerance? : Double) -> Bool

#
append_interactions

fn append_interactions(values : Array[Double], include_diagonal? : Bool) -> Array[Double]

#
argmax

fn argmax(values : Array[Double]) -> Int?

#
attribution_sum

fn attribution_sum(attributions : Array[FeatureAttribution]) -> Double

#
audit_action_catalog

fn audit_action_catalog() -> Array[AuditAction]

#
binary_cross_entropy

fn binary_cross_entropy(probability : Double, label : Double) -> Double

#
clamp

fn clamp(value : Double, lower : Double, upper : Double) -> Double

#
clamp_probability

fn clamp_probability(value : Double) -> Double

#
copy_vector

fn copy_vector(values : Array[Double]) -> Array[Double]

#
cosine_similarity

fn cosine_similarity(left : Array[Double], right : Array[Double]) -> Double

#
cost_matrix

fn cost_matrix(costs : ClassCost) -> Array[Array[Double]]

#
cost_sensitive_decision

fn cost_sensitive_decision(probability : Double, costs : ClassCost) -> Bool

#
cross_feature

fn cross_feature(left : String, right : String, separator? : String) -> String

#
csv_escape

fn csv_escape(field : String, options? : CsvOptions) -> String

#
csv_write_row

fn csv_write_row(fields : Array[String], options? : CsvOptions) -> String

#
cumulative_sum

fn cumulative_sum(values : Array[Double]) -> Array[Double]

#
deployment_state_catalog

fn deployment_state_catalog() -> Array[DeploymentState]

#
dot_product

fn dot_product(left : Array[Double], right : Array[Double]) -> Double

#
dot_product_checked

fn dot_product_checked(left : Array[Double], right : Array[Double]) -> Double?

#
evaluate_binary

fn evaluate_binary(model : AdagradLogisticRegression, batch : DataBatch) -> OnlineEvaluationSession

#
evaluate_regression

fn evaluate_regression(model : OnlineRidgeRegression, batch : DataBatch) -> OnlineEvaluationSession

#
expected_binary_cost

fn expected_binary_cost(probability : Double, positive_cost : Double, negative_cost : Double) -> Double

#
explain_linear

fn explain_linear(weights : Array[Double], features : Array[Double], top_k? : Int) -> Array[FeatureAttribution]

#
explain_sparse

fn explain_sparse(weights : SparseVector, features : SparseVector, top_k? : Int) -> Array[FeatureAttribution]

#
generate_feature_crosses

fn generate_feature_crosses(features : Array[String], order? : Int) -> Array[String]

#
hadamard_product

fn hadamard_product(left : Array[Double], right : Array[Double]) -> Array[Double]

#
hash_feature

fn hash_feature(name : String, buckets : Int) -> Int

#
hash_feature_with_sign

fn hash_feature_with_sign(name : String, buckets : Int) -> SparseEntry

#
hinge_loss

fn hinge_loss(score : Double, label : Double) -> Double

#
is_non_decreasing

fn is_non_decreasing(values : Array[Double]) -> Bool

#
l1_norm

fn l1_norm(values : Array[Double]) -> Double

#
logit

fn logit(probability : Double) -> Double

#
logits_to_probability

fn logits_to_probability(logit : Double) -> Double

#
loss_gradient

fn loss_gradient(kind : LossKind, prediction : Double, label : Double, parameter? : Double) -> Double

#
loss_gradient_vector

fn loss_gradient_vector(kind : LossKind, predictions : Array[Double], labels : Array[Double]) -> Array[Double]

#
loss_kind_catalog

fn loss_kind_catalog() -> Array[LossKind]

#
loss_value

fn loss_value(kind : LossKind, prediction : Double, label : Double, parameter? : Double) -> Double

#
make_fold

fn make_fold(batch : DataBatch, folds : Int, index : Int) -> CrossValidationFold

#
make_snapshot

fn make_snapshot(model : String, version : String, payload : String) -> SnapshotEnvelope

#
matrix_row_sums

fn matrix_row_sums(matrix : Matrix) -> Array[Double]

#
max_abs

fn max_abs(values : Array[Double]) -> Double

#
mean_values

fn mean_values(values : Array[Double]) -> Double

#
moving_average

fn moving_average(previous : Double, value : Double, smoothing : Double) -> Double

#
normalize_l2

fn normalize_l2(values : Array[Double]) -> Array[Double]

#
one_hot

fn one_hot(index : Int, size : Int) -> Array[Double]

#
outer_product

fn outer_product(left : Array[Double], right : Array[Double]) -> Matrix

#
pairwise_interactions

fn pairwise_interactions(values : Array[Double], include_diagonal? : Bool) -> Array[Double]

#
polynomial_features

fn polynomial_features(values : Array[Double], degree : Int) -> Array[Double]

Stateless numeric feature engineering helpers.

#
probabilities_from_logits

fn probabilities_from_logits(logits : Array[Double]) -> Array[Double]

#
probability_to_logit

fn probability_to_logit(probability : Double) -> Double

#
r2_score

fn r2_score(predictions : Array[Double], labels : Array[Double]) -> Double

#
rank_one_update

fn rank_one_update(matrix : Matrix, vector : Array[Double], scale : Double) -> Unit

#
safe_threshold

fn safe_threshold(threshold : Double) -> Double

#
sample_indices

fn sample_indices(size : Int, seed? : UInt64) -> Array[Int]

#
scale_values

fn scale_values(values : Array[Double], scale : Double) -> Array[Double]

#
sigmoid

fn sigmoid(value : Double) -> Double

#
smooth_l1_loss

fn smooth_l1_loss(error : Double, beta? : Double) -> Double

#
snapshot_checksum

fn snapshot_checksum(payload : String) -> String

#
softplus

fn softplus(value : Double) -> Double

#
split_indices

fn split_indices(size : Int, train_ratio? : Double, seed? : UInt64) -> (Array[Int], Array[Int])

#
squared_error

fn squared_error(prediction : Double, label : Double) -> Double

#
squared_norm

fn squared_norm(values : Array[Double]) -> Double

#
standard_deviation

fn standard_deviation(values : Array[Double]) -> Double

#
subtract_scaled_in_place

fn subtract_scaled_in_place(target : Array[Double], source : Array[Double], scale : Double) -> Unit

#
subtract_values

fn subtract_values(left : Array[Double], right : Array[Double]) -> Array[Double]

#
sum_values

fn sum_values(values : Array[Double]) -> Double

#
threshold_is_valid

fn threshold_is_valid(threshold : Double) -> Bool

#
top_index

fn top_index(values : Array[Double], rank : Int) -> Int?

#
train_adagrad

fn train_adagrad(model : AdagradLogisticRegression, batch : DataBatch, report : TrainingReport) -> TrainingReport

Train a dense Adagrad classifier over a batch and return an auditable report. The function keeps the event loop explicit for easy replay.

#
train_ridge

fn train_ridge(model : OnlineRidgeRegression, batch : DataBatch, report : TrainingReport) -> TrainingReport

#
valid_dimension

fn valid_dimension(dim : Int) -> Bool

#
validate_dimension

fn validate_dimension(dim : Int) -> ValidationReport

#
validate_label

fn validate_label(value : Double) -> ValidationReport

#
validate_probability

fn validate_probability(value : Double) -> ValidationReport

#
validate_vector

fn validate_vector(features : Array[Double], dim : Int) -> ValidationReport

#
variance_values

fn variance_values(values : Array[Double]) -> Double

#
verify_snapshot

fn verify_snapshot(envelope : SnapshotEnvelope) -> Bool

#
weighted_loss

fn weighted_loss(kind : LossKind, predictions : Array[Double], labels : Array[Double], weights? : Array[Double]) -> Double

#
weighted_mean

fn weighted_mean(values : Array[Double], weights : Array[Double]) -> Double

#
weighted_variance

fn weighted_variance(values : Array[Double], weights : Array[Double]) -> Double