예제 #1
0
        public void AddClassifier(Func <IDataTable, IRowClassifier> classifierProvider)
        {
            var samples        = _GetNextSamples();
            var iterationTable = _table.CopyWithRows(samples);
            var classifier     = classifierProvider(iterationTable);

            _classifier.Add(classifier);
            var correct = _table
                          .Classify(classifier)
                          .Select(r => r.Classification == r.Row.GetField <string>(_classColumnIndex))
                          .ToList()
            ;

            _AddClassifierResults(correct);
        }
 /// <summary>
 /// Classifies each row of the data table
 /// </summary>
 /// <param name="classifier"></param>
 /// <param name="dataTable"></param>
 /// <returns>A list of rows with their corresponding classifications</returns>
 public static IReadOnlyList <(IRow Row, string Classification)> Classifiy(this IRowClassifier classifier, IDataTable dataTable)
 {
     return(dataTable.Classify(classifier, percentage => Console.Write("\r({0:P}) ", percentage)));
 }