167 references to CheckParam
Microsoft.ML.Core.Tests (1)
UnitTests\TestContracts.cs (1)
26ectx.CheckParam(false, nameof(ectx), "Whoops");
Microsoft.ML.Data (84)
Commands\SaveDataCommand.cs (1)
194ch.CheckParam(file.CanWrite, nameof(file), "Cannot write to file");
Data\DataViewUtils.cs (6)
335ch.CheckParam(SameSchemaAndActivity(inputs), nameof(inputs), "Inputs not compatible for consolidation"); 339ch.CheckParam(AllCacheable(schema, cursor.IsColumnActive), nameof(inputs), "Inputs had some uncachable input columns"); 1125Ch.CheckParam(IsColumnActive(column), nameof(column), "requested column not active."); 1126Ch.CheckParam(column.Index < _colToActive.Length, nameof(column), "requested column is not active or valid for the Schema."); 1316Ch.CheckParam(IsColumnActive(column), nameof(column), "requested column not active"); 1317Ch.CheckParam(column.Index < _colToActive.Length, nameof(column), "requested column not active or is invalid for the schema. ");
Data\RowCursorUtils.cs (2)
477env.CheckParam(Enumerable.Range(0, row.Schema.Count).All(c => row.IsColumnActive(row.Schema[c])), nameof(row), "Some columns were inactive"); 573Ch.CheckParam(IsColumnActive(column), nameof(column.Index), "Requested column is not active.");
DataLoadSave\Binary\BinaryLoader.cs (7)
770_host.CheckParam(stream.CanRead, nameof(stream), "input stream must be readable"); 771_host.CheckParam(stream.CanSeek, nameof(stream), "input stream must be seekable"); 772_host.CheckParam(stream.Position == 0, nameof(stream), "input stream must be at head"); 830_host.CheckParam(stream.CanRead, nameof(stream), "input stream must be readable"); 831_host.CheckParam(stream.CanSeek, nameof(stream), "input stream must be seekable"); 832_host.CheckParam(stream.Position == 0, nameof(stream), "input stream must be at head"); 2037Ch.CheckParam(column.Index < _colToActivesIndex.Length, nameof(column), "requested column not active.");
DataLoadSave\Binary\BinarySaver.cs (4)
648_host.CheckParam(stream.CanWrite, nameof(stream), "cannot save to non-writable stream"); 649_host.CheckParam(stream.CanSeek, nameof(stream), "cannot save to non-seekable stream"); 650_host.CheckParam(stream.Position == 0, nameof(stream), "stream must be positioned at head of stream"); 851_host.CheckParam(value.GetType() == type.RawType, nameof(value), "Value doesn't match type");
DataLoadSave\Database\DatabaseLoaderCursor.cs (1)
160Ch.CheckParam(column.Index < _getters.Length, nameof(column), "requested column not valid.");
DataLoadSave\DataOperationsCatalog.cs (6)
228_env.CheckParam(lowerBound < upperBound, nameof(upperBound), "Must be less than lowerBound"); 260_env.CheckParam(0 <= lowerBound && lowerBound <= 1, nameof(lowerBound), "Must be in [0, 1]"); 261_env.CheckParam(0 <= upperBound && upperBound <= 1, nameof(upperBound), "Must be in [0, 1]"); 262_env.CheckParam(lowerBound <= upperBound, nameof(upperBound), "Must be no less than lowerBound"); 414_env.CheckParam(0 < testFraction && testFraction < 1, nameof(testFraction), "Must be between 0 and 1 exclusive"); 461_env.CheckParam(numberOfFolds > 1, nameof(numberOfFolds), "Must be more than 1");
DataLoadSave\Text\TextLoaderCursor.cs (1)
319Ch.CheckParam(column.Index < _getters.Length, nameof(column), "requested column not valid.");
DataLoadSave\Transpose\TransposeLoader.cs (1)
884Ch.CheckParam(column.Index <= _colToActivesIndex.Length && IsColumnActive(column), nameof(column), "requested column not active");
DataLoadSave\Transpose\TransposeSaver.cs (2)
86_host.CheckParam(stream.CanSeek, nameof(stream), "Must be seekable but is not"); 87_host.CheckParam(stream.Position == 0, nameof(stream), "Stream must be at beginning but appears to not be");
DataView\AppendRowsDataView.cs (1)
191Ch.CheckParam(column.Index <= Getters.Length && IsColumnActive(column), nameof(column), "requested column not active");
DataView\CacheDataView.cs (2)
185_host.CheckParam(0 <= inputIndex && inputIndex < inputIndexLim, nameof(inputIndex), "Input column index not in range"); 1206Ch.CheckParam(column.Index <= _colToActivesIndex.Length && IsColumnActive(column), nameof(column), "requested column not active");
DataView\DataViewConstructionUtils.cs (1)
431Host.CheckParam(column.Index <= _getters.Length && IsColumnActive(column), nameof(column), "requested column not active");
DataView\EmptyDataView.cs (1)
81Ch.CheckParam(IsColumnActive(column), nameof(column), "requested column not active");
DataView\Transposer.cs (3)
90_host.CheckParam(Utils.Size(columns) > 0, nameof(columns), "Cannot be empty"); 207host.CheckParam(Utils.Size(columns) > 0, nameof(columns), "Cannot be empty"); 1503Ch.CheckParam(_getter != null, nameof(column), "requested column not active");
Evaluators\AnomalyDetectionEvaluator.cs (1)
792Host.CheckParam(schema.Label.HasValue, nameof(schema), "Data must contain a label column");
Evaluators\BinaryClassifierEvaluator.cs (2)
145host.CheckParam(prob.Count == 1, nameof(schema), "Cannot have multiple probability columns"); 1475Host.CheckParam(schema.Label.HasValue, nameof(schema), "Schema must contain a label column");
Evaluators\EvaluatorUtils.cs (3)
1360host.CheckParam(sample == -1 || sample >= 2, nameof(sample), "Should be -1 to indicate no sampling, or at least 2"); 1383host.CheckParam(sample == -1 || sample >= 2, nameof(sample), "Should be -1 to indicate no sampling, or at least 2"); 1388host.CheckParam(weightColumn.HasValue, nameof(getWeighted), "There is no Weight column in the confusionMatrix data view.");
Evaluators\Metrics\ConfusionMatrix.cs (2)
116_host.CheckParam(predictedClassIndicatorIndex > -1 && predictedClassIndicatorIndex < Counts.Count, 118_host.CheckParam(actualClassIndicatorIndex > -1 && actualClassIndicatorIndex < Counts.Count,
Evaluators\MulticlassClassificationEvaluator.cs (3)
81Host.CheckParam(schema.Label.HasValue, nameof(schema), "Could not find the label column"); 122Host.CheckParam(schema.Label.HasValue, nameof(schema), "Schema must contain a label column"); 1039Host.CheckParam(schema.Label.HasValue, nameof(schema), "Schema must contain a label column");
Evaluators\MultiOutputRegressionEvaluator.cs (2)
52Host.CheckParam(schema.Label.HasValue, nameof(schema), "Could not find the label column"); 643Host.CheckParam(schema.Label != null, nameof(schema), "Schema must contain a label column");
Evaluators\QuantileRegressionEvaluator.cs (4)
44Host.CheckParam(schema.Label.HasValue, nameof(schema), "Must contain a label column"); 62Host.CheckParam(schema.Label.HasValue, nameof(schema), "Must contain a label column"); 287Host.CheckParam(scoreSize > 0, nameof(scoreSize), "must be greater than 0"); 542Host.CheckParam(schema.Label.HasValue, nameof(schema), "Must contain a label column");
Evaluators\RankingEvaluator.cs (5)
137Host.CheckParam(data.Schema.Label.HasValue, nameof(data), "Schema must contain a label column"); 139Host.CheckParam(data.Schema.Group.HasValue, nameof(data), "Schema must contain a group column"); 705Host.CheckParam(0 < truncationLevel, nameof(truncationLevel), 943Host.CheckParam(schema.Label.HasValue, nameof(schema), "Data must contain a label column"); 944Host.CheckParam(schema.Group.HasValue, nameof(schema), "Data must contain a group column");
Evaluators\RegressionEvaluator.cs (2)
61Host.CheckParam(schema.Label.HasValue, nameof(schema), "Could not find the label column"); 364Host.CheckParam(schema.Label.HasValue, nameof(schema), "Schema must contain a label column");
Model\Pfa\BoundPfaContext.cs (2)
123_host.CheckParam(name != null, nameof(toOutput), "Null values in array"); 262_host.CheckParam(name != null, nameof(names), "A value was null");
Prediction\Calibrator.cs (4)
785Host.CheckParam(Utils.Size(outputs) == 2, nameof(outputs), "Expected this to have two outputs"); 794Host.CheckParam(Utils.Size(outputs) == 2, nameof(outputs), "Expected this to have two outputs"); 946ch.CheckParam(!caliTrainer.NeedsTraining || !string.IsNullOrWhiteSpace(labelColumn), nameof(labelColumn), 1020ch.CheckParam(data.Schema.Label.HasValue, nameof(data), "data must have a Label column");
Prediction\CalibratorCatalog.cs (1)
71env.CheckParam(!calibratorTrainer.NeedsTraining, nameof(labelColumn), "For trained calibrators, " + nameof(labelColumn) + " must be specified.");
Prediction\PredictionEngine.cs (1)
135ectx.CheckParam(transformer.IsRowToRowMapper, nameof(transformer), "Must be a row to row mapper");
Scorers\FeatureContributionCalculation.cs (2)
67env.CheckParam(mapper != null, nameof(mapper), "Unexpected mapper"); 80env.CheckParam(pred != null, nameof(predictor), "Predictor doesn't support getting feature contributions");
Scorers\GenericScorer.cs (1)
162Host.CheckParam(rowMapper != null, nameof(mapper), "mapper should implement ISchemaBoundRowMapper");
Scorers\PredictedLabelScorerBase.cs (3)
117env.CheckParam(rowMapper != null, nameof(bindable), "Mapper must implement ISchemaBoundRowMapper"); 145env.CheckParam(rowMapper != null, nameof(bindable), "Bindable expected to be an " + nameof(ISchemaBindableMapper) + "!"); 294Host.CheckParam(rowMapper != null, nameof(mapper), "mapper should implement " + nameof(ISchemaBoundRowMapper));
TrainCatalog.cs (1)
94Environment.CheckParam(numFolds > 1, nameof(numFolds), "Must be more than 1");
Training\TrainerEstimatorBase.cs (1)
65Host.CheckParam(feature.IsValid, nameof(feature), "not initialized properly");
Transforms\ColumnConcatenatingEstimator.cs (2)
58_host.CheckParam(inputColumnNames.Length > 0, nameof(inputColumnNames), "Input columns not specified"); 59_host.CheckParam(!inputColumnNames.Any(r => string.IsNullOrEmpty(r)), nameof(inputColumnNames),
Transforms\RowShufflingTransformer.cs (3)
229provider.CheckParam(poolRows > 0, nameof(poolRows), "Must be positive"); 233provider.CheckParam(CanShuffleAll(cursor.Schema), nameof(cursor), "Cannot shuffle a cursor with some uncacheable columns"); 715Ch.CheckParam(_colToActivesIndex[column.Index] >= 0, nameof(column), "requested column not active");
Microsoft.ML.Ensemble (3)
Selector\SubModelSelector\SubModelDataSelector.cs (2)
35Host.CheckParam(0 <= args.ValidationDatasetProportion && args.ValidationDatasetProportion < 1, 38Host.CheckParam(0 < args.LearnersSelectionProportion && args.LearnersSelectionProportion < 1,
Selector\SubsetSelector\BaseSubsetSelector.cs (1)
47Host.CheckParam(0 <= validationDatasetProportion && validationDatasetProportion < 1,
Microsoft.ML.FastTree (18)
FastTree.cs (1)
2840Host.CheckParam(numFeatures > 0, nameof(numFeatures), "must be positive");
GamModelParameters.cs (9)
69Host.CheckParam(binUpperBounds.Length == binEffects.Length, nameof(binUpperBounds), "Must have same number of features as binEffects"); 70Host.CheckParam(binEffects.Length > 0, nameof(binEffects), "Must have at least one entry"); 71Host.CheckParam(numInputFeatures == -1 || numInputFeatures > 0, nameof(numInputFeatures), "Must be greater than zero"); 72Host.CheckParam(shapeToInputMap == null || shapeToInputMap.Length == binEffects.Length, nameof(shapeToInputMap), "Must have same number of features as binEffects"); 89Host.CheckParam(binUpperBounds[i].Length == binEffects[i].Length, nameof(binEffects), "Array contained wrong number of effect values"); 90Host.CheckParam(Utils.IsMonotonicallyIncreasing(binUpperBounds[i]), nameof(binUpperBounds), "Array must be monotonically increasing"); 107Host.CheckParam(0 <= _shapeToInputMap[i] && _shapeToInputMap[i] < _numInputFeatures, nameof(_shapeToInputMap), "Contains out of range feature value"); 108Host.CheckParam(!_inputFeatureToShapeFunctionMap.ContainsValue(_shapeToInputMap[i]), nameof(_shapeToInputMap), "Contains duplicate mappings"); 204Host.CheckParam(features.Length == _numInputFeatures, nameof(features), "Bad length of input");
GamTrainer.cs (7)
203Host.CheckParam(options.LearningRate > 0, nameof(options.LearningRate), "Must be positive."); 204Host.CheckParam(options.NumberOfThreads == null || options.NumberOfThreads > 0, nameof(options.NumberOfThreads), "Must be positive."); 205Host.CheckParam(0 <= options.EntropyCoefficient && options.EntropyCoefficient <= 1, nameof(options.EntropyCoefficient), "Must be in [0, 1]."); 206Host.CheckParam(0 <= options.GainConfidenceLevel && options.GainConfidenceLevel < 1, nameof(options.GainConfidenceLevel), "Must be in [0, 1)."); 207Host.CheckParam(0 < options.MaximumBinCountPerFeature, nameof(options.MaximumBinCountPerFeature), "Must be positive."); 208Host.CheckParam(0 < options.NumberOfIterations, nameof(options.NumberOfIterations), "Must be positive."); 209Host.CheckParam(0 < options.MinimumExampleCountPerLeaf, nameof(options.MinimumExampleCountPerLeaf), "Must be positive.");
TreeEnsembleFeaturizer.cs (1)
526env.CheckParam(schema.Feature != null, nameof(schema), "Need a feature column");
Microsoft.ML.KMeansClustering (6)
KMeansModelParameters.cs (5)
78Host.CheckParam(k > 0, nameof(k), "Need at least one cluster"); 79Host.CheckParam(Utils.Size(centroids) >= k, nameof(centroids), "Not enough centroids for predictor initialization"); 80Host.CheckParam(centroids[0].Length > 0, nameof(centroids), "Centroid vectors should have at least one length"); 89Host.CheckParam(centroids[i].Length == _dimensionality, 91Host.CheckParam(FloatUtils.IsFinite(centroids[i].GetValues()),
KMeansPlusPlusTrainer.cs (1)
795ch.CheckParam(dimensionality > 0, nameof(dimensionality), "Must be positive");
Microsoft.ML.LightGbm (2)
LightGbmMulticlassTrainer.cs (1)
289ch.CheckParam(minLabel >= 0, nameof(data), "Minimum value in label column cannot be negative");
LightGbmTrainerBase.cs (1)
526ch.CheckParam(data.Schema.Label.HasValue, nameof(data), "Need a label column");
Microsoft.ML.Mkl.Components (4)
OlsLinearRegression.cs (2)
157ch.CheckParam(examples.Schema.Feature.HasValue, nameof(examples), "Need a feature column"); 158ch.CheckParam(examples.Schema.Label.HasValue, nameof(examples), "Need a labelColumn column");
SymSgdClassificationTrainer.cs (1)
227Host.CheckParam(initPred == null || linearInitPred != null, nameof(context),
VectorWhitening.cs (1)
655Host.CheckParam(rank <= dimension, nameof(rank), "Rank must be at most the dimension of untransformed data.");
Microsoft.ML.Parquet (4)
ParquetLoader.cs (4)
139_host.CheckParam(stream.CanRead, nameof(stream), "input stream must be readable"); 140_host.CheckParam(stream.CanSeek, nameof(stream), "input stream must be seekable"); 141_host.CheckParam(stream.Position == 0, nameof(stream), "input stream must be at head"); 600Ch.CheckParam(IsColumnActive(column), nameof(column), "requested column not active");
Microsoft.ML.PCA (1)
PcaTrainer.cs (1)
464Host.CheckParam(_eigenVectors[i].GetValues().All(FloatUtils.IsFinite),
Microsoft.ML.Recommender (4)
MatrixFactorizationPredictor.cs (2)
384_env.CheckParam(type.Equals(_parent.MatrixColumnIndexType), nameof(schema), msg); 389_env.CheckParam(type.Equals(_parent.MatrixRowIndexType), nameof(schema), msg);
MatrixFactorizationTrainer.cs (2)
441ch.CheckParam(data.Schema.Label.HasValue, nameof(data), "Input data did not have a unique label"); 450ch.CheckParam(validData.Schema.Label.HasValue, nameof(validData), "Input validation data did not have a unique label");
Microsoft.ML.StandardTrainers (12)
FactorizationMachine\FactorizationMachineTrainer.cs (1)
557_host.CheckParam(context.InitialPredictor == null || initPredictor != null, nameof(context),
Standard\LinearModelParameters.cs (2)
123Host.CheckParam(FloatUtils.IsFinite(weights.GetValues()), nameof(weights), "Cannot initialize linear predictor with non-finite weights"); 124Host.CheckParam(FloatUtils.IsFinite(bias), nameof(bias), "Cannot initialize linear predictor with non-finite bias");
Standard\LogisticRegression\LbfgsPredictorBase.cs (4)
254Host.CheckParam(!(LbfgsTrainerOptions.L2Regularization < 0), nameof(LbfgsTrainerOptions.L2Regularization), "Must be non-negative, if provided."); 255Host.CheckParam(!(LbfgsTrainerOptions.L1Regularization < 0), nameof(LbfgsTrainerOptions.L1Regularization), "Must be non-negative, if provided"); 256Host.CheckParam(!(LbfgsTrainerOptions.OptimizationTolerance <= 0), nameof(LbfgsTrainerOptions.OptimizationTolerance), "Must be positive, if provided."); 257Host.CheckParam(!(LbfgsTrainerOptions.HistorySize <= 0), nameof(LbfgsTrainerOptions.HistorySize), "Must be positive, if provided.");
Standard\Online\OnlineLinear.cs (1)
284Host.CheckParam(initPredictor == null || initLinearPred != null, nameof(context),
Standard\SdcaBinary.cs (1)
78Host.CheckParam(context.InitialPredictor == null || linInitPred != null, nameof(context),
Standard\Simple\SimpleTrainers.cs (2)
255_host.CheckParam(data.Schema.Label.HasValue, nameof(data), "Missing Label column"); 257_host.CheckParam(labelCol.Type == BooleanDataViewType.Instance, nameof(data), "Invalid type for Label column");
Standard\StochasticTrainerBase.cs (1)
41Host.CheckParam(context.InitialPredictor == null || linInitPred != null, nameof(context),
Microsoft.ML.TimeSeries (22)
AdaptiveSingularSpectrumSequenceModeler.cs (13)
235_host.CheckParam(windowSize >= 2, nameof(windowSize), "The window size should be at least 2."); // ...because otherwise we have nothing to autoregress on 236_host.CheckParam(seriesLength > windowSize, nameof(seriesLength), "The series length should be greater than the window size."); 238_host.CheckParam(0 <= discountFactor && discountFactor <= 1, nameof(discountFactor), "The discount factor should be in [0,1]."); 239_host.CheckParam(maxGrowth == null || maxGrowth.Value.TimeSpan > 0, nameof(GrowthRatio.TimeSpan), "The time span must be strictly positive."); 240_host.CheckParam(maxGrowth == null || maxGrowth.Value.Growth >= 0, nameof(GrowthRatio.Growth), "The growth must be non-negative."); 245_host.CheckParam(1 <= _maxRank && _maxRank < windowSize, nameof(maxRank), 257_host.CheckParam(1 <= _rank && _rank < windowSize, nameof(rank), "The rank should be in [1, windowSize)."); 1168_host.CheckParam(data != null, nameof(data), "The input series for training cannot be null."); 1169_host.CheckParam(data.Count >= _trainSize, nameof(data), "The input series for training does not have enough points for training."); 1210_host.CheckParam(data.Schema.Feature.HasValue, nameof(data), "Must have features column."); 1420_host.CheckParam(horizon >= 1, nameof(horizon), "The horizon parameter should be greater than 0."); 1425_host.CheckParam(result is SsaForecastResult, nameof(result), str); 1554_host.CheckParam(dataView != null, nameof(dataView), "The input series for updating cannot be null.");
PredictionEngine.cs (1)
268ectx.CheckParam(IsRowToRowMapper(transformer), nameof(transformer), "Must be a row to row mapper or " + nameof(IStatefulTransformer));
SequentialTransformBase.cs (4)
119host.CheckParam(windowSize >= 0, nameof(windowSize), "Must be non-negative."); 120host.CheckParam(initialWindowSize >= 0, nameof(initialWindowSize), "Must be non-negative."); 279Host.CheckParam(initialWindowSize >= 0, nameof(initialWindowSize), "Must be non-negative."); 280Host.CheckParam(windowSize >= 0, nameof(windowSize), "Must be non-negative.");
SequentialTransformerBase.cs (4)
101host.CheckParam(windowSize >= 0, nameof(windowSize), "Must be non-negative."); 102host.CheckParam(initialWindowSize >= 0, nameof(initialWindowSize), "Must be non-negative."); 360Host.CheckParam(initialWindowSize >= 0, nameof(initialWindowSize), "Must be non-negative."); 361Host.CheckParam(windowSize >= 0, nameof(windowSize), "Must be non-negative.");
Microsoft.ML.Transforms (6)
Dracula\CountTableTransformer.cs (2)
122_host.CheckParam(columns.All(col => col.PriorCoefficient > 0), nameof(ColumnOptionsBase.PriorCoefficient), "Must be greater than zero"); 123_host.CheckParam(columns.All(col => col.LaplaceScale >= 0), nameof(ColumnOptionsBase.LaplaceScale), "Must be greater than or equal to zero.");
Dracula\Featurizer.cs (1)
49_host.CheckParam(labelBinCount > 1, nameof(labelBinCount), "Must be greater than 1");
ExpressionTransformer.cs (1)
82_host.CheckParam(columns.All(col => Utils.Size(col.InputColumnNames) <= 5), nameof(ColumnOptions.InputColumnNames), "maximum number of inputs exceeded");
SvmLight\SvmLightLoader.cs (1)
482Ch.CheckParam(_isActive, nameof(column), "requested column not active");
Text\WordHashBagProducingTransform.cs (1)
421h.CheckParam(termLoaderArgs == null, nameof(termLoaderArgs), "Argument cannot be used with NgramHashExtractor, use NgramExtractor instead");