Skip to content

Commit 1673bdf

Browse files
committed
fix(model): add missing Model interface (Name, Train, Predict, Save, Load)
The registry, ensemble, cv, and tuning packages all reference model.Model but the type was never defined. This caused build failures when importing any package that transitively pulled registry or ensemble.
1 parent 766f71a commit 1673bdf

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

model/model.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package model
2+
3+
import "context"
4+
5+
// Model is the core interface for all metee model backends (LightGBM, XGBoost, etc).
6+
type Model interface {
7+
// Name returns a human-readable identifier for this model instance.
8+
Name() string
9+
10+
// Train fits the model on the given feature matrix and target vector.
11+
Train(ctx context.Context, features [][]float64, targets []float64) error
12+
13+
// Predict produces predictions for the given feature matrix.
14+
Predict(ctx context.Context, features [][]float64) ([]float64, error)
15+
16+
// Save serializes the trained model to the given path.
17+
Save(ctx context.Context, path string) error
18+
19+
// Load deserializes a model from the given path.
20+
Load(ctx context.Context, path string) error
21+
}

0 commit comments

Comments
 (0)