Esempio n. 1
0
 public BankNotePredictor()
 {
     _metrics = MetricsInitializer.Metrics;
     this.trainTestDataRate = 0.2;
     TrainingAlgorithm      = BinaryClassificationTrainingAlgorithm.LbfgsLogisticRegression;
 }
Esempio n. 2
0
        /*
         * Setting Binary Classification Training Algorithms
         */
        public static IEstimator <ITransformer> ApplyBinaryTrainingAlgorithm(MLContext mlContext, BinaryClassificationTrainingAlgorithm trainingAlgorithm)
        {
            switch (trainingAlgorithm)
            {
            case BinaryClassificationTrainingAlgorithm.FastTree:
                return(mlContext.BinaryClassification.Trainers.FastTree());

            case BinaryClassificationTrainingAlgorithm.LbfgsLogisticRegression:
                return(mlContext.BinaryClassification.Trainers.LbfgsLogisticRegression());

            case BinaryClassificationTrainingAlgorithm.FieldAwareFactorizationMachine:
                return(mlContext.BinaryClassification.Trainers.FieldAwareFactorizationMachine());

            case BinaryClassificationTrainingAlgorithm.Gam:
                return(mlContext.BinaryClassification.Trainers.Gam());

            default:
                return(mlContext.BinaryClassification.Trainers.FastTree());
            }
        }
Esempio n. 3
0
 /*
  * Setting training algorithm
  */
 public override void SetAlgorithm(object algo)
 {
     this.TrainingAlgorithm = (BinaryClassificationTrainingAlgorithm)algo;
 }