COMMUNITY

Consuming Machine Learning models in Haxe?

Does anyone know or have experience consuming machine learning models in Haxe?
Ideally I would like to have the same functionality across multiple targets.

I only have some experience with MLNet before. You end up with model.zip (or can use someone else’s model file) and you consume it like so:

// C#
var mlContext = new MLContext();
DataViewSchema predictionPipelineSchema;
ITransformer predictionPipeline = mlContext.Model.Load("./mymodel.zip", out predictionPipelineSchema);
PredictionEngine<Data, OutputData> predictionEngine = mlContext.Model.CreatePredictionEngine<Data, OutputData>(predictionPipeline);

var output = predictionEngine.Predict(new Data { low = new float[] { 0.1f, 0.1f }, original = new float[] { 2f, 2f } });

Console.WriteLine("prediction: " + output.predicted + " with score: " + output.score);

Right now I am looking to use GloVe model, but it would be great to hear any shared machine learning consuming usage in Haxe.