ML - MLModelEvaluatorBuilder
ML.MLModelEvaluatorBuilderA builder to create ML predictions made from provided features
Type parameters
Name | Type |
---|---|
Output | extends EastType |
Features | extends Record |
ML
predict
▸ predict(featureStream
):
MLExamplesEvaluatorBuilder
Predict outputs from a stream of features
Parameters
Name | Type |
---|---|
featureStream | Stream <DictType <StringType , StructType >> |
Returns
MLExamplesEvaluatorBuilder
Example
// use a DictType stream
const training_stream = Stream(
"My Training Stream",
DictType(
StringType,
StructType({
x: FloatType,
y: FloatType,
})
)
);
const prediction_stream = Stream(
"My Prediction Stream",
DictType(
StringType,
StructType({
x: FloatType,
})
)
);
// create a gradient boosted tree
const ml_model = new MLModelBuilder("ML Training")
.feature("x", FloatType)
.output(FloatType)
.model({ type: "boosted_trees", noise: "none" })
.trainFromStream({
output_name: "y",
input: training_stream,
});
// predict the model outputs from features
const ml_prediction = new MLPredictionBuilder("ML Prediction")
.model(ml_model)
.predict(prediction_stream);