Exemplo n.º 1
0
 public Experiment(MLContext context, SweepablePipeline pipeline, Option option)
 {
     this.option            = option;
     this.context           = context;
     this.sweepablePipeline = pipeline;
     this.timeLeft          = option.MaximumTrainingTime;
 }
Exemplo n.º 2
0
        Append <TLastTrain>(
            this EstimatorChain <TLastTrain> estimatorChain,
            SweepableEstimatorBase transformer)
            where TLastTrain : class, ITransformer
        {
            var estimators = estimatorChain.GetType().GetField("_estimators", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(estimatorChain) as IEstimator <ITransformer>[];
            var scopes     = estimatorChain.GetType().GetField("_scopes", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(estimatorChain) as TransformerScope[];

            var singleNodeChain = new SweepablePipeline();

            for (int i = 0; i != estimators.Length; ++i)
            {
                var estimator = Util.CreateSweepableEstimator(estimators[i], scopes[i]);
                singleNodeChain.Append(estimator);
            }

            return(singleNodeChain.Append(transformer));
        }