296 references to CheckUserArg
Microsoft.ML.Data (88)
Commands\CrossValidationCommand.cs (1)
109Host.CheckUserArg(ImplOptions.NumFolds >= 2, nameof(ImplOptions.NumFolds), "Number of folds must be greater than or equal to 2.");
Commands\DataCommand.cs (1)
85env.CheckUserArg(!(options.Parallel < 0), nameof(options.Parallel), "Degree of parallelism must be non-negative (or null)");
Commands\SavePredictorCommand.cs (1)
63_host.CheckUserArg(!string.IsNullOrWhiteSpace(args.InputModelFile), nameof(args.InputModelFile), "Must specify input model file");
Commands\ScoreCommand.cs (2)
85Host.CheckUserArg(!string.IsNullOrWhiteSpace(ImplOptions.InputModelFile), nameof(ImplOptions.InputModelFile), "The input model file is required."); 86Host.CheckUserArg(!string.IsNullOrWhiteSpace(ImplOptions.OutputDataFile), nameof(ImplOptions.OutputDataFile), "The output data file is required.");
Commands\TestCommand.cs (1)
66Host.CheckUserArg(!string.IsNullOrEmpty(ImplOptions.InputModelFile), nameof(ImplOptions.InputModelFile), "The input model file is required.");
Commands\TrainCommand.cs (2)
449ch.CheckUserArg(Enum.IsDefined(typeof(NormalizeOption), autoNorm), nameof(TrainCommand.Arguments.NormalizeFeatures), 521ectx.CheckUserArg(!string.IsNullOrWhiteSpace(kindName.Value), nameof(TrainCommand.Arguments.CustomColumns), "Names for columns with custom kind must not be empty");
DataLoadSave\Binary\BinaryLoader.cs (1)
773_host.CheckUserArg(0 <= args.PoolBlocks, nameof(args.PoolBlocks), "must be non-negative");
DataLoadSave\Binary\BinarySaver.cs (3)
195_host.CheckUserArg(!args.MaxRowsPerBlock.HasValue || args.MaxRowsPerBlock > 0, nameof(args.MaxRowsPerBlock), "Must be positive."); 196_host.CheckUserArg(!args.MaxBytesPerBlock.HasValue || args.MaxBytesPerBlock > 0, nameof(args.MaxBytesPerBlock), "Must be positive."); 198_host.CheckUserArg(args.MaxRowsPerBlock.HasValue || args.MaxBytesPerBlock.HasValue, nameof(args.MaxBytesPerBlock),
DataLoadSave\Database\DatabaseLoader.cs (1)
499ch.CheckUserArg(Enum.IsDefined(typeof(DbType), col.Type), nameof(Column.Type), "Bad item type");
DataLoadSave\DataOperationsCatalog.cs (3)
324_env.CheckUserArg(shufflePoolSize > 0, nameof(shufflePoolSize), "Must be positive"); 355_env.CheckUserArg(count > 0, nameof(count), "Must be greater than zero."); 383_env.CheckUserArg(count > 0, nameof(count), "Must be greater than zero.");
DataLoadSave\Text\TextLoader.cs (4)
777ch.CheckUserArg(Enum.IsDefined(typeof(InternalDataKind), kind), nameof(Column.Type), "Bad item type"); 792ch.CheckUserArg(iinfoOther < 0, nameof(Range.AllOther), "At most one all other range can be specified"); 891ch.CheckUserArg(segsNew.Count > 0, nameof(Range.AllOther), "No index is selected as all other indexes."); 1271_host.CheckUserArg((_flags & OptionFlags.AllowSparse) == 0, nameof(Options.Separator),
Evaluators\AnomalyDetectionEvaluator.cs (4)
83Host.CheckUserArg(args.K > 0, nameof(args.K), "Must be positive"); 84Host.CheckUserArg(0 <= args.P && args.P <= 1, nameof(args.P), "Must be in [0,1]"); 85Host.CheckUserArg(args.NumTopResults >= 0, nameof(args.NumTopResults), "Must be non-negative"); 86Host.CheckUserArg(args.MaxAucExamples >= -1, nameof(args.MaxAucExamples), "Must be at least -1");
Evaluators\BinaryClassifierEvaluator.cs (3)
115host.CheckUserArg(args.MaxAucExamples >= -1, nameof(args.MaxAucExamples), "Must be at least -1"); 116host.CheckUserArg(args.NumRocExamples >= 0, nameof(args.NumRocExamples), "Must be non-negative"); 117host.CheckUserArg(args.NumAuPrcExamples >= 0, nameof(args.NumAuPrcExamples), "Must be non-negative");
Evaluators\MultiOutputRegressionEvaluator.cs (1)
632Host.CheckUserArg(args.LossFunction != null, nameof(args.LossFunction), "Loss function must be specified");
Evaluators\QuantileRegressionEvaluator.cs (1)
481Host.CheckUserArg(args.LossFunction != null, nameof(args.LossFunction), "Loss function must be specified.");
Evaluators\RankingEvaluator.cs (1)
79Host.CheckUserArg(options.LabelGains != null, nameof(options.LabelGains), "Label gains cannot be null");
Evaluators\RegressionEvaluator.cs (1)
354Host.CheckUserArg(args.LossFunction != null, nameof(args.LossFunction), "Loss function must be specified.");
Evaluators\RegressionEvaluatorBase.cs (1)
35Host.CheckUserArg(args.LossFunction != null, nameof(args.LossFunction), "Loss function must be specified.");
Model\Pfa\SavePfaCommand.cs (2)
82Host.CheckUserArg(Enum.IsDefined(typeof(Formatting), args.Formatting), nameof(args.Formatting), "Undefined value"); 132Host.CheckUserArg(ImplOptions.LoadPredictor != true, nameof(ImplOptions.LoadPredictor),
Prediction\Calibrator.cs (1)
2211host.CheckUserArg(input.MaxRows >= 0, nameof(input.MaxRows), "Argument must be non-negative. specify 0 to use all available examples.");
TrainCatalog.cs (1)
529Environment.CheckUserArg(topKPredictionCount >= 0, nameof(topKPredictionCount), "Must be non-negative");
Transforms\BootstrapSamplingTransformer.cs (1)
82Host.CheckUserArg(options.PoolSize >= 0, nameof(options.PoolSize), "Cannot be negative");
Transforms\NormalizeColumn.cs (3)
1130host.CheckUserArg(!string.IsNullOrWhiteSpace(args.LabelColumn), nameof(args.LabelColumn), "Must specify the label column name"); 1134host.CheckUserArg(labelKeyType.Count > 0, nameof(args.LabelColumn), "Label column must have a known cardinality"); 1136host.CheckUserArg(labelColumnType is NumberDataViewType, nameof(args.LabelColumn), "Label column must be a number or a key type");
Transforms\NormalizeColumnDbl.cs (18)
1554host.CheckUserArg(column.MaximumExampleCount > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 1604host.CheckUserArg(column.MaximumExampleCount > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 1668host.CheckUserArg(column.MaximumExampleCount > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 1676host.CheckUserArg(lim > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 1749host.CheckUserArg(column.MaximumExampleCount > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 1758host.CheckUserArg(lim > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 1871host.CheckUserArg(lim > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 1874host.CheckUserArg(numBins > 1, nameof(column.MaximumBinCount), "Must be greater than 1"); 1920host.CheckUserArg(lim > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 1923host.CheckUserArg(numBins > 1, nameof(column.MaximumBinCount), "Must be greater than 1"); 2003host.CheckUserArg(lim > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 2006host.CheckUserArg(numBins > 1, nameof(column.MaximumBinCount), "Must be greater than 1"); 2007host.CheckUserArg(column.MininimumBinSize > 0, nameof(column.MininimumBinSize), "Must be positive"); 2043host.CheckUserArg(lim > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 2046host.CheckUserArg(numBins > 1, nameof(column.MaximumBinCount), "Must be greater than 1"); 2047host.CheckUserArg(column.MininimumBinSize > 0, nameof(column.MininimumBinSize), "Must be positive"); 2087host.CheckUserArg(column.MaximumExampleCount > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 2156host.CheckUserArg(column.MaximumExampleCount > 1, nameof(column.MaximumExampleCount), "Must be greater than 1");
Transforms\NormalizeColumnSng.cs (18)
1717host.CheckUserArg(column.MaximumExampleCount > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 1767host.CheckUserArg(column.MaximumExampleCount > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 1831host.CheckUserArg(column.MaximumExampleCount > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 1839host.CheckUserArg(lim > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 1912host.CheckUserArg(column.MaximumExampleCount > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 1921host.CheckUserArg(lim > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 2034host.CheckUserArg(lim > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 2037host.CheckUserArg(numBins > 1, nameof(column.MaximumBinCount), "Must be greater than 1"); 2083host.CheckUserArg(lim > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 2086host.CheckUserArg(numBins > 1, nameof(column.MaximumBinCount), "Must be greater than 1"); 2167host.CheckUserArg(lim > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 2170host.CheckUserArg(numBins > 1, nameof(column.MaximumBinCount), "Must be greater than 1"); 2171host.CheckUserArg(column.MininimumBinSize > 0, nameof(column.MininimumBinSize), "Must be positive"); 2207host.CheckUserArg(lim > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 2210host.CheckUserArg(numBins > 1, nameof(column.MaximumBinCount), "Must be greater than 1"); 2211host.CheckUserArg(column.MininimumBinSize > 0, nameof(column.MininimumBinSize), "Must be positive"); 2251host.CheckUserArg(column.MaximumExampleCount > 1, nameof(column.MaximumExampleCount), "Must be greater than 1"); 2318host.CheckUserArg(column.MaximumExampleCount > 1, nameof(column.MaximumExampleCount), "Must be greater than 1");
Transforms\RowShufflingTransformer.cs (2)
115Host.CheckUserArg(options.PoolRows > 0, nameof(options.PoolRows), "pool size must be positive"); 120Host.CheckUserArg(!(_poolOnly && _forceShuffleSource),
Transforms\SkipTakeFilter.cs (4)
129env.CheckUserArg(skip >= 0, nameof(options.Skip), "should be non-negative"); 130env.CheckUserArg(take >= 0, nameof(options.Take), "should be non-negative"); 138env.CheckUserArg(options.Count >= 0, nameof(options.Count), "should be non-negative"); 146env.CheckUserArg(options.Count >= 0, nameof(options.Count), "should be non-negative");
Transforms\SlotsDroppingTransformer.cs (2)
279Host.CheckUserArg(AreRangesValid(SlotsMin, SlotsMax), nameof(columns), "The range min and max must be non-negative and min must be less than or equal to max."); 358Host.CheckUserArg(range.IsValid(), nameof(col.Slots), "The range min and max must be non-negative and min must be less than or equal to max.");
Transforms\TrainAndScoreTransformer.cs (1)
81env.CheckUserArg(!string.IsNullOrWhiteSpace(args.InputModelFile), nameof(args.InputModelFile), "The input model file is required.");
Transforms\TransformBase.cs (1)
342host.CheckUserArg(item.TrySanitize(), nameof(OneToOneColumn.Name), "Invalid new column name");
Transforms\ValueToKeyMappingTransformer.cs (2)
418ch.CheckUserArg(!string.IsNullOrWhiteSpace(src), nameof(termsColumn), 572ch.CheckUserArg(lims[iinfo] > 0, nameof(Column.MaxNumTerms), "Must be positive");
Microsoft.ML.Ensemble (8)
EntryPoints\PipelineEnsemble.cs (1)
45host.CheckUserArg(ensemble != null, nameof(input.PredictorModel.Predictor), "Predictor is not a pipeline ensemble predictor");
OutputCombiners\BaseStacking.cs (1)
40Host.CheckUserArg(0 <= args.ValidationDatasetProportion && args.ValidationDatasetProportion < 1,
Selector\SubModelSelector\BestPerformanceRegressionSelector.cs (1)
41Host.CheckUserArg(Enum.IsDefined(typeof(RegressionEvaluator.Metrics), args.MetricName), nameof(args.MetricName), "Undefined metric name");
Selector\SubModelSelector\BestPerformanceSelector.cs (1)
40Host.CheckUserArg(Enum.IsDefined(typeof(BinaryClassifierEvaluator.Metrics), args.MetricName),
Selector\SubModelSelector\BestPerformanceSelectorMulticlass.cs (1)
40Host.CheckUserArg(Enum.IsDefined(typeof(MulticlassClassificationEvaluator.Metrics), args.MetricName),
Trainer\EnsembleTrainerBase.cs (3)
85ch.CheckUserArg(Utils.Size(predictorFactories) > 0, nameof(EnsembleTrainer.Arguments.BasePredictors), "This should have at-least one value"); 90ch.CheckUserArg(NumModels > 0, nameof(Args.NumModels), "Must be positive, or null to indicate numModels is the number of base predictors"); 130ch.CheckUserArg(stackingTrainer == null || Args.BatchSize <= 0, nameof(Args.BatchSize), "Stacking works only with Non-batch mode");
Microsoft.ML.EntryPoints (7)
JsonUtils\ExecuteGraphCommand.cs (7)
45_host.CheckUserArg(args.GraphPath != null && File.Exists(args.GraphPath), nameof(args.GraphPath), "Graph path does not exist"); 102_host.CheckUserArg(runner != null, nameof(runner), "Provide a GraphRunner instance."); 103_host.CheckUserArg(!string.IsNullOrWhiteSpace(varName), nameof(varName), "Specify a graph variable name."); 104_host.CheckUserArg(!string.IsNullOrWhiteSpace(path), nameof(path), "Specify a valid file path."); 135_host.CheckUserArg(runner != null, nameof(runner), "Provide a GraphRunner instance."); 136_host.CheckUserArg(!string.IsNullOrWhiteSpace(varName), nameof(varName), "Specify a graph variable name."); 137_host.CheckUserArg(!string.IsNullOrWhiteSpace(path), nameof(path), "Specify a valid file path.");
Microsoft.ML.FastTree (48)
FastTreeArguments.cs (31)
314ectx.CheckUserArg(SortingAlgorithm == "DescendingStable" 324ectx.CheckUserArg(0 < NdcgTruncationLevel, nameof(NdcgTruncationLevel), "must be positive."); 620ectx.CheckUserArg(NumberOfThreads == null || NumberOfThreads > 0, nameof(NumberOfThreads), "Must be positive."); 621ectx.CheckUserArg(NumberOfLeaves >= 2, nameof(NumberOfLeaves), "Must be at least 2."); 622ectx.CheckUserArg(0 <= EntropyCoefficient && EntropyCoefficient <= 1, nameof(EntropyCoefficient), "Must be between 0 and 1."); 623ectx.CheckUserArg(0 <= GainConfidenceLevel && GainConfidenceLevel < 1, nameof(GainConfidenceLevel), "Must be in [0, 1)."); 624ectx.CheckUserArg(0 <= FeatureFraction && FeatureFraction <= 1, nameof(FeatureFraction), "Must be between 0 and 1."); 625ectx.CheckUserArg(0 <= FeatureFractionPerSplit && FeatureFractionPerSplit <= 1, nameof(FeatureFractionPerSplit), "Must be between 0 and 1."); 626ectx.CheckUserArg(0 <= SoftmaxTemperature, nameof(SoftmaxTemperature), "Must be non-negative."); 627ectx.CheckUserArg(0 < MaximumBinCountPerFeature, nameof(MaximumBinCountPerFeature), "Must greater than 0."); 628ectx.CheckUserArg(0 <= SparsifyThreshold && SparsifyThreshold <= 1, nameof(SparsifyThreshold), "Must be between 0 and 1."); 629ectx.CheckUserArg(0 < NumberOfTrees, nameof(NumberOfTrees), "Must be positive."); 630ectx.CheckUserArg(0 <= Smoothing && Smoothing <= 1, nameof(Smoothing), "Must be between 0 and 1."); 631ectx.CheckUserArg(0 <= BaggingSize, nameof(BaggingSize), "Must be non-negative."); 632ectx.CheckUserArg(0 <= BaggingExampleFraction && BaggingExampleFraction <= 1, nameof(BaggingExampleFraction), "Must be between 0 and 1."); 633ectx.CheckUserArg(0 <= FeatureFirstUsePenalty, nameof(FeatureFirstUsePenalty), "Must be non-negative."); 634ectx.CheckUserArg(0 <= FeatureReusePenalty, nameof(FeatureReusePenalty), "Must be non-negative."); 635ectx.CheckUserArg(0 <= MaximumCategoricalGroupCountPerNode, nameof(MaximumCategoricalGroupCountPerNode), "Must be non-negative."); 636ectx.CheckUserArg(0 <= MaximumCategoricalSplitPointCount, nameof(MaximumCategoricalSplitPointCount), "Must be non-negative."); 637ectx.CheckUserArg(0 <= MinimumExampleFractionForCategoricalSplit, nameof(MinimumExampleFractionForCategoricalSplit), "Must be non-negative."); 638ectx.CheckUserArg(0 <= MinimumExamplesForCategoricalSplit, nameof(MinimumExamplesForCategoricalSplit), "Must be non-negative."); 639ectx.CheckUserArg(Bundle.None <= Bundling && Bundling <= Bundle.Adjacent, nameof(Bundling), "Must be between 0 and 2."); 640ectx.CheckUserArg(Bias >= 0, nameof(Bias), "Must be greater than equal to zero."); 865ectx.CheckUserArg(0 <= MaximumTreeOutput, nameof(MaximumTreeOutput), "Must be non-negative."); 866ectx.CheckUserArg(0 <= PruningThreshold, nameof(PruningThreshold), "Must be non-negative."); 867ectx.CheckUserArg(0 < PruningWindowSize, nameof(PruningWindowSize), "Must be positive."); 868ectx.CheckUserArg(0 < Shrinkage, nameof(Shrinkage), "Must be positive."); 869ectx.CheckUserArg(0 <= DropoutRate && DropoutRate <= 1, nameof(DropoutRate), "Must be between 0 and 1."); 870ectx.CheckUserArg(0 < GetDerivativesSampleRate, nameof(GetDerivativesSampleRate), "Must be positive."); 871ectx.CheckUserArg(0 <= MaximumNumberOfLineSearchSteps, nameof(MaximumNumberOfLineSearchSteps), "Must be non-negative."); 872ectx.CheckUserArg(0 <= MinimumStepSize, nameof(MinimumStepSize), "Must be non-negative.");
FastTreeRanking.cs (1)
189ch.CheckUserArg(FastTreeTrainerOptions.EarlyStoppingMetrics == 1 || FastTreeTrainerOptions.EarlyStoppingMetrics == 3,
FastTreeRegression.cs (1)
137ch.CheckUserArg(FastTreeTrainerOptions.EarlyStoppingMetrics >= 1 && FastTreeTrainerOptions.EarlyStoppingMetrics <= 2,
FastTreeTweedie.cs (2)
154ch.CheckUserArg(FastTreeTrainerOptions.EarlyStoppingMetrics == 1 || FastTreeTrainerOptions.EarlyStoppingMetrics == 2, 207Host.CheckUserArg(1 <= FastTreeTrainerOptions.Index && FastTreeTrainerOptions.Index <= 2, nameof(FastTreeTrainerOptions.Index), "Must be in the range [1, 2]");
GamModelParameters.cs (1)
890ch.CheckUserArg(pred != null, nameof(ImplOptions.InputModelFile), "Predictor was not a " + nameof(GamModelParametersBase));
SumupPerformanceCommand.cs (7)
84env.CheckUserArg(!args.Parallel.HasValue || args.Parallel > 0, nameof(args.Parallel), "If defined must be positive"); 89_host.CheckUserArg(Enum.IsDefined(typeof(IntArrayType), args.Type) && args.Type != IntArrayType.Current, nameof(args.Type), "Value not defined"); 90_host.CheckUserArg(args.Length >= 0, nameof(args.Length), "Must be non-negative"); 91_host.CheckUserArg(args.Count >= 0, nameof(args.Count), "Must be non-negative"); 92_host.CheckUserArg(args.Bins > 0, nameof(args.Bins), "Must be positive"); 93_host.CheckUserArg(args.Seconds > 0, nameof(args.Seconds), "Must be positive"); 112ch.CheckUserArg(0 <= _param && _param < 1, nameof(Arguments.Parameter), "For sparse arrays");
TreeEnsembleFeaturizer.cs (5)
619host.CheckUserArg(!string.IsNullOrWhiteSpace(args.TrainedModelFile) || args.Trainer != null, nameof(args.TrainedModelFile), 621host.CheckUserArg(!string.IsNullOrEmpty(args.FeatureColumn), nameof(args.FeatureColumn), "Transform needs an input features column"); 654ch.CheckUserArg(vm != null, nameof(args.TrainedModelFile), "Predictor in model file does not have compatible type"); 700host.CheckUserArg(args.PredictorModel != null, nameof(args.PredictorModel), "Please specify a predictor model."); 725ch.CheckUserArg(vm != null, nameof(args.PredictorModel), "Predictor does not have compatible type");
Microsoft.ML.KMeansClustering (8)
KMeansPlusPlusTrainer.cs (8)
174Host.CheckUserArg(options.NumberOfClusters > 0, nameof(options.NumberOfClusters), "Must be positive"); 180Host.CheckUserArg(options.MaximumNumberOfIterations > 0, nameof(options.MaximumNumberOfIterations), "Must be positive"); 183Host.CheckUserArg(options.OptimizationTolerance > 0, nameof(options.OptimizationTolerance), "Tolerance must be positive"); 186Host.CheckUserArg(options.AccelerationMemoryBudgetMb > 0, nameof(options.AccelerationMemoryBudgetMb), "Must be positive"); 191Host.CheckUserArg(!options.NumberOfThreads.HasValue || options.NumberOfThreads > 0, nameof(options.NumberOfThreads), 793ch.CheckUserArg(numThreads > 0, nameof(KMeansTrainer.Options.NumberOfThreads), "Must be positive"); 794ch.CheckUserArg(k > 0, nameof(KMeansTrainer.Options.NumberOfClusters), "Must be positive"); 796ch.CheckUserArg(accelMemBudgetMb >= 0, nameof(KMeansTrainer.Options.AccelerationMemoryBudgetMb), "Must be non-negative");
Microsoft.ML.Mkl.Components (6)
OlsLinearRegression.cs (1)
125Host.CheckUserArg(options.L2Regularization >= 0, nameof(options.L2Regularization), "L2 regularization term cannot be negative");
SymSgdClassificationTrainer.cs (5)
153ectx.CheckUserArg(LearningRate == null || LearningRate.Value > 0, nameof(LearningRate), "Must be positive."); 154ectx.CheckUserArg(NumberOfIterations > 0, nameof(NumberOfIterations), "Must be positive."); 155ectx.CheckUserArg(PositiveInstanceWeight > 0, nameof(PositiveInstanceWeight), "Must be positive"); 156ectx.CheckUserArg(UpdateFrequency == null || UpdateFrequency > 0, nameof(UpdateFrequency), "Must be positive"); 707ch.CheckUserArg(numThreads > 0, nameof(_options.NumberOfThreads),
Microsoft.ML.OnnxConverter (1)
SaveOnnxCommand.cs (1)
305Host.CheckUserArg(ImplOptions.LoadPredictor != true, nameof(ImplOptions.LoadPredictor),
Microsoft.ML.Parquet (1)
PartitionedFileLoader.cs (1)
183_host.CheckUserArg(_pathParser != null, nameof(args.PathParserFactory), "Failed to create the FilePathSpec.");
Microsoft.ML.PCA (2)
PcaTrainer.cs (2)
181Host.CheckUserArg(_rank > 0, nameof(_rank), "Rank must be positive"); 182Host.CheckUserArg(_oversampling >= 0, nameof(_oversampling), "Oversampling must be non-negative");
Microsoft.ML.Recommender (6)
MatrixFactorizationTrainer.cs (6)
352_host.CheckUserArg(options.ApproximationRank > 0, nameof(options.ApproximationRank), posError); 353_host.CheckUserArg(!options.NumberOfThreads.HasValue || options.NumberOfThreads > 0, nameof(options.NumberOfThreads), posError); 354_host.CheckUserArg(options.NumberOfIterations > 0, nameof(options.NumberOfIterations), posError); 355_host.CheckUserArg(options.Lambda > 0, nameof(options.Lambda), posError); 356_host.CheckUserArg(options.LearningRate > 0, nameof(options.LearningRate), posError); 357_host.CheckUserArg(options.Alpha > 0, nameof(options.Alpha), posError);
Microsoft.ML.StandardTrainers (29)
FactorizationMachine\FactorizationMachineTrainer.cs (5)
280_host.CheckUserArg(options.LatentDimension > 0, nameof(options.LatentDimension), "Must be positive"); 281_host.CheckUserArg(options.LambdaLinear >= 0, nameof(options.LambdaLinear), "Must be non-negative"); 282_host.CheckUserArg(options.LambdaLatent >= 0, nameof(options.LambdaLatent), "Must be non-negative"); 283_host.CheckUserArg(options.LearningRate > 0, nameof(options.LearningRate), "Must be positive"); 284_host.CheckUserArg(options.NumberOfIterations >= 0, nameof(options.NumberOfIterations), "Must be non-negative");
LdSvm\LdSvmTrainer.cs (5)
473ectx.CheckUserArg(options.TreeDepth >= 0, nameof(options.TreeDepth), "Tree depth can not be negative."); 474ectx.CheckUserArg(options.TreeDepth <= 24, nameof(options.TreeDepth), "Try running with a tree of smaller depth first and cross validate over other parameters."); 475ectx.CheckUserArg(options.LambdaW > 0, nameof(options.LambdaW), "Regularizer for W must be positive and non-zero."); 476ectx.CheckUserArg(options.LambdaTheta > 0, nameof(options.LambdaTheta), "Regularizer for Theta must be positive and non-zero."); 477ectx.CheckUserArg(options.LambdaThetaprime > 0, nameof(options.LambdaThetaprime), "Regularizer for Thetaprime must be positive and non-zero.");
Standard\LogisticRegression\LbfgsPredictorBase.cs (8)
244Host.CheckUserArg(!LbfgsTrainerOptions.UseThreads || LbfgsTrainerOptions.NumberOfThreads > 0 || LbfgsTrainerOptions.NumberOfThreads == null, 246Host.CheckUserArg(LbfgsTrainerOptions.L2Regularization >= 0, nameof(LbfgsTrainerOptions.L2Regularization), "Must be non-negative"); 247Host.CheckUserArg(LbfgsTrainerOptions.L1Regularization >= 0, nameof(LbfgsTrainerOptions.L1Regularization), "Must be non-negative"); 248Host.CheckUserArg(LbfgsTrainerOptions.OptimizationTolerance > 0, nameof(LbfgsTrainerOptions.OptimizationTolerance), "Must be positive"); 249Host.CheckUserArg(LbfgsTrainerOptions.HistorySize > 0, nameof(LbfgsTrainerOptions.HistorySize), "Must be positive"); 250Host.CheckUserArg(LbfgsTrainerOptions.MaximumNumberOfIterations > 0, nameof(LbfgsTrainerOptions.MaximumNumberOfIterations), "Must be positive"); 251Host.CheckUserArg(LbfgsTrainerOptions.StochasticGradientDescentInitilaizationTolerance >= 0, nameof(LbfgsTrainerOptions.StochasticGradientDescentInitilaizationTolerance), "Must be non-negative"); 252Host.CheckUserArg(LbfgsTrainerOptions.NumberOfThreads == null || LbfgsTrainerOptions.NumberOfThreads.Value >= 0, nameof(LbfgsTrainerOptions.NumberOfThreads), "Must be non-negative");
Standard\SdcaBinary.cs (11)
243env.CheckUserArg(L2Regularization == null || L2Regularization >= 0, nameof(L2Regularization), "L2 constant must be non-negative."); 244env.CheckUserArg(L1Regularization == null || L1Regularization >= 0, nameof(L1Regularization), "L1 threshold must be non-negative."); 245env.CheckUserArg(MaximumNumberOfIterations == null || MaximumNumberOfIterations > 0, nameof(MaximumNumberOfIterations), "Max number of iterations must be positive."); 246env.CheckUserArg(ConvergenceTolerance > 0 && ConvergenceTolerance <= 1, nameof(ConvergenceTolerance), "Convergence tolerance must be positive and no larger than 1."); 339Host.CheckUserArg(numThreads > 0, nameof(OptionsBase.NumberOfThreads), "The number of threads must be either null or a positive integer."); 1478env.CheckUserArg(PositiveInstanceWeight > 0, nameof(PositiveInstanceWeight), "Weight for positive instances must be positive"); 1918env.CheckUserArg(L2Regularization >= 0, nameof(L2Regularization), "Must be non-negative."); 1919env.CheckUserArg(LearningRate > 0, nameof(LearningRate), "Must be positive."); 1920env.CheckUserArg(NumberOfIterations > 0, nameof(NumberOfIterations), "Must be positive."); 1921env.CheckUserArg(PositiveInstanceWeight > 0, nameof(PositiveInstanceWeight), "Must be positive"); 2038ch.CheckUserArg(numThreads > 0, nameof(_options.NumberOfThreads), "The number of threads must be either null or a positive integer.");
Microsoft.ML.Sweeper (32)
Algorithms\KdoSweeper.cs (6)
93_host.CheckUserArg(options.NumberInitialPopulation > 1, nameof(options.NumberInitialPopulation), "Must be greater than 1"); 94_host.CheckUserArg(options.HistoryLength > 1, nameof(options.HistoryLength), "Must be greater than 1"); 95_host.CheckUserArg(options.MinimumMutationSpread >= 0, nameof(options.MinimumMutationSpread), "Must be nonnegative"); 96_host.CheckUserArg(0 <= options.ProportionRandom && options.ProportionRandom <= 1, nameof(options.ProportionRandom), "Must be in [0, 1]"); 97_host.CheckUserArg(options.WeightRescalingPower >= 1, nameof(options.WeightRescalingPower), "Must be greater or equal to 1"); 100_host.CheckUserArg(Utils.Size(options.SweptParameters) > 0, nameof(options.SweptParameters), "KDO sweeper needs at least one parameter to sweep over");
Algorithms\NelderMead.cs (8)
90env.CheckUserArg(-1 < options.DeltaInsideContraction, nameof(options.DeltaInsideContraction), "Must be greater than -1"); 91env.CheckUserArg(options.DeltaInsideContraction < 0, nameof(options.DeltaInsideContraction), "Must be less than 0"); 92env.CheckUserArg(0 < options.DeltaOutsideContraction, nameof(options.DeltaOutsideContraction), "Must be greater than 0"); 93env.CheckUserArg(options.DeltaReflection > options.DeltaOutsideContraction, nameof(options.DeltaReflection), "Must be greater than " + nameof(options.DeltaOutsideContraction)); 94env.CheckUserArg(options.DeltaExpansion > options.DeltaReflection, nameof(options.DeltaExpansion), "Must be greater than " + nameof(options.DeltaReflection)); 95env.CheckUserArg(0 < options.GammaShrink && options.GammaShrink < 1, nameof(options.GammaShrink), "Must be between 0 and 1"); 111env.CheckUserArg(parameterNumeric != null, nameof(options.SweptParameters), "Nelder-Mead sweeper can only sweep over numeric parameters"); 117env.CheckUserArg(_dim > 1, nameof(options.SweptParameters), "Nelder-Mead sweeper needs at least two parameters to sweep over.");
Algorithms\SmacSweeper.cs (8)
73_host.CheckUserArg(options.NumOfTrees > 0, nameof(options.NumOfTrees), "parameter must be greater than 0"); 74_host.CheckUserArg(options.NMinForSplit > 1, nameof(options.NMinForSplit), "parameter must be greater than 1"); 75_host.CheckUserArg(options.SplitRatio > 0 && options.SplitRatio <= 1, nameof(options.SplitRatio), "parameter must be in range (0,1]."); 76_host.CheckUserArg(options.NumberInitialPopulation > 1, nameof(options.NumberInitialPopulation), "parameter must be greater than 1"); 77_host.CheckUserArg(options.LocalSearchParentCount > 0, nameof(options.LocalSearchParentCount), "parameter must be greater than 0"); 78_host.CheckUserArg(options.NumRandomEISearchConfigurations > 0, nameof(options.NumRandomEISearchConfigurations), "parameter must be greater than 0"); 79_host.CheckUserArg(options.NumNeighborsForNumericalParams > 0, nameof(options.NumNeighborsForNumericalParams), "parameter must be greater than 0"); 82_host.CheckUserArg(Utils.Size(options.SweptParameters) > 0, nameof(options.SweptParameters), "SMAC sweeper needs at least one parameter to sweep over");
AsyncSweeper.cs (4)
197_host.CheckUserArg(options.BatchSize > 0, nameof(options.BatchSize), "Batch size must be positive"); 198_host.CheckUserArg(options.Relaxation >= 0, nameof(options.Relaxation), "Synchronization relaxation must be non-negative"); 199_host.CheckUserArg(options.Relaxation <= options.BatchSize, nameof(options.Relaxation), 203_host.CheckUserArg(!(_baseSweeper is NelderMeadSweeper) || options.Relaxation == 0, nameof(options.Relaxation),
ConfigRunner.cs (2)
70Host.CheckUserArg(!string.IsNullOrEmpty(options.OptionsPattern), nameof(options.OptionsPattern), "The command pattern is missing"); 71Host.CheckUserArg(!string.IsNullOrEmpty(options.OutputFolderName), nameof(options.OutputFolderName), "Please specify an output folder");
SweepCommand.cs (3)
69_host.CheckUserArg(args.SweepNumBatches > 0, nameof(args.SweepNumBatches), "Must be positive"); 70_host.CheckUserArg(!(args.InitialSweepBatchSize <= 0), nameof(args.InitialSweepBatchSize), "Must be positive if specified"); 71_host.CheckUserArg(args.SweepBatchSize > 0, nameof(args.SweepBatchSize), "Must be positive");
SynthConfigRunner.cs (1)
36Host.CheckUserArg(options.NumThreads == null || options.NumThreads.Value > 0, nameof(options.NumThreads), "Must be positive");
Microsoft.ML.TimeSeries (38)
ExponentialAverageTransform.cs (1)
63Host.CheckUserArg(0 <= args.Decay && args.Decay <= 1, nameof(args.Decay), "Should be in [0, 1].");
ExtensionsCatalog.cs (4)
373host.CheckUserArg(beta >= 0 && beta <= 1, nameof(beta), "Must be in [0,1]"); 374host.CheckUserArg(rootCauseThreshold >= 0 && rootCauseThreshold <= 1, nameof(rootCauseThreshold), "Must be in [0,1]"); 429host.CheckUserArg(src.Slices.Count >= 1, nameof(src.Slices), "Must has more than one item"); 439host.CheckUserArg(containsAnomalyTimestamp, nameof(src.Slices), "Has no points in the given anomaly timestamp");
MovingAverageTransform.cs (3)
71Host.CheckUserArg(args.WindowSize >= 1, nameof(args.WindowSize), "Should be at least 1."); 72Host.CheckUserArg(args.Lag >= 0, nameof(args.Lag), "Should be positive."); 73Host.CheckUserArg(args.Lag != 0 || args.WindowSize > 1, nameof(args.Lag),
PercentileThresholdTransform.cs (2)
70Host.CheckUserArg(args.WindowSize >= 1, nameof(args.WindowSize), "The size of the sliding window should be at least 1."); 71Host.CheckUserArg(MinPercentile <= args.Percentile && args.Percentile <= MaxPercentile, nameof(args.Percentile), "The percentile value should be in [0, 100].");
PValueTransform.cs (1)
75Host.CheckUserArg(args.WindowSize >= 1, nameof(args.WindowSize), "The size of the sliding window should be at least 1.");
SequentialAnomalyDetectionTransformBase.cs (8)
173Host.CheckUserArg(Enum.IsDefined(typeof(MartingaleType), martingale), nameof(ArgumentsBase.Martingale), "Value is undefined."); 174Host.CheckUserArg(Enum.IsDefined(typeof(AnomalySide), anomalySide), nameof(ArgumentsBase.Side), "Value is undefined."); 175Host.CheckUserArg(Enum.IsDefined(typeof(AlertingScore), alertingScore), nameof(ArgumentsBase.AlertOn), "Value is undefined."); 176Host.CheckUserArg(martingale != MartingaleType.None || alertingScore != AlertingScore.MartingaleScore, nameof(ArgumentsBase.Martingale), "A martingale type should be specified if alerting is based on the martingale score."); 177Host.CheckUserArg(windowSize > 0 || alertingScore == AlertingScore.RawScore, nameof(ArgumentsBase.AlertOn), 180Host.CheckUserArg(0 < powerMartingaleEpsilon && powerMartingaleEpsilon < 1, nameof(ArgumentsBase.PowerMartingaleEpsilon), "Should be in (0,1)."); 181Host.CheckUserArg(alertThreshold >= 0, nameof(ArgumentsBase.AlertThreshold), "Must be non-negative."); 182Host.CheckUserArg(alertingScore != AlertingScore.PValueScore || (0 <= alertThreshold && alertThreshold <= 1), nameof(ArgumentsBase.AlertThreshold), "Must be in [0,1].");
SlidingWindowTransformBase.cs (3)
66Host.CheckUserArg(args.WindowSize >= 1, nameof(args.WindowSize), "Must be at least 1."); 67Host.CheckUserArg(args.Lag >= 0, nameof(args.Lag), "Must be positive."); 74Host.CheckUserArg(Enum.IsDefined(typeof(BeginOptions), args.Begin), nameof(args.Begin), "Undefined value.");
SrCnnEntireAnomalyDetector.cs (7)
205Host.CheckUserArg(options.Period >= 0, nameof(options.Period), "Must be an integer equal to or greater than 0."); 207Host.CheckUserArg(options.BatchSize == -1 || options.BatchSize >= MinBatchSize, nameof(options.BatchSize), "Must be -1 or no less than 12."); 208Host.CheckUserArg(options.BatchSize >= 4 * options.Period || options.BatchSize == -1 || options.Period == 0, nameof(options.BatchSize), "Must be at least four times the length of one period."); 210Host.CheckUserArg(options.Threshold >= 0 && options.Threshold <= 1, nameof(options.Threshold), "Must be in [0,1]."); 211Host.CheckUserArg(options.DetectMode == SrCnnDetectMode.AnomalyOnly 215Host.CheckUserArg(options.DeseasonalityMode == SrCnnDeseasonalityMode.Stl 219Host.CheckUserArg(options.Sensitivity >= 0 && options.Sensitivity <= 100, nameof(options.Sensitivity), "Must be in [0,100].");
SrCnnTransformBase.cs (5)
73Host.CheckUserArg(backAddWindowSize > 0, nameof(SrCnnArgumentBase.BackAddWindowSize), "Must be non-negative"); 74Host.CheckUserArg(lookaheadWindowSize > 0 && lookaheadWindowSize <= windowSize, nameof(SrCnnArgumentBase.LookaheadWindowSize), "Must be non-negative and not larger than window size"); 75Host.CheckUserArg(averagingWindowSize > 0 && averagingWindowSize <= windowSize, nameof(SrCnnArgumentBase.AvergingWindowSize), "Must be non-negative and not larger than window size"); 76Host.CheckUserArg(judgementWindowSize > 0 && judgementWindowSize <= windowSize, nameof(SrCnnArgumentBase.JudgementWindowSize), "Must be non-negative and not larger than window size"); 77Host.CheckUserArg(alertThreshold > 0 && alertThreshold < 1, nameof(SrCnnArgumentBase.Threshold), "Must be in (0,1)");
SsaAnomalyDetectionBase.cs (3)
194Host.CheckUserArg(2 <= options.SeasonalWindowSize, nameof(options.SeasonalWindowSize), "Must be at least 2."); 195Host.CheckUserArg(0 <= options.DiscountFactor && options.DiscountFactor <= 1, nameof(options.DiscountFactor), "Must be in the range [0, 1]."); 196Host.CheckUserArg(Enum.IsDefined(typeof(ErrorFunction), options.ErrorFunction), nameof(options.ErrorFunction), ErrorFunctionUtils.ErrorFunctionHelpText);
SsaForecastingBase.cs (1)
133Host.CheckUserArg(0 <= options.DiscountFactor && options.DiscountFactor <= 1, nameof(options.DiscountFactor), "Must be in the range [0, 1].");
Microsoft.ML.Transforms (22)
Dracula\CountTableTransformer.cs (2)
305_host.CheckUserArg(labelCardinality > 1, nameof(_labelColumnName), "Label column type must have known cardinality more than 1"); 501env.CheckUserArg(c.CountTable == null, nameof(c.CountTable), "Can't have non-default count tables if the tables are shared");
Dracula\CountTargetEncodingTransformer.cs (2)
170_host.CheckUserArg(Utils.Size(options.Columns) > 0, nameof(options.Columns), "Columns must be specified"); 171_host.CheckUserArg(!string.IsNullOrWhiteSpace(options.LabelColumn), nameof(options.LabelColumn), "Must specify the label column name");
GroupTransform.cs (1)
114Host.CheckUserArg(Utils.Size(options.GroupKeys) > 0, nameof(options.GroupKeys), "There must be at least one group key");
LearnerFeatureSelection.cs (2)
78ectx.CheckUserArg((Threshold ?? 0) >= 0, nameof(Threshold), "Must be non-negative"); 79ectx.CheckUserArg((NumSlotsToKeep ?? int.MaxValue) > 0, nameof(NumSlotsToKeep), "Must be positive");
LoadTransform.cs (1)
71h.CheckUserArg(File.Exists(args.ModelFile), nameof(args.ModelFile), "File does not exist");
SvmLight\SvmLightLoader.cs (1)
558_host.CheckUserArg(options.InputSize >= 0, nameof(options.InputSize), "Maximum feature index must be positive, or 0 to infer it from the dataset");
Text\StopWordsRemovingTransformer.cs (4)
796ch.CheckUserArg(!string.IsNullOrWhiteSpace(stopwordsCol), nameof(Options.StopwordsColumn), 861ch.CheckUserArg(stopWordsMap.Count > 0, nameof(Options.Stopword), "stopwords is empty"); 871ch.CheckUserArg(typeSrc is TextDataViewType, nameof(Options.StopwordsColumn), "Must be a scalar text column"); 894ch.CheckUserArg(stopWordsMap.Count > 0, nameof(Options.DataFile), "dataFile is empty");
Text\WordBagTransform.cs (2)
115h.CheckUserArg(Utils.Size(options.Columns) > 0, nameof(options.Columns), "Columns must be specified"); 462h.CheckUserArg(Utils.Size(options.Columns) > 0, nameof(options.Columns), "Columns must be specified");
Text\WordHashBagProducingTransform.cs (4)
92h.CheckUserArg(Utils.Size(options.Columns) > 0, nameof(options.Columns), "Columns must be specified"); 328h.CheckUserArg(Utils.Size(options.Columns) > 0, nameof(options.Columns), "Columns must be specified"); 385h.CheckUserArg(extractorArgs.SkipLength < extractorArgs.NgramLength, nameof(extractorArgs.SkipLength), "Should be less than " + nameof(extractorArgs.NgramLength)); 386h.CheckUserArg(Utils.Size(cols) > 0, nameof(Options.Columns), "Must be specified");
UngroupTransform.cs (3)
113Host.CheckUserArg(Utils.Size(options.Columns) > 0, nameof(options.Columns), "There must be at least one pivot column"); 114Host.CheckUserArg(options.Columns.Distinct().Count() == options.Columns.Length, nameof(options.Columns), 332ectx.CheckUserArg(!string.IsNullOrEmpty(name), nameof(Options.Columns), "Column name cannot be empty");