internal EnsemblePredictor(IHostEnvironment env, PredictionKind kind, FeatureSubsetModel <TScalarPredictor>[] models, IOutputCombiner <Single> combiner, Single[] weights = null) : base(env, LoaderSignature, models, combiner, weights) { PredictionKind = kind; InputType = InitializeMappers(out _mappers); }
private protected EnsembleModelParametersBase(IHostEnvironment env, string name, FeatureSubsetModel <TOutput>[] models, IOutputCombiner <TOutput> combiner, Single[] weights) : base(env, name) { Host.Check(Utils.Size(models) > 0, "Ensemble was created with no models."); Host.Check(weights == null || weights.Length == models.Length); Models = models; Combiner = combiner; Weights = weights; }
public static SchemaBindablePipelineEnsembleBase Create(IHostEnvironment env, IPredictorModel[] predictors, IOutputCombiner combiner, string scoreColumnKind) { switch (scoreColumnKind) { case MetadataUtils.Const.ScoreColumnKind.BinaryClassification: var binaryCombiner = combiner as IBinaryOutputCombiner; if (binaryCombiner == null) { throw env.Except("Combiner type incompatible with score column kind"); } return(new ImplOneWithCalibrator(env, predictors, binaryCombiner)); case MetadataUtils.Const.ScoreColumnKind.Regression: case MetadataUtils.Const.ScoreColumnKind.AnomalyDetection: var regressionCombiner = combiner as IRegressionOutputCombiner; if (regressionCombiner == null) { throw env.Except("Combiner type incompatible with score column kind"); } return(new ImplOne(env, predictors, regressionCombiner, scoreColumnKind)); case MetadataUtils.Const.ScoreColumnKind.MultiClassClassification: var vectorCombiner = combiner as IMultiClassOutputCombiner; if (vectorCombiner == null) { throw env.Except("Combiner type incompatible with score column kind"); } return(new ImplVec(env, predictors, vectorCombiner)); default: throw env.Except("Unknown score kind"); } }
protected SchemaBindablePipelineEnsemble(IHostEnvironment env, IPredictorModel[] predictors, IOutputCombiner <T> combiner, string registrationName, string scoreColumnKind) : base(env, predictors, registrationName, scoreColumnKind) { Combiner = combiner; }
public Bound(SchemaBindablePipelineEnsemble <T> parent, RoleMappedSchema schema) : base(parent, schema) { _combiner = parent.Combiner; }
internal EnsembleDistributionPredictor(IHostEnvironment env, PredictionKind kind, FeatureSubsetModel <TDistPredictor>[] models, IOutputCombiner <Single> combiner, Single[] weights = null) : base(env, RegistrationName, models, combiner, weights) { PredictionKind = kind; _probabilityCombiner = new Median(env); InputType = InitializeMappers(out _mappers); ComputeAveragedWeights(out _averagedWeights); }