So I have the following test 2 tests
This test keeps returning the first answer it gives and mimics the way we predict with live data.
if (_bModelPredictor is null)
_bModelPredictor = bModel.MakePredictionFunction<TestClass, Prediction>(mlContext);
if(assumption is null)
assumption = new Prediction();
_bModelPredictor.Predict(new TestClass(myMapper),ref assumption);
DoSomethingWith(assumption );
if the first score is say "XYZ" all following tests are going to give the same answer.
This setup where I test the model with new database data however works:
var result = new Prediction();
var evalution[]= Database.GetTestArray();
var predictor=bModel.MakePredictionFunction<TestClass, Prediction>(mlContext);
for (var i = 0; i < evalution.Length; i++)
{
r++;
//holds the value we think it should have (source database)
var expect = evalution[i].Prediction;
evalution[i].Trend = string.Empty;
//evaluates and puts the trend in "result"
predictor.Predict(new TestClass(evalution[i]),ref result);
score+= result.actual==expect? 1 :-1;
...
}
why is the first one returning a "cashed" answer?