예제 #1
0
 public static void Print(ProductEntry entry, Score prediction)
 {
     if (prediction.Value > 0)
     {
         Console.WriteLine($"\n For FromNodeId = {entry.FromNodeId} and  FromNodeId = {entry.ToNodeId} the predicted score is " + Math.Round(prediction.Value, 1));
     }
 }
예제 #2
0
        public static void PredictSamples(
            PredictionEngine <ProductEntry, Score> engine,
            IEnumerable <int> rand1,
            IEnumerable <int> rand2)
        {
            Score        score;
            ProductEntry entry;

            for (int i = 0; i < rand1.Count(); i++)
            {
                entry = new ProductEntry()
                {
                    FromNodeId = (uint)rand1.ElementAt(i),
                    ToNodeId   = (uint)rand2.ElementAt(i)
                };
                score = engine.Predict(entry);

                Print(entry, score);
            }
        }