public SofDifferenceEvaluator(Data.Split split, int classIndex) { split.RefreshSofs(); this.Split = split; this.ClassIndex = classIndex; EvalDifference(); }
public static Data.Split SplitCloner(Data.Split source) { var target = new Data.Split(); CopyAllProperties(source, target); // rebuild new array to not share pointer on same reference if (target.Class1Cars != null) { target.Class1Cars = new List <Line>(); target.Class1Cars.AddRange(source.Class1Cars); } if (target.Class2Cars != null) { target.Class2Cars = new List <Line>(); target.Class2Cars.AddRange(source.Class2Cars); } if (target.Class3Cars != null) { target.Class3Cars = new List <Line>(); target.Class3Cars.AddRange(source.Class3Cars); } if (target.Class4Cars != null) { target.Class4Cars = new List <Line>(); target.Class4Cars.AddRange(source.Class4Cars); } // --> return(target); }
public override void Evaluate(EvaluationContext context, Models.Model model, Data.Split split) { double sum = 0; foreach (var kv in context.PredictedScores) { sum += Math.Pow(((Rating)kv.Key).Value - kv.Value, 2); } context.AddResult("rmse", "RMSE", string.Format("{0:0.0000}", Math.Sqrt(sum / context.PredictedScores.Count()))); }