You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit edb743f
Browse filesBrowse the repository at this point in the historyBrowse files
feat: fit() accepts an optional leading model name (#23)
* feat: fit() accepts an optional leading model name
Mirror predict(model, ...) on the training side: fit('churn', f1, ..., fN,
label) registers the trained student as 'churn' and returns its id, so the
train and serve calls read in parallel with predict('churn', f1, ..., fN).
A leading argument is only a name when it is TEXT, and features are numeric,
so every existing fit(f1, ..., fN, label [, options]) call is unchanged. The
name may still be given as {"register":"churn"}; supplying it both ways is a
mistake, not a precedence to resolve, and raises PREDICT_ERR_OPTIONS. The
leading name, like the options object, must be constant within a group.
Adds adversarial tests (name-given-twice, name-with-no-features) and a parity
test that a leading-name model predicts identically to an options-register one.
Docs and CHANGELOG updated.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* refactor: make fit options-arity discount the leading name
Address review: the trailing-options detection used a raw argc >= 3, so a
JSON-object trailing argument was consumed as options with a leading name but
could land as a class label without one. Detect the leading name first and gate
options on argc - has_name >= 3, so both forms treat the trailing object the
same way. Adds a consistency test.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* docs: correct fit task default and document per-group constancy
Address review: the fit reference claimed task is "inferred from the label",
but fit defaults to classify and only regresses when task=regress is given
explicitly (a real-valued label without it is trained as classification). State
the real default. Also document that the leading name and the options object
must be constant within an aggregate group.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix: address review on the leading-name change
- Reject a model name with an embedded NUL byte (PREDICT_ERR_OPTIONS): it would
otherwise be truncated by the mprintf/strcmp path and register a different id
than the caller passed. Adds a char(97,0,98) regression test.
- Add an adversarial test that a leading name varying within an aggregate group
(a CASE over a column) fails loud, exercising the group-constancy contract.
- Correct the header comment: a trailing '{...}' is options only once a feature
and a label precede it (argc - has_name >= 3); at the lowest arity it is the
label.
- Docs: state both registration forms (leading id argument or the register
option) explicitly, and describe the label as the last argument before the
optional options.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -159,7 +159,7 @@ skills-capable agent, or read them as the condensed operator's manual.
159
159
|`forecast(ts, value, horizon [, options])`| Where is this metric going? | an aggregate over your rows: forecast steps with prediction intervals, one JSON document per group |
160
160
|`detect_anomalies(ts, value [, options])`| Which points are abnormal? | an aggregate over your rows: per-point anomaly probability and interval, one JSON document per group |
161
161
|`backtest(ts, value, horizon [, options])`| How accurate is the model here? | an aggregate over your rows: per-fold MAE, RMSE, MASE, sMAPE and coverage from rolling-origin evaluation |
162
-
|`fit(f1, ..., fN, label [, options])`| Train a model on labeled rows | an aggregate over your rows: a native tabular student, registered by id or returned as a blob |
162
+
|`fit([name,] f1, ..., fN, label [, options])`| Train a model on labeled rows | an aggregate over your rows: a native tabular student, registered under a leading id argument or a `register` option, or returned as a blob |
163
163
|`predict(model, f1, ..., fN [, options])`| Classify or regress a row | a scalar: one prediction per row from a fitted student |
164
164
|`distill_predict(train_query [, options])`| Compress a slow teacher into a fast student | a tiny native model (decision tree, gradient-boosted forest, or MLP), registered and served by `predict`|
165
165
|`distill_forecast(train_query [, options])`| Compress a forecast foundation model into a fast student | a native DLinear/TiDE forecast net (a linear skip plus a small residual), registered and served by `forecast`|
Copy file name to clipboardExpand all lines: website/src/content/docs/guides/operations.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ e.g. `'{"confidence_level":0.9}'`.
16
16
|`forecast(ts, value, horizon [, options])`| Where is this metric going? | one JSON document per group: future rows with prediction intervals and a status |
17
17
|`detect_anomalies(ts, value [, options])`| Which points are abnormal? | one JSON document per group: anomaly-scored rows with expected value and probability |
18
18
|`backtest(ts, value, horizon [, options])`| How accurate is the model here? | one JSON document per group: per-fold MAE / RMSE / MASE / sMAPE and coverage |
19
-
|`fit(f1, ..., fN, label [, options])`| Train a model on labeled rows | a registered model id, or a model blob |
19
+
|`fit([name,] f1, ..., fN, label [, options])`| Train a model on labeled rows | a registered model id, or a model blob |
20
20
|`predict(model, f1, ..., fN [, options])`| Classify or regress a row | a prediction, or a `{prediction, confidence}` document with `proba`|
21
21
|`distill_predict(train_query [, options])`| Compress a teacher into a fast student | a registered native tabular model |
22
22
|`distill_forecast(train_query [, options])`| Compress a forecast model into a student | a registered native forecast model |
0 commit comments