Example #1
0
        public static MultiModelPipeline Append(this MultiModelPipeline pipeline, IEstimator <ITransformer> estimator)
        {
            var sweepableEstimator = new SweepableEstimator((context, parameter) => estimator, new SearchSpace.SearchSpace());
            var multiModelPipeline = pipeline.Append(sweepableEstimator);

            return(multiModelPipeline);
        }
Example #2
0
        public static MultiModelPipeline Append(this SweepableEstimator estimator, params SweepableEstimator[] estimators)
        {
            var multiModelPipeline = new MultiModelPipeline();

            multiModelPipeline = multiModelPipeline.Append(estimator);

            return(multiModelPipeline.Append(estimators));
        }
        public void SweepableEstimatorPipeline_append_test()
        {
            var e1 = new SweepableEstimator(CodeGen.EstimatorType.Concatenate);
            var e2 = new SweepableEstimator(CodeGen.EstimatorType.ConvertType);

            var pipeline = new SweepableEstimatorPipeline();

            pipeline = pipeline.Append(e1).Append(e2);
            pipeline.ToString().Should().Be("Concatenate=>ConvertType");
            pipeline.SearchSpace.FeatureSpaceDim.Should().Be(0);
        }
        public void MultiModelPipeline_append_test()
        {
            var e1 = new SweepableEstimator(CodeGen.EstimatorType.Concatenate);
            var e2 = new SweepableEstimator(CodeGen.EstimatorType.ConvertType);
            var e3 = new SweepableEstimator(CodeGen.EstimatorType.ApplyOnnxModel);
            var e4 = new SweepableEstimator(CodeGen.EstimatorType.LightGbmBinary);

            var pipeline = new MultiModelPipeline();

            pipeline = pipeline.Append(e1, e2).AppendOrSkip(e3, e4);
            pipeline.Schema.ToString().Should().Be("(e0 + e1) * (e2 + e3 + Nil)");
            pipeline.BuildSweepableEstimatorPipeline("e0 * e2").ToString().Should().Be("Concatenate=>ApplyOnnxModel");
            pipeline.BuildSweepableEstimatorPipeline("e1 * Nil").ToString().Should().Be("ConvertType");
        }
Example #5
0
        public void MultiModelPipeline_append_pipeline_test()
        {
            var e1 = new SweepableEstimator(CodeGen.EstimatorType.Concatenate);
            var e2 = new SweepableEstimator(CodeGen.EstimatorType.ConvertType);
            var e3 = new SweepableEstimator(CodeGen.EstimatorType.ApplyOnnxModel);
            var e4 = new SweepableEstimator(CodeGen.EstimatorType.LightGbmBinary);
            var e5 = new SweepableEstimator(CodeGen.EstimatorType.FastTreeBinary);

            var pipeline1 = new MultiModelPipeline();
            var pipeline2 = new MultiModelPipeline();

            pipeline1 = pipeline1.Append(e1 + e2 * e3);
            pipeline2 = pipeline2.Append(e1 * (e3 + e4) + e5);

            pipeline1 = pipeline1.Append(pipeline2);

            pipeline1.Schema.ToString().Should().Be("(e0 + e1 * e2) * (e3 * (e4 + e5) + e6)");
        }
Example #6
0
 public static SweepableEstimatorPipeline Append(this IEstimator <ITransformer> estimator, SweepableEstimator estimator1)
 {
     return(new SweepableEstimatorPipeline().Append(estimator).Append(estimator1));
 }
Example #7
0
 public static SweepableEstimatorPipeline Append(this SweepableEstimator estimator, SweepableEstimator estimator1)
 {
     return(new SweepableEstimatorPipeline().Append(estimator).Append(estimator1));
 }