291 references to CheckParam
Microsoft.ML.Core (171)
ComponentModel\ComponentCatalog.cs (6)
762Contracts.CheckParam(sig.BaseType == typeof(MulticastDelegate), nameof(sig), "Must be a delegate type"); 816Contracts.CheckParam(signatureType.BaseType == typeof(MulticastDelegate), nameof(signatureType), "signatureType must be a delegate type"); 862Contracts.CheckParam(interfaceType.IsInterface, nameof(interfaceType), "Must be interface"); 873Contracts.CheckParam(interfaceType.IsInterface, nameof(interfaceType), "Must be interface"); 887Contracts.CheckParam(interfaceType.IsInterface, nameof(interfaceType), "Must be interface"); 919Contracts.CheckParam(IsValidName(kind), nameof(kind), "Invalid component kind");
ComponentModel\LoadableClassAttribute.cs (7)
177Contracts.CheckParam(sigType.BaseType == typeof(System.MulticastDelegate), nameof(sigTypes), "LoadableClass signature type must be a delegate type"); 180Contracts.CheckParam(meth != null, nameof(sigTypes), "LoadableClass signature type must be a delegate type"); 181Contracts.CheckParam(meth.ReturnType == typeof(void), nameof(sigTypes), "LoadableClass signature type must be a delegate type with void return"); 212Contracts.CheckParam(meth != null, nameof(sigTypes), "LoadableClass signature type must be a delegate type"); 213Contracts.CheckParam(meth.ReturnType == typeof(void), nameof(sigTypes), "LoadableClass signature type must be a delegate type with void return"); 215Contracts.CheckParam(parms.Length + itypeBase == types.Length, nameof(sigTypes), "LoadableClass signatures must have the same number of parameters"); 221Contracts.CheckParam(types[itypeBase + itype] == parm.ParameterType, nameof(sigTypes),
Data\AnnotationUtils.cs (4)
144Contracts.CheckParam(size > 0, nameof(size), "must be known size"); 156Contracts.CheckParam(rangeCount > 0, nameof(rangeCount), "must be known size"); 326Contracts.CheckParam(column.IsValid, nameof(column), "struct not initialized properly"); 341Contracts.CheckParam(col.IsValid, nameof(col), "struct not initialized properly");
Data\IEstimator.cs (4)
66Contracts.CheckParam(!(itemType is KeyDataViewType), nameof(itemType), "Item type cannot be a key"); 67Contracts.CheckParam(!(itemType is VectorDataViewType), nameof(itemType), "Item type cannot be a vector"); 68Contracts.CheckParam(!isKey || KeyDataViewType.IsValidDataType(itemType.RawType), nameof(itemType), "The item type must be valid for a key"); 133Contracts.CheckParam(columns.All(c => c.IsValid), nameof(columns), "Some items are not initialized properly.");
Utilities\BigArray.cs (11)
73Contracts.CheckParam(0 <= index && index < _length, nameof(index), "Index out of range."); 80Contracts.CheckParam(0 <= index && index < _length, nameof(index), "Index out of range."); 95Contracts.CheckParam(size >= 0, nameof(size), "Must be non-negative."); 102Contracts.CheckParam(size <= MaxSize, nameof(size), "Size of BigArray is too large."); 125Contracts.CheckParam(0 <= index && index < _length, nameof(index), "Index out of range."); 138Contracts.CheckParam(min >= 0, nameof(min), "Specified minimum index must be non-negative."); 139Contracts.CheckParam(lim <= _length, nameof(lim), "Specified limit index must be no more than length of the array."); 165Contracts.CheckParam(min >= 0, nameof(min), "Specified minimum index must be non-negative."); 166Contracts.CheckParam(lim <= _length, nameof(lim), "Specified limit index must be no more than length of the array."); 211Contracts.CheckParam(newLength >= 0, nameof(newLength), "Specified new size must be non-negative."); 212Contracts.CheckParam(newLength <= MaxSize, nameof(newLength), "Specified new size is too large.");
Utilities\FuncInstanceMethodInfo1`2.cs (17)
39Contracts.CheckParam(!GenericMethodDefinition.IsStatic, nameof(methodInfo), "Should be an instance method"); 40Contracts.CheckParam(GenericMethodDefinition.DeclaringType == typeof(TTarget), nameof(methodInfo), _targetTypeCheckMessage); 64Contracts.CheckParam(methodCallExpression.Method.DeclaringType == typeof(MethodInfo), nameof(expression), "Unexpected expression form"); 65Contracts.CheckParam(methodCallExpression.Method.Name == nameof(MethodInfo.CreateDelegate), nameof(expression), "Unexpected expression form"); 66Contracts.CheckParam(methodCallExpression.Method.GetParameters().Length == 2, nameof(expression), "Unexpected expression form"); 67Contracts.CheckParam(methodCallExpression.Method.GetParameters()[0].ParameterType == typeof(Type), nameof(expression), "Unexpected expression form"); 68Contracts.CheckParam(methodCallExpression.Method.GetParameters()[1].ParameterType == typeof(object), nameof(expression), "Unexpected expression form"); 71Contracts.CheckParam(methodCallExpression.Arguments.Count == 2, nameof(expression), "Unexpected expression form"); 72Contracts.CheckParam(methodCallExpression.Arguments[0] is ConstantExpression, nameof(expression), "Unexpected expression form"); 73Contracts.CheckParam(((ConstantExpression)methodCallExpression.Arguments[0]).Type == typeof(Type), nameof(expression), "Unexpected expression form"); 74Contracts.CheckParam((Type)((ConstantExpression)methodCallExpression.Arguments[0]).Value == typeof(Func<TResult>), nameof(expression), "Unexpected expression form"); 75Contracts.CheckParam(methodCallExpression.Arguments[1] is ParameterExpression, nameof(expression), "Unexpected expression form"); 76Contracts.CheckParam(methodCallExpression.Arguments[1] == expression.Parameters[0], nameof(expression), "Unexpected expression form"); 79Contracts.CheckParam(methodCallExpression.Object is ConstantExpression, nameof(expression), "Unexpected expression form"); 80Contracts.CheckParam(((ConstantExpression)methodCallExpression.Object).Type == typeof(MethodInfo), nameof(expression), "Unexpected expression form"); 83Contracts.CheckParam(expression.Body is UnaryExpression, nameof(expression), "Unexpected expression form"); 84Contracts.CheckParam(((UnaryExpression)expression.Body).Operand is MethodCallExpression, nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo1`3.cs (17)
40Contracts.CheckParam(!GenericMethodDefinition.IsStatic, nameof(methodInfo), "Should be an instance method"); 41Contracts.CheckParam(GenericMethodDefinition.DeclaringType == typeof(TTarget), nameof(methodInfo), _targetTypeCheckMessage); 65Contracts.CheckParam(methodCallExpression.Method.DeclaringType == typeof(MethodInfo), nameof(expression), "Unexpected expression form"); 66Contracts.CheckParam(methodCallExpression.Method.Name == nameof(MethodInfo.CreateDelegate), nameof(expression), "Unexpected expression form"); 67Contracts.CheckParam(methodCallExpression.Method.GetParameters().Length == 2, nameof(expression), "Unexpected expression form"); 68Contracts.CheckParam(methodCallExpression.Method.GetParameters()[0].ParameterType == typeof(Type), nameof(expression), "Unexpected expression form"); 69Contracts.CheckParam(methodCallExpression.Method.GetParameters()[1].ParameterType == typeof(object), nameof(expression), "Unexpected expression form"); 72Contracts.CheckParam(methodCallExpression.Arguments.Count == 2, nameof(expression), "Unexpected expression form"); 73Contracts.CheckParam(methodCallExpression.Arguments[0] is ConstantExpression, nameof(expression), "Unexpected expression form"); 74Contracts.CheckParam(((ConstantExpression)methodCallExpression.Arguments[0]).Type == typeof(Type), nameof(expression), "Unexpected expression form"); 75Contracts.CheckParam((Type)((ConstantExpression)methodCallExpression.Arguments[0]).Value == typeof(Func<T, TResult>), nameof(expression), "Unexpected expression form"); 76Contracts.CheckParam(methodCallExpression.Arguments[1] is ParameterExpression, nameof(expression), "Unexpected expression form"); 77Contracts.CheckParam(methodCallExpression.Arguments[1] == expression.Parameters[0], nameof(expression), "Unexpected expression form"); 80Contracts.CheckParam(methodCallExpression.Object is ConstantExpression, nameof(expression), "Unexpected expression form"); 81Contracts.CheckParam(((ConstantExpression)methodCallExpression.Object).Type == typeof(MethodInfo), nameof(expression), "Unexpected expression form"); 84Contracts.CheckParam(expression.Body is UnaryExpression, nameof(expression), "Unexpected expression form"); 85Contracts.CheckParam(((UnaryExpression)expression.Body).Operand is MethodCallExpression, nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo1`4.cs (17)
41Contracts.CheckParam(!GenericMethodDefinition.IsStatic, nameof(methodInfo), "Should be an instance method"); 42Contracts.CheckParam(GenericMethodDefinition.DeclaringType == typeof(TTarget), nameof(methodInfo), _targetTypeCheckMessage); 66Contracts.CheckParam(methodCallExpression.Method.DeclaringType == typeof(MethodInfo), nameof(expression), "Unexpected expression form"); 67Contracts.CheckParam(methodCallExpression.Method.Name == nameof(MethodInfo.CreateDelegate), nameof(expression), "Unexpected expression form"); 68Contracts.CheckParam(methodCallExpression.Method.GetParameters().Length == 2, nameof(expression), "Unexpected expression form"); 69Contracts.CheckParam(methodCallExpression.Method.GetParameters()[0].ParameterType == typeof(Type), nameof(expression), "Unexpected expression form"); 70Contracts.CheckParam(methodCallExpression.Method.GetParameters()[1].ParameterType == typeof(object), nameof(expression), "Unexpected expression form"); 73Contracts.CheckParam(methodCallExpression.Arguments.Count == 2, nameof(expression), "Unexpected expression form"); 74Contracts.CheckParam(methodCallExpression.Arguments[0] is ConstantExpression, nameof(expression), "Unexpected expression form"); 75Contracts.CheckParam(((ConstantExpression)methodCallExpression.Arguments[0]).Type == typeof(Type), nameof(expression), "Unexpected expression form"); 76Contracts.CheckParam((Type)((ConstantExpression)methodCallExpression.Arguments[0]).Value == typeof(Func<T1, T2, TResult>), nameof(expression), "Unexpected expression form"); 77Contracts.CheckParam(methodCallExpression.Arguments[1] is ParameterExpression, nameof(expression), "Unexpected expression form"); 78Contracts.CheckParam(methodCallExpression.Arguments[1] == expression.Parameters[0], nameof(expression), "Unexpected expression form"); 81Contracts.CheckParam(methodCallExpression.Object is ConstantExpression, nameof(expression), "Unexpected expression form"); 82Contracts.CheckParam(((ConstantExpression)methodCallExpression.Object).Type == typeof(MethodInfo), nameof(expression), "Unexpected expression form"); 85Contracts.CheckParam(expression.Body is UnaryExpression, nameof(expression), "Unexpected expression form"); 86Contracts.CheckParam(((UnaryExpression)expression.Body).Operand is MethodCallExpression, nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo2`4.cs (17)
41Contracts.CheckParam(!GenericMethodDefinition.IsStatic, nameof(methodInfo), "Should be an instance method"); 42Contracts.CheckParam(GenericMethodDefinition.DeclaringType == typeof(TTarget), nameof(methodInfo), _targetTypeCheckMessage); 66Contracts.CheckParam(methodCallExpression.Method.DeclaringType == typeof(MethodInfo), nameof(expression), "Unexpected expression form"); 67Contracts.CheckParam(methodCallExpression.Method.Name == nameof(MethodInfo.CreateDelegate), nameof(expression), "Unexpected expression form"); 68Contracts.CheckParam(methodCallExpression.Method.GetParameters().Length == 2, nameof(expression), "Unexpected expression form"); 69Contracts.CheckParam(methodCallExpression.Method.GetParameters()[0].ParameterType == typeof(Type), nameof(expression), "Unexpected expression form"); 70Contracts.CheckParam(methodCallExpression.Method.GetParameters()[1].ParameterType == typeof(object), nameof(expression), "Unexpected expression form"); 73Contracts.CheckParam(methodCallExpression.Arguments.Count == 2, nameof(expression), "Unexpected expression form"); 74Contracts.CheckParam(methodCallExpression.Arguments[0] is ConstantExpression, nameof(expression), "Unexpected expression form"); 75Contracts.CheckParam(((ConstantExpression)methodCallExpression.Arguments[0]).Type == typeof(Type), nameof(expression), "Unexpected expression form"); 76Contracts.CheckParam((Type)((ConstantExpression)methodCallExpression.Arguments[0]).Value == typeof(Func<T1, T2, TResult>), nameof(expression), "Unexpected expression form"); 77Contracts.CheckParam(methodCallExpression.Arguments[1] is ParameterExpression, nameof(expression), "Unexpected expression form"); 78Contracts.CheckParam(methodCallExpression.Arguments[1] == expression.Parameters[0], nameof(expression), "Unexpected expression form"); 81Contracts.CheckParam(methodCallExpression.Object is ConstantExpression, nameof(expression), "Unexpected expression form"); 82Contracts.CheckParam(((ConstantExpression)methodCallExpression.Object).Type == typeof(MethodInfo), nameof(expression), "Unexpected expression form"); 85Contracts.CheckParam(expression.Body is UnaryExpression, nameof(expression), "Unexpected expression form"); 86Contracts.CheckParam(((UnaryExpression)expression.Body).Operand is MethodCallExpression, nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo3`3.cs (17)
40Contracts.CheckParam(!GenericMethodDefinition.IsStatic, nameof(methodInfo), "Should be an instance method"); 41Contracts.CheckParam(GenericMethodDefinition.DeclaringType == typeof(TTarget), nameof(methodInfo), _targetTypeCheckMessage); 65Contracts.CheckParam(methodCallExpression.Method.DeclaringType == typeof(MethodInfo), nameof(expression), "Unexpected expression form"); 66Contracts.CheckParam(methodCallExpression.Method.Name == nameof(MethodInfo.CreateDelegate), nameof(expression), "Unexpected expression form"); 67Contracts.CheckParam(methodCallExpression.Method.GetParameters().Length == 2, nameof(expression), "Unexpected expression form"); 68Contracts.CheckParam(methodCallExpression.Method.GetParameters()[0].ParameterType == typeof(Type), nameof(expression), "Unexpected expression form"); 69Contracts.CheckParam(methodCallExpression.Method.GetParameters()[1].ParameterType == typeof(object), nameof(expression), "Unexpected expression form"); 72Contracts.CheckParam(methodCallExpression.Arguments.Count == 2, nameof(expression), "Unexpected expression form"); 73Contracts.CheckParam(methodCallExpression.Arguments[0] is ConstantExpression, nameof(expression), "Unexpected expression form"); 74Contracts.CheckParam(((ConstantExpression)methodCallExpression.Arguments[0]).Type == typeof(Type), nameof(expression), "Unexpected expression form"); 75Contracts.CheckParam((Type)((ConstantExpression)methodCallExpression.Arguments[0]).Value == typeof(Func<T, TResult>), nameof(expression), "Unexpected expression form"); 76Contracts.CheckParam(methodCallExpression.Arguments[1] is ParameterExpression, nameof(expression), "Unexpected expression form"); 77Contracts.CheckParam(methodCallExpression.Arguments[1] == expression.Parameters[0], nameof(expression), "Unexpected expression form"); 80Contracts.CheckParam(methodCallExpression.Object is ConstantExpression, nameof(expression), "Unexpected expression form"); 81Contracts.CheckParam(((ConstantExpression)methodCallExpression.Object).Type == typeof(MethodInfo), nameof(expression), "Unexpected expression form"); 84Contracts.CheckParam(expression.Body is UnaryExpression, nameof(expression), "Unexpected expression form"); 85Contracts.CheckParam(((UnaryExpression)expression.Body).Operand is MethodCallExpression, nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo3`4.cs (17)
41Contracts.CheckParam(!GenericMethodDefinition.IsStatic, nameof(methodInfo), "Should be an instance method"); 42Contracts.CheckParam(GenericMethodDefinition.DeclaringType == typeof(TTarget), nameof(methodInfo), _targetTypeCheckMessage); 66Contracts.CheckParam(methodCallExpression.Method.DeclaringType == typeof(MethodInfo), nameof(expression), "Unexpected expression form"); 67Contracts.CheckParam(methodCallExpression.Method.Name == nameof(MethodInfo.CreateDelegate), nameof(expression), "Unexpected expression form"); 68Contracts.CheckParam(methodCallExpression.Method.GetParameters().Length == 2, nameof(expression), "Unexpected expression form"); 69Contracts.CheckParam(methodCallExpression.Method.GetParameters()[0].ParameterType == typeof(Type), nameof(expression), "Unexpected expression form"); 70Contracts.CheckParam(methodCallExpression.Method.GetParameters()[1].ParameterType == typeof(object), nameof(expression), "Unexpected expression form"); 73Contracts.CheckParam(methodCallExpression.Arguments.Count == 2, nameof(expression), "Unexpected expression form"); 74Contracts.CheckParam(methodCallExpression.Arguments[0] is ConstantExpression, nameof(expression), "Unexpected expression form"); 75Contracts.CheckParam(((ConstantExpression)methodCallExpression.Arguments[0]).Type == typeof(Type), nameof(expression), "Unexpected expression form"); 76Contracts.CheckParam((Type)((ConstantExpression)methodCallExpression.Arguments[0]).Value == typeof(Func<T1, T2, TResult>), nameof(expression), "Unexpected expression form"); 77Contracts.CheckParam(methodCallExpression.Arguments[1] is ParameterExpression, nameof(expression), "Unexpected expression form"); 78Contracts.CheckParam(methodCallExpression.Arguments[1] == expression.Parameters[0], nameof(expression), "Unexpected expression form"); 81Contracts.CheckParam(methodCallExpression.Object is ConstantExpression, nameof(expression), "Unexpected expression form"); 82Contracts.CheckParam(((ConstantExpression)methodCallExpression.Object).Type == typeof(MethodInfo), nameof(expression), "Unexpected expression form"); 85Contracts.CheckParam(expression.Body is UnaryExpression, nameof(expression), "Unexpected expression form"); 86Contracts.CheckParam(((UnaryExpression)expression.Body).Operand is MethodCallExpression, nameof(expression), "Unexpected expression form");
Utilities\FuncMethodInfo`1.cs (2)
17Contracts.CheckParam(methodInfo.IsGenericMethod, nameof(methodInfo), "Should be generic but is not"); 20Contracts.CheckParam(typeof(TResult).IsAssignableFrom(GenericMethodDefinition.ReturnType), nameof(methodInfo), "Cannot be generic on return type");
Utilities\FuncMethodInfo`2.cs (2)
18Contracts.CheckParam(methodInfo.IsGenericMethod, nameof(methodInfo), "Should be generic but is not"); 21Contracts.CheckParam(typeof(TResult).IsAssignableFrom(GenericMethodDefinition.ReturnType), nameof(methodInfo), "Cannot be generic on return type");
Utilities\FuncMethodInfo`3.cs (2)
18Contracts.CheckParam(methodInfo.IsGenericMethod, nameof(methodInfo), "Should be generic but is not"); 21Contracts.CheckParam(typeof(TResult).IsAssignableFrom(GenericMethodDefinition.ReturnType), nameof(methodInfo), "Cannot be generic on return type");
Utilities\FuncMethodInfo1`1.cs (1)
33Contracts.CheckParam(GenericMethodDefinition.GetGenericArguments().Length == 1, nameof(methodInfo),
Utilities\FuncMethodInfo1`2.cs (1)
34Contracts.CheckParam(GenericMethodDefinition.GetGenericArguments().Length == 1, nameof(methodInfo),
Utilities\FuncMethodInfo1`3.cs (1)
35Contracts.CheckParam(GenericMethodDefinition.GetGenericArguments().Length == 1, nameof(methodInfo),
Utilities\FuncMethodInfo2`3.cs (1)
35Contracts.CheckParam(GenericMethodDefinition.GetGenericArguments().Length == 2, nameof(methodInfo),
Utilities\FuncMethodInfo3`2.cs (1)
34Contracts.CheckParam(GenericMethodDefinition.GetGenericArguments().Length == 3, nameof(methodInfo),
Utilities\FuncMethodInfo3`3.cs (1)
35Contracts.CheckParam(GenericMethodDefinition.GetGenericArguments().Length == 3, nameof(methodInfo),
Utilities\FuncStaticMethodInfo1`1.cs (1)
29Contracts.CheckParam(GenericMethodDefinition.IsStatic, nameof(function), "Should be a static method");
Utilities\FuncStaticMethodInfo1`2.cs (1)
30Contracts.CheckParam(GenericMethodDefinition.IsStatic, nameof(function), "Should be a static method");
Utilities\FuncStaticMethodInfo1`3.cs (1)
31Contracts.CheckParam(GenericMethodDefinition.IsStatic, nameof(function), "Should be a static method");
Utilities\FuncStaticMethodInfo2`3.cs (1)
31Contracts.CheckParam(GenericMethodDefinition.IsStatic, nameof(function), "Should be a static method");
Utilities\FuncStaticMethodInfo3`2.cs (1)
30Contracts.CheckParam(GenericMethodDefinition.IsStatic, nameof(function), "Should be a static method");
Utilities\FuncStaticMethodInfo3`3.cs (1)
31Contracts.CheckParam(GenericMethodDefinition.IsStatic, nameof(function), "Should be a static method");
Utilities\HybridMemoryStream.cs (3)
71Contracts.CheckParam(stream.CanRead, nameof(stream), "Cannot copy a stream we cannot read"); 79Contracts.CheckParam(stream.Position == 0, nameof(stream), "Should be at the head of the stream"); 187Contracts.CheckParam(0 <= value, nameof(value), "cannot be negative");
Utilities\LruCache.cs (1)
33Contracts.CheckParam(size > 0, nameof(size), "Must be positive");
Utilities\MathUtils.cs (3)
307Contracts.CheckParam(x > 0, nameof(x), "LogGamma invalid for x <= 0"); 350Contracts.CheckParam(n >= 0, nameof(n), "LogFactorial is invalid for n < 0."); 379Contracts.CheckParam(df > 0, nameof(df), "Degrees of freedom must be positive");
Utilities\MinWaiter.cs (1)
58Contracts.CheckParam(waiters > 0, nameof(waiters), "Must have at least one waiter");
Utilities\Random.cs (2)
188Contracts.CheckParam(maxValue >= 0, nameof(maxValue), "maxValue must be non-negative"); 199Contracts.CheckParam(minValue <= maxValue, nameof(minValue), "minValue must be less than or equal to maxValue.");
Utilities\ReservoirSampler.cs (2)
73Contracts.CheckParam(size > 0, nameof(size), "Reservoir size must be positive"); 152Contracts.CheckParam(size > 0, nameof(size), "Reservoir size must be positive");
Utilities\Stats.cs (2)
24Contracts.CheckParam(rangeSize > 0, nameof(rangeSize), "rangeSize must be positive."); 79Contracts.CheckParam(alpha > 0, nameof(alpha), "alpha must be positive");
Utilities\Stream.cs (1)
797Contracts.CheckParam(0 < bufferSize, nameof(bufferSize), "buffer size must be positive");
Utilities\TextReaderStream.cs (2)
151Contracts.CheckParam(0 <= offset && offset <= buffer.Length, nameof(offset), "invalid for this sized array"); 152Contracts.CheckParam(0 <= count && count <= buffer.Length - offset, nameof(count), "invalid for this sized array");
Utilities\Utils.cs (2)
1189Contracts.CheckParam(meth.IsGenericMethod, nameof(func), "Should be generic but is not"); 1190Contracts.CheckParam(meth.GetGenericArguments().Length == 1, nameof(func),
Microsoft.ML.Data (56)
Commands\DataCommand.cs (2)
405Contracts.CheckParam(file.CanWrite, nameof(file), "Must be writable"); 420Contracts.CheckParam(stream.CanWrite, nameof(stream), "Must be writable");
Data\Conversion.cs (1)
541Contracts.CheckParam(typeDst.IsStandardScalar() || typeDst is KeyDataViewType, nameof(typeDst),
Data\RowCursorUtils.cs (6)
37Contracts.CheckParam(row.IsColumnActive(row.Schema[col]), nameof(col), "column was not active"); 59Contracts.CheckParam(row.IsColumnActive(row.Schema[col]), nameof(col), "column was not active"); 80Contracts.CheckParam(row.IsColumnActive(row.Schema[col]), nameof(col), "column was not active"); 125Contracts.CheckParam(row.IsColumnActive(row.Schema[col]), nameof(col), "column was not active"); 158Contracts.CheckParam(row.IsColumnActive(row.Schema[col]), nameof(col), "column was not active"); 178Contracts.CheckParam(row.IsColumnActive(row.Schema[col]), nameof(col), "column was not active");
Data\SchemaDefinition.cs (2)
78Contracts.CheckParam(size >= 0, nameof(size), "Should be non-negative number"); 93Contracts.CheckParam(size >= 0, nameof(dimensions), "Should contain only non-negative values");
DataLoadSave\Binary\BinaryLoader.cs (1)
929Contracts.CheckParam(files.Count == 1, nameof(files), "binary loader must be created with one file");
DataLoadSave\Binary\MemoryStreamPool.cs (1)
61Contracts.CheckParam(0 <= maxSize, nameof(maxSize), "Must be positive");
DataLoadSave\Database\DatabaseLoader.cs (3)
265Contracts.CheckParam(index >= 0, nameof(index), "Must be non-negative"); 290Contracts.CheckParam(min >= 0, nameof(min), "Must be non-negative"); 291Contracts.CheckParam(max >= min, nameof(max), "Must be greater than or equal to " + nameof(min));
DataLoadSave\MultiFileSource.cs (1)
107Contracts.CheckParam(file.CanRead, nameof(file), "File handle must be readable");
DataLoadSave\Text\TextLoader.cs (3)
277Contracts.CheckParam(index >= 0, nameof(index), "Must be non-negative"); 291Contracts.CheckParam(min >= 0, nameof(min), "Must be non-negative"); 292Contracts.CheckParam(!(max < min), nameof(max), "If specified, must be greater than or equal to " + nameof(min));
DataView\BatchDataViewMapperBase.cs (1)
111Contracts.CheckParam(IsColumnActive(column), nameof(column), "requested column is not active");
DataView\CompositeRowToRowMapper.cs (1)
56Contracts.CheckParam(input.Schema == InputSchema, nameof(input), "Schema did not match original schema");
DataView\SimpleRow.cs (1)
57Contracts.CheckParam(column.Index < _getters.Length, nameof(column), "Invalid col value in GetGetter");
DataView\ZipBinding.cs (1)
69Contracts.CheckParam(0 <= col && col < _cumulativeColCounts[_cumulativeColCounts.Length - 1], nameof(col), "Column index out of range");
Deprecated\Vector\VectorUtils.cs (4)
72Contracts.CheckParam(top >= 0, nameof(top), "Top count needs to be non-negative"); 73Contracts.CheckParam(bottom >= 0, nameof(bottom), "Bottom count needs to be non-negative"); 430Contracts.CheckParam(src.Length == dst.Length, nameof(dst), "Arrays must have the same dimensionality."); 444Contracts.CheckParam(src.Length == dst.Length, nameof(dst), "Arrays must have the same dimensionality.");
Evaluators\AucAggregator.cs (2)
115Contracts.CheckParam(PosSample.Any(), nameof(PosSample), "AUC is not defined when there is no positive class in the data"); 116Contracts.CheckParam(NegSample.Any(), nameof(NegSample), "AUC is not defined when there is no negative class in the data");
Evaluators\BinaryClassifierEvaluator.cs (1)
194Contracts.CheckParam(schema.Label != null, nameof(schema), "Could not find the label column");
Evaluators\EvaluatorUtils.cs (1)
463Contracts.CheckParam(typeof(T) == itemType.RawType, nameof(itemType), "Generic type does not match the item type");
Evaluators\RegressionEvaluator.cs (1)
74Contracts.CheckParam(schema.Label.HasValue, nameof(schema), "Could not find the label column");
Model\Pfa\PfaUtils.cs (1)
148Contracts.CheckParam(Utils.Size(types) >= 2, nameof(types), "Union must have at least two types");
Prediction\Calibrator.cs (1)
1377Contracts.CheckParam(capacity > 0, nameof(capacity), "must be positive");
Scorers\SchemaBindablePredictorWrapper.cs (3)
646Contracts.CheckParam(qpred != null, nameof(predictor), "Predictor doesn't implement " + nameof(IQuantileValueMapper)); 648Contracts.CheckParam(ScoreType == NumberDataViewType.Single, nameof(predictor), "Unexpected predictor output type"); 649Contracts.CheckParam(ValueMapper != null && ValueMapper.InputType is VectorDataViewType vectorType
Training\TrainerEstimatorBase.cs (1)
135Contracts.CheckParam(labelCol.IsValid, nameof(labelCol), "not initialized properly");
Training\TrainerUtils.cs (4)
266Contracts.CheckParam(schema.Schema == row.Schema, nameof(schema), "schemas don't match!"); 267Contracts.CheckParam(schema.Feature.HasValue, nameof(schema), "Missing feature column"); 289Contracts.CheckParam(schema.Schema == row.Schema, nameof(schema), "schemas don't match!"); 290Contracts.CheckParam(schema.Label.HasValue, nameof(schema), "Missing label column");
Transforms\ColumnConcatenatingTransformer.cs (1)
163Contracts.CheckParam(inputColumnNames.Any(), nameof(inputColumnNames), "Can not be empty");
Transforms\MetadataDispatcher.cs (6)
60Contracts.CheckParam(!getters.Any(g => g == null), nameof(getters), "Invalid getter info"); 176Contracts.CheckParam(0 <= index && index < _infos.Length, nameof(index), "Out of range"); 177Contracts.CheckParam(_infos[index] == null, nameof(index), "Column already registered"); 413Contracts.CheckParam(type.RawType == typeof(TValue), nameof(type), "Given type doesn't match type parameter"); 428Contracts.CheckParam(type.RawType == typeof(TValue), nameof(type), "Given type doesn't match type parameter"); 429Contracts.CheckParam(type is PrimitiveDataViewType, nameof(type), "Must be a primitive type");
Transforms\NopTransform.cs (1)
136Contracts.CheckParam(input.Schema == Source.Schema, nameof(input), "Schema of input row must be the same as the schema the mapper is bound to");
Transforms\Normalizer.cs (1)
137Contracts.CheckParam(maximumExampleCount > 1, nameof(maximumExampleCount), "Must be greater than 1");
Transforms\PerGroupTransformBase.cs (1)
293Contracts.CheckParam(IsColumnActive(column), nameof(column), "requested column is not active");
Utilities\SlotDropper.cs (1)
44Contracts.CheckParam(slotsMin.Length == slotsMax.Length,
Utils\LossFunctions.cs (2)
337Contracts.CheckParam(smoothingConstant >= 0, nameof(smoothingConstant), "Must be non-negative."); 611Contracts.CheckParam(1 <= index && index <= 2, nameof(index), "Must be in the range [1, 2]");
Microsoft.ML.FastTree (12)
RandomForestRegression.cs (1)
74Contracts.CheckParam(0 <= p && p <= 1, nameof(p), "Probability argument for Quantile function should be between 0 to 1 inclusive");
Training\Test.cs (1)
388Contracts.CheckParam(ndcgTruncation == 1 || ndcgTruncation == 3, nameof(ndcgTruncation),
TreeEnsemble\InternalRegressionTree.cs (10)
179Contracts.CheckParam(numLeaves - 1 == Utils.Size(splitFeatures), nameof(splitFeatures), "Size error, should equal to numLeaves - 1."); 180Contracts.CheckParam(numLeaves - 1 == Utils.Size(splitGain), nameof(splitGain), "Size error, should equal to numLeaves - 1."); 181Contracts.CheckParam(numLeaves - 1 == Utils.Size(rawThresholds), nameof(rawThresholds), "Size error, should equal to numLeaves - 1."); 182Contracts.CheckParam(numLeaves - 1 == Utils.Size(lteChild), nameof(lteChild), "Size error, should equal to numLeaves - 1."); 183Contracts.CheckParam(numLeaves - 1 == Utils.Size(gtChild), nameof(gtChild), "Size error, should equal to numLeaves - 1."); 184Contracts.CheckParam(numLeaves - 1 == Utils.Size(defaultValueForMissing), nameof(defaultValueForMissing), "Size error, should equal to numLeaves - 1."); 185Contracts.CheckParam(numLeaves == Utils.Size(leafValues), nameof(leafValues), "Size error, should equal to numLeaves."); 186Contracts.CheckParam(numLeaves - 1 == Utils.Size(categoricalSplitFeatures), nameof(categoricalSplitFeatures), "Size error, should equal to numLeaves - 1."); 187Contracts.CheckParam(numLeaves - 1 == Utils.Size(categoricalSplit), nameof(categoricalSplit), "Size error, should equal to numLeaves - 1."); 197Contracts.CheckParam(Utils.Size(splitFeatures) > 0, nameof(splitFeatures), "Number of split features must be positive");
Microsoft.ML.ImageAnalytics (9)
ImagePixelExtractor.cs (1)
673Contracts.CheckParam(Planes > 0, nameof(colorsToExtract), "Need to use at least one color plane.");
ImageType.cs (5)
40Contracts.CheckParam(width > 0, nameof(width), "Should be positive number"); 41Contracts.CheckParam(height > 0, nameof(height), "Should be positive number"); 78Contracts.CheckParam(height > 0, nameof(height), "Must be positive."); 79Contracts.CheckParam(width > 0, nameof(width), " Must be positive."); 80Contracts.CheckParam((long)height * width <= int.MaxValue / 4, nameof(height), nameof(height) + " * " + nameof(width) + " is too large.");
VectorToImageTransform.cs (3)
631Contracts.CheckParam(Planes > 0, nameof(colorsPresent), "Need to use at least one color plane"); 636Contracts.CheckParam(imageWidth > 0, nameof(imageWidth), "Image width must be greater than zero"); 637Contracts.CheckParam(imageHeight > 0, nameof(imageHeight), "Image height must be greater than zero");
Microsoft.ML.Mkl.Components (4)
OlsLinearRegression.cs (4)
567Contracts.CheckParam((long)n * (n + 1) / 2 <= ap.Length, nameof(ap), "vector had insufficient length"); 606Contracts.CheckParam((long)n * (n + 1) / 2 <= ap.Length, nameof(ap), "vector had insufficient length"); 607Contracts.CheckParam((long)n * ldb <= b.Length, nameof(b), "vector had insufficient length"); 649Contracts.CheckParam((long)n * (n + 1) / 2 <= ap.Length, nameof(ap), "vector had insufficient length");
Microsoft.ML.Parquet (1)
ParquetLoader.cs (1)
374Contracts.CheckParam(files.Count == 1, nameof(files), "Parquet loader must be created with one file");
Microsoft.ML.PCA (3)
PcaTransformer.cs (3)
112Contracts.CheckParam(0 < Rank && Rank <= Dimension, nameof(Rank), "Rank must be positive, and at most the dimension of untransformed data"); 768Contracts.CheckParam(Oversampling >= 0, nameof(Oversampling), "Oversampling must be non-negative."); 769Contracts.CheckParam(Rank > 0, nameof(Rank), "Rank must be positive.");
Microsoft.ML.StandardTrainers (5)
Optimizer\LineSearch.cs (1)
168Contracts.CheckParam(initDeriv < 0, nameof(initDeriv), "Cannot search in direction of ascent!");
Optimizer\OptimizationMonitor.cs (1)
56Contracts.CheckParam(gradientCheckInterval > 0, nameof(gradientCheckInterval),
Standard\LinearModelParameters.cs (1)
73Contracts.CheckParam(0 <= index && index < Count, nameof(index), "Out of range");
Standard\LogisticRegression\MulticlassLogisticRegression.cs (2)
505Contracts.CheckParam(numClasses >= 2, nameof(numClasses), "Must be at least 2."); 507Contracts.CheckParam(numFeatures >= 1, nameof(numFeatures), "Must be positive.");
Microsoft.ML.Sweeper (3)
AsyncSweeper.cs (2)
84Contracts.CheckParam(!(baseSweeper is NelderMeadSweeper), nameof(baseSweeper), "baseSweeper cannot be Nelder-Mead"); 103Contracts.CheckParam(0 <= id && id < _numGenerated, nameof(id), "Invalid run id");
ConfigRunner.cs (1)
194Contracts.CheckParam(options.NumThreads == null || options.NumThreads.Value > 0, nameof(options.NumThreads), "Cannot be 0 or negative");
Microsoft.ML.TimeSeries (11)
AdaptiveSingularSpectrumSequenceModeler.cs (1)
1502Contracts.CheckParam(0 <= confidenceLevel && confidenceLevel < 1, nameof(confidenceLevel), "The confidence level must be in [0, 1).");
EigenUtils.cs (1)
513Contracts.CheckParam(size > 0, nameof(size), "The input matrix size must be strictly positive.");
FftUtils.cs (4)
225Contracts.CheckParam(length > 0, nameof(length), "The length parameter must be greater than 0."); 270Contracts.CheckParam(length > 0, nameof(length), "The length parameter must be greater than 0."); 327Contracts.CheckParam(length > 0, nameof(length), "The length parameter must be greater than 0."); 372Contracts.CheckParam(length > 0, nameof(length), "The length parameter must be greater than 0.");
PolynomialUtils.cs (3)
72Contracts.CheckParam(doublePrecision > 0, nameof(doublePrecision), "The double precision must be positive."); 73Contracts.CheckParam(Utils.Size(coefficients) >= 1, nameof(coefficients), "There must be at least one input coefficient."); 281Contracts.CheckParam(Utils.Size(roots) > 0, nameof(roots), "There must be at least 1 input root.");
SequentialTransformerBase.cs (1)
666Contracts.CheckParam(index < _getters.Length, nameof(column), "Invalid col value in GetGetter");
STL\PolynomialModel.cs (1)
64Contracts.CheckParam(coeffs.Count == 2, nameof(coeffs), "must contain exact 2 elements.");
Microsoft.ML.Transforms (15)
CountFeatureSelection.cs (1)
119Contracts.CheckParam(count >= 0, nameof(count), "Must be non-negative.");
Dracula\CountTableBuilder.cs (1)
53Contracts.CheckParam(LabelCardinality == labelCardinality, nameof(labelCardinality), "Label cardinality must be less than int.MaxValue");
Dracula\DictCountTable.cs (1)
160Contracts.CheckParam(garbageThreshold >= 0, nameof(garbageThreshold), "Garbage threshold must be non-negative");
Expression\BuiltinFunctions.cs (2)
372Contracts.CheckParam(Utils.Size(values) > 0, nameof(values), "Expected values to have positive length"); 373Contracts.CheckParam(!values.All(x => x != null), nameof(values), "Expected values to contain at least one null");
Text\LdaTransform.cs (8)
1193Contracts.CheckParam(numberOfTopics > 0, nameof(numberOfTopics), "Must be positive."); 1194Contracts.CheckParam(samplingStepCount > 0, nameof(samplingStepCount), "Must be positive."); 1195Contracts.CheckParam(maximumNumberOfIterations > 0, nameof(maximumNumberOfIterations), "Must be positive."); 1196Contracts.CheckParam(likelihoodInterval > 0, nameof(likelihoodInterval), "Must be positive."); 1197Contracts.CheckParam(numberOfThreads >= 0, nameof(numberOfThreads), "Must be positive or zero."); 1198Contracts.CheckParam(maximumTokenCountPerDocument > 0, nameof(maximumTokenCountPerDocument), "Must be positive."); 1199Contracts.CheckParam(numberOfSummaryTermsPerTopic > 0, nameof(numberOfSummaryTermsPerTopic), "Must be positive"); 1200Contracts.CheckParam(numberOfBurninIterations >= 0, nameof(numberOfBurninIterations), "Must be non-negative.");
Text\NgramHashingTransformer.cs (2)
954Contracts.CheckParam(!inputColumnNames.Any(r => string.IsNullOrWhiteSpace(r)), nameof(inputColumnNames), 1022Contracts.CheckParam(!inputColumnNames.Any(r => string.IsNullOrWhiteSpace(r)), nameof(inputColumnNames),
Microsoft.ML.Vision (1)
ImageClassificationTrainer.cs (1)
610Contracts.CheckParam(labelCount > 1, nameof(labelCount), msg);