public void EvaluateClassifier( IBaseClassifier <Classifier> classifier, Runtime testing, bool crossFoldsEvaluate = true, bool runPredictions = true, string saveModelToDiskFile = null, string loadModelfromDiskFile = null, int numFolds = 10) { Console.WriteLine("EvaluateClassifier"); var start = DateTime.Now; if (classifier != null) { classifier.Build(); } if (!String.IsNullOrWhiteSpace(loadModelfromDiskFile)) { throw new NotSupportedException("loadModelfromDiskFile not supported " + "as BaseClassifier.Read returns a Classifier not a IBaseClassifier as it should"); // clas = BaseClassifier.Read(loadModelfromDiskFile); // Console.WriteLine("Loading Model From Disk Took: {0}", DateTime.Now.Subtract(start)); } else if (!String.IsNullOrWhiteSpace(saveModelToDiskFile)) { classifier.FlushToFile(saveModelToDiskFile); } if (crossFoldsEvaluate) { classifier.Runtime.EvaluateWithCrossValidation(classifier, numFolds); } if (runPredictions) { testing.GeneratePredictions(null, classifier); } Console.WriteLine("\n\nEvaluation Took: {0}", DateTime.Now.Subtract(start)); }
public ClassifierEvaluator(Runtime runtime, IBaseClassifier <Classifier> classifier) { this.runtime = runtime; this.classifier = classifier; }
public double[] GetClassifications(IBaseClassifier <Classifier> classifier) { return(this.Select(classifier.ClassifyInstance).ToArray()); }
public PmlEvaluation EvaluateWithCrossValidation(IBaseClassifier <Classifier> classifier, int numfolds = 10, bool quiet = false) { return(new ClassifierEvaluator(this, classifier). EvaluateWithCrossValidateion(numfolds, quiet)); }
public double EvaluateModelOnce(IBaseClassifier <Classifier> classifier, PmlInstance instance) { return(Impl.evaluateModelOnce(classifier.Impl, instance.Impl)); }
public double EvaluateModelOnceAndRecordPrediction(IBaseClassifier <Classifier> classifier, PmlInstance instance) { return(Impl.evaluateModelOnceAndRecordPrediction(classifier.Impl, instance.Impl)); }
public static string EvaluateModel(IBaseClassifier <Classifier> classifier, string[] options) { return(Evaluation.evaluateModel(classifier.Impl, options)); }
public double[] EvaluateModel(IBaseClassifier <Classifier> classifier, Runtime data, object[] forPredictionsPrinting) { return(Impl.evaluateModel(classifier.Impl, data.Impl, forPredictionsPrinting)); }