2 overrides of NextDouble
Microsoft.ML.Core (1)
Utilities\Random.cs (1)
171
public override double
NextDouble
()
System.Private.CoreLib (1)
src\libraries\System.Private.CoreLib\src\System\Random.cs (1)
549
public override double
NextDouble
()
260 references to NextDouble
HeaderPropagationSample (1)
Startup.cs (1)
113
if (Random.Shared.
NextDouble
() > threshold)
KeyManagementSimulator (1)
Program.cs (1)
502
_isRepeatingFailure = _random.
NextDouble
() < _pFail;
Microsoft.Arcade.Common (1)
ExponentialRetry.cs (1)
54
_random.
NextDouble
() * (MaxRandomFactor - MinRandomFactor) + MinRandomFactor;
Microsoft.AspNetCore.DataProtection (1)
KeyManagement\KeyRingProvider.cs (1)
488
return TimeSpan.FromTicks((long)(refreshPeriod.Ticks * (1.0d - (JitterRandom.
NextDouble
() / 5))));
Microsoft.Build.Framework (1)
Telemetry\OpenTelemetryManager.cs (1)
234
return random.
NextDouble
() < _sampleRate;
Microsoft.CodeAnalysis.CSharp (9)
Utilities\ValueSetFactory.BoolValueSetFactory.cs (1)
51
ConstantValue IValueSetFactory.RandomValue(Random random) => ConstantValue.Create(random.
NextDouble
() < 0.5);
Utilities\ValueSetFactory.DecimalTC.cs (1)
122
isNegative: random.
NextDouble
() < 0.5,
Utilities\ValueSetFactory.DoubleTC.cs (1)
103
return random.
NextDouble
() * 100 - 50;
Utilities\ValueSetFactory.FloatingValueSet.cs (1)
40
bool hasNan = random.
NextDouble
() < 0.5;
Utilities\ValueSetFactory.NintValueSetFactory.cs (2)
35
hasSmall: random.
NextDouble
() < 0.25,
37
hasLarge: random.
NextDouble
() < 0.25
Utilities\ValueSetFactory.NuintValueSetFactory.cs (1)
35
hasLarge: random.
NextDouble
() < 0.25
Utilities\ValueSetFactory.SingleTC.cs (1)
107
return (float)(random.
NextDouble
() * 100 - 50);
Utilities\ValueSetFactory.StringTC.cs (1)
34
if (random.
NextDouble
() * remain < need)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Utilities\ValueSetTests.cs (2)
292
double d1 = Random.
NextDouble
() * 100 - 50;
293
double d2 = Random.
NextDouble
() * 100 - 50;
Microsoft.CodeAnalysis.UnitTests (1)
Collections\ImmutablesTestBase.cs (1)
187
input = random.
NextDouble
();
Microsoft.Extensions.Http.Resilience (1)
Internal\Randomizer.cs (1)
14
public virtual double NextDouble(double maxValue) => Random.Shared.
NextDouble
() * maxValue;
Microsoft.ML.AutoML (8)
ColumnInference\TextFileSample.cs (1)
142
.Select(x => AutoMlUtils.Random.Value.
NextDouble
() * fileSizeRemaining)
Sweepers\Random.cs (1)
26
return new ParameterSet(SweepParameters.Select(sweepParameter => sweepParameter.CreateFromNormalized(AutoMlUtils.Random.Value.
NextDouble
())));
Sweepers\SweeperProbabilityUtils.cs (2)
39
u1 = AutoMlUtils.Random.Value.
NextDouble
();
40
u2 = AutoMlUtils.Random.Value.
NextDouble
();
Tuner\PipelineProposer.cs (1)
114
var randdouble = _rand.
NextDouble
();
Tuner\SmacTuner.cs (2)
289
var u1 = _rnd.
NextDouble
();
290
var u2 = _rnd.
NextDouble
();
Utils\RandomNumberGenerator.cs (1)
30
return (_random.
NextDouble
() * (high - low)) + low;
Microsoft.ML.AutoML.Samples (2)
AutoMLExperiment.cs (1)
90
float randomFloat() => (float)random.
NextDouble
();
Sweepable\SweepableLightGBMBinaryExperiment.cs (1)
117
float randomFloat() => (float)random.
NextDouble
();
Microsoft.ML.AutoML.Tests (1)
GetNextPipelineTests.cs (1)
68
var result = new PipelineScore(pipeline, AutoMlUtils.Random.Value.
NextDouble
(), true);
Microsoft.ML.Core (14)
Utilities\Random.cs (1)
26
var res = (float)random.
NextDouble
();
Utilities\ReservoirSampler.cs (1)
91
else if (_rnd.
NextDouble
() * _numSampled < _cache.Length)
Utilities\Stats.cs (12)
60
u = rand.
NextDouble
();
61
v = _vScale * (rand.
NextDouble
() - 0.5);
82
return SampleFromGamma(r, alpha + 1) * Math.Pow(r.
NextDouble
(), 1.0 / alpha);
96
u = r.
NextDouble
();
149
double t = rand.
NextDouble
();
153
t *= rand.
NextDouble
();
163
double u = 0.64 * rand.
NextDouble
();
164
double v = -0.68 + 1.28 * rand.
NextDouble
();
289
double u = rn.
NextDouble
();
335
double v = rn.
NextDouble
();
346
u = rn.
NextDouble
() - 0.5;
352
v = rn.
NextDouble
() * vr;
Microsoft.ML.Core.Tests (3)
UnitTests\TestVBuffer.cs (3)
119
d = rgen.
NextDouble
().ToFloat();
962
return rgen.
NextDouble
().ToFloat() * 10 - 5;
988
values[i] = rgen.
NextDouble
().ToFloat() * 10 - 5;
Microsoft.ML.CpuMath.PerformanceTests (1)
PerformanceTests.cs (1)
43
double mantissa = (rand.
NextDouble
() * 2.0) - 1.0;
Microsoft.ML.Ensemble (1)
Selector\FeatureSelector\RandomFeatureSelector.cs (1)
56
features[j] = rand.
NextDouble
() < _args.FeaturesSelectionProportion;
Microsoft.ML.Fairlearn (1)
Reductions\Utilities.cs (1)
31
var option = new UniformSingleOption(-gridLimit, gridLimit, defaultValue: Convert.ToSingle(rand.
NextDouble
()) * 2.0f * gridLimit - gridLimit);
Microsoft.ML.FastTree (15)
FastTree.cs (1)
421
activeFeatures[i] = _featureSelectionRandom.
NextDouble
() <= FastTreeTrainerOptions.FeatureFraction;
SumupPerformanceCommand.cs (5)
137
double r = 1 - rgen.
NextDouble
(); // Has support in [0,1). We subtract 1-r to make support in (0,1].
206
double r = 1 - rgen.
NextDouble
(); // Has support in [0,1). We subtract 1-r to make support in (0,1].
251
osum += (data.Outputs[i] = (FloatType)(2 * rgen.
NextDouble
() - 1));
259
osum += (data.Outputs[i] = (FloatType)(2 * rgen.
NextDouble
() - 1));
260
wsum += (data.Weights[i] = (FloatType)(2 * rgen.
NextDouble
() - 1));
Training\BaggingProvider.cs (2)
41
if (RndGenerator.
NextDouble
() < TrainFraction)
113
if (RndGenerator.
NextDouble
() < TrainFraction)
Training\EnsembleCompression\LassoBasedEnsembleCompressor.cs (1)
117
if (_rnd.
NextDouble
() <= perLabelSampleRate[_labels[d]])
Training\OptimizationAlgorithms\GradientDescent.cs (1)
50
Enumerable.Range(0, numberOfTrees).Where(t => (DropoutRng.
NextDouble
() < DropoutRate)).ToArray();
Training\ScoreTracker.cs (1)
91
Scores[i] += 10.0 * rndStart.
NextDouble
() * (reverseRandomization ? -1.0 : 1.0);
Training\TreeLearners\FastForestLeastSquaresTreeLearner.cs (1)
60
if (infos[i].Gain > max && Rand.
NextDouble
() < SplitFraction || Double.IsNegativeInfinity(max))
Utils\LinqExtensions.cs (3)
91
if (d.CompareTo(max) > 0 && rnd.
NextDouble
() < fraction)
137
if (d.CompareTo(max) > 0 && rnd.
NextDouble
() < fraction)
277
r = rand.
NextDouble
() * total;
Microsoft.ML.IntegrationTests (7)
Datasets\TypeTestData.cs (6)
130
Label = rng.
NextDouble
() > 0.5,
139
R4 = (float)rng.
NextDouble
(),
140
R8 = (double)rng.
NextDouble
(),
142
Ts = TimeSpan.FromSeconds(rng.
NextDouble
() * (1 + rng.Next())),
144
Dz = DateTimeOffset.FromUnixTimeSeconds((long)(rng.
NextDouble
() * (1 + rng.Next()))),
161
floatArray[i] = (float)rng.
NextDouble
();
DataTransformation.cs (1)
221
return (float)rng.
NextDouble
();
Microsoft.ML.KMeansClustering (1)
KMeansPlusPlusTrainer.cs (1)
1635
double key = Math.Log(rand.
NextDouble
()) / weight;
Microsoft.ML.PerformanceTests (1)
BenchmarkBase.cs (1)
106
if (random.
NextDouble
() > 0.5)
Microsoft.ML.Predictor.Tests (7)
TestTransposer.cs (7)
113
if (rgen.
NextDouble
() < density)
127
if (forceDenseSlotSet.Contains(i) || rgen.
NextDouble
() < density)
144
if (rgen.
NextDouble
() < density)
163
builder.AddColumn("B", NumberDataViewType.Double, GenerateHelper(rowCount, 0.8, rgen, rgen.
NextDouble
, 50, 0, 25, 49));
167
builder.AddColumn("D", NumberDataViewType.Double, GenerateHelper(rowCount, 0.1, rgen, rgen.
NextDouble
, 3, 1));
229
builder.AddColumn("B", NumberDataViewType.Double, GenerateHelper(rowCount, 0.8, rgen, rgen.
NextDouble
, 50, 0, 25, 49));
233
builder.AddColumn("D", NumberDataViewType.Double, GenerateHelper(rowCount, 0.1, rgen, rgen.
NextDouble
, 3, 1));
Microsoft.ML.Samples (137)
Dynamic\DataOperations\CrossValidationSplit.cs (1)
187
Features = (float)random.
NextDouble
()
Dynamic\DataOperations\LoadingSvmLight.cs (3)
25
if (random.
NextDouble
() > 0.5)
35
if (random.
NextDouble
() > 0.5)
37
sb.Append($"{i}:{random.
NextDouble
()} ");
Dynamic\DataOperations\LoadingText.cs (1)
33
var value = random.
NextDouble
();
Dynamic\DataOperations\TrainTestSplit.cs (1)
94
Features = (float)random.
NextDouble
()
Dynamic\Trainers\BinaryClassification\AveragedPerceptron.cs (1)
89
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\AveragedPerceptronWithOptions.cs (1)
100
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\FactorizationMachine.cs (1)
97
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\FastForest.cs (1)
92
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\FastForestWithOptions.cs (1)
104
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\FastTree.cs (1)
95
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\FastTreeWithOptions.cs (1)
107
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\FieldAwareFactorizationMachine.cs (3)
166
var value0 = (float)rnd.
NextDouble
();
172
var value1 = (float)rnd.
NextDouble
();
178
var value2 = (float)rnd.
NextDouble
();
Dynamic\Trainers\BinaryClassification\FieldAwareFactorizationMachineWithOptions.cs (3)
177
var value0 = (float)rnd.
NextDouble
();
183
var value1 = (float)rnd.
NextDouble
();
189
var value2 = (float)rnd.
NextDouble
();
Dynamic\Trainers\BinaryClassification\Gam.cs (1)
146
float centeredFloat() => (float)(rng.
NextDouble
() - 0.5);
Dynamic\Trainers\BinaryClassification\GamWithOptions.cs (1)
153
float centeredFloat() => (float)(rng.
NextDouble
() - 0.5);
Dynamic\Trainers\BinaryClassification\LbfgsLogisticRegression.cs (1)
92
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\LbfgsLogisticRegressionWithOptions.cs (1)
101
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\LdSvm.cs (1)
89
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\LdSvmWithOptions.cs (1)
98
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\LightGbm.cs (1)
92
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\LightGbmWithOptions.cs (1)
103
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\LinearSvm.cs (1)
89
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\LinearSvmWithOptions.cs (1)
98
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\PermutationFeatureImportance.cs (3)
105
Feature1 = (float)(rng.Next(10) * (rng.
NextDouble
() - 0.5)),
106
Feature2 = (float)(rng.Next(10) * (rng.
NextDouble
() - 0.5)),
111
data.Feature2 + rng.
NextDouble
() - 0.5);
Dynamic\Trainers\BinaryClassification\PermutationFeatureImportanceLoadFromDisk.cs (3)
91
Feature1 = (float)(rng.Next(10) * (rng.
NextDouble
() - 0.5)),
92
Feature2 = (float)(rng.Next(10) * (rng.
NextDouble
() - 0.5)),
97
data.Feature2 + rng.
NextDouble
() - 0.5);
Dynamic\Trainers\BinaryClassification\PriorTrainer.cs (1)
89
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\SdcaLogisticRegression.cs (1)
97
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\SdcaLogisticRegressionWithOptions.cs (1)
109
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\SdcaNonCalibrated.cs (1)
96
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\SdcaNonCalibratedWithOptions.cs (1)
111
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\SgdCalibrated.cs (1)
89
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\SgdCalibratedWithOptions.cs (1)
101
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\SgdNonCalibrated.cs (1)
89
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\SgdNonCalibratedWithOptions.cs (1)
98
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\SymbolicSgdLogisticRegression.cs (1)
92
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\BinaryClassification\SymbolicSgdLogisticRegressionWithOptions.cs (1)
101
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\Clustering\KMeans.cs (1)
96
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\Clustering\KMeansWithOptions.cs (1)
104
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\MulticlassClassification\LbfgsMaximumEntropy.cs (1)
93
float randomFloat() => (float)(random.
NextDouble
() - 0.5);
Dynamic\Trainers\MulticlassClassification\LbfgsMaximumEntropyWithOptions.cs (1)
101
float randomFloat() => (float)(random.
NextDouble
() - 0.5);
Dynamic\Trainers\MulticlassClassification\LightGbm.cs (1)
96
float randomFloat() => (float)(random.
NextDouble
() - 0.5);
Dynamic\Trainers\MulticlassClassification\LightGbmWithOptions.cs (1)
106
float randomFloat() => (float)(random.
NextDouble
() - 0.5);
Dynamic\Trainers\MulticlassClassification\LogLossPerClass.cs (1)
76
float randomFloat() => (float)(random.
NextDouble
() - 0.5);
Dynamic\Trainers\MulticlassClassification\NaiveBayes.cs (1)
101
float randomFloat() => (float)(random.
NextDouble
() - 0.5);
Dynamic\Trainers\MulticlassClassification\OneVersusAll.cs (1)
94
float randomFloat() => (float)(random.
NextDouble
() - 0.5);
Dynamic\Trainers\MulticlassClassification\PairwiseCoupling.cs (1)
94
float randomFloat() => (float)(random.
NextDouble
() - 0.5);
Dynamic\Trainers\MulticlassClassification\PermutationFeatureImportance.cs (3)
110
Feature1 = (float)(rng.Next(10) * (rng.
NextDouble
() - 0.5)),
111
Feature2 = (float)(rng.Next(10) * (rng.
NextDouble
() - 0.5)),
117
rng.
NextDouble
() - 0.5);
Dynamic\Trainers\MulticlassClassification\PermutationFeatureImportanceLoadFromDisk.cs (3)
119
Feature1 = (float)(rng.Next(10) * (rng.
NextDouble
() - 0.5)),
120
Feature2 = (float)(rng.Next(10) * (rng.
NextDouble
() - 0.5)),
126
rng.
NextDouble
() - 0.5);
Dynamic\Trainers\MulticlassClassification\SdcaMaximumEntropy.cs (1)
100
float randomFloat() => (float)(random.
NextDouble
() - 0.5);
Dynamic\Trainers\MulticlassClassification\SdcaMaximumEntropyWithOptions.cs (1)
110
float randomFloat() => (float)(random.
NextDouble
() - 0.5);
Dynamic\Trainers\MulticlassClassification\SdcaNonCalibrated.cs (1)
101
float randomFloat() => (float)(random.
NextDouble
() - 0.5);
Dynamic\Trainers\MulticlassClassification\SdcaNonCalibratedWithOptions.cs (1)
110
float randomFloat() => (float)(random.
NextDouble
() - 0.5);
Dynamic\Trainers\Ranking\FastTree.cs (1)
75
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\Ranking\FastTreeWithOptions.cs (1)
89
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\Ranking\LightGbm.cs (1)
75
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\Ranking\LightGbmWithOptions.cs (1)
90
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Trainers\Ranking\PermutationFeatureImportance.cs (3)
121
Feature1 = (float)(rng.Next(10) * (rng.
NextDouble
() - 0.5)),
122
Feature2 = (float)(rng.Next(10) * (rng.
NextDouble
() - 0.5)),
127
data.Feature2 + rng.
NextDouble
() - 0.5);
Dynamic\Trainers\Ranking\PermutationFeatureImportanceLoadFromDisk.cs (3)
128
Feature1 = (float)(rng.Next(10) * (rng.
NextDouble
() - 0.5)),
129
Feature2 = (float)(rng.Next(10) * (rng.
NextDouble
() - 0.5)),
134
data.Feature2 + rng.
NextDouble
() - 0.5);
Dynamic\Trainers\Regression\FastForest.cs (2)
78
float label = (float)random.
NextDouble
();
84
x => x + (float)random.
NextDouble
()).ToArray()
Dynamic\Trainers\Regression\FastForestWithOptions.cs (2)
91
float label = (float)random.
NextDouble
();
97
x => x + (float)random.
NextDouble
()).ToArray()
Dynamic\Trainers\Regression\FastTree.cs (2)
78
float label = (float)random.
NextDouble
();
84
x => x + (float)random.
NextDouble
()).ToArray()
Dynamic\Trainers\Regression\FastTreeTweedie.cs (2)
78
float label = (float)random.
NextDouble
();
84
x => x + (float)random.
NextDouble
()).ToArray()
Dynamic\Trainers\Regression\FastTreeTweedieWithOptions.cs (2)
93
float label = (float)random.
NextDouble
();
99
x => x + (float)random.
NextDouble
()).ToArray()
Dynamic\Trainers\Regression\FastTreeWithOptions.cs (2)
94
float label = (float)random.
NextDouble
();
100
x => x + (float)random.
NextDouble
()).ToArray()
Dynamic\Trainers\Regression\Gam.cs (2)
78
float label = (float)random.
NextDouble
();
84
x => x + (float)random.
NextDouble
()).ToArray()
Dynamic\Trainers\Regression\GamAdvanced.cs (1)
144
float centeredFloat() => (float)(rng.
NextDouble
() - 0.5);
Dynamic\Trainers\Regression\GamWithOptions.cs (2)
89
float label = (float)random.
NextDouble
();
95
x => x + (float)random.
NextDouble
()).ToArray()
Dynamic\Trainers\Regression\GamWithOptionsAdvanced.cs (1)
152
float centeredFloat() => (float)(rng.
NextDouble
() - 0.5);
Dynamic\Trainers\Regression\LbfgsPoissonRegression.cs (2)
76
float label = (float)random.
NextDouble
();
82
x => x + (float)random.
NextDouble
()).ToArray()
Dynamic\Trainers\Regression\LbfgsPoissonRegressionWithOptions.cs (2)
90
float label = (float)random.
NextDouble
();
96
x => x + (float)random.
NextDouble
()).ToArray()
Dynamic\Trainers\Regression\LightGbm.cs (2)
79
float label = (float)random.
NextDouble
();
85
x => x + (float)random.
NextDouble
()).ToArray()
Dynamic\Trainers\Regression\LightGbmWithOptions.cs (2)
98
float label = (float)random.
NextDouble
();
104
x => x + (float)random.
NextDouble
()).ToArray()
Dynamic\Trainers\Regression\OnlineGradientDescent.cs (2)
67
float label = (float)random.
NextDouble
();
73
x => x + (float)random.
NextDouble
()).ToArray()
Dynamic\Trainers\Regression\OnlineGradientDescentWithOptions.cs (2)
83
float label = (float)random.
NextDouble
();
89
x => x + (float)random.
NextDouble
()).ToArray()
Dynamic\Trainers\Regression\OrdinaryLeastSquares.cs (2)
75
float label = (float)random.
NextDouble
();
81
x => x + (float)random.
NextDouble
()).ToArray()
Dynamic\Trainers\Regression\OrdinaryLeastSquaresWithOptions.cs (2)
87
float label = (float)random.
NextDouble
();
93
x => x + (float)random.
NextDouble
()).ToArray()
Dynamic\Trainers\Regression\PermutationFeatureImportance.cs (3)
115
Feature1 = (float)(rng.Next(10) * (rng.
NextDouble
() - 0.5)),
116
Feature2 = (float)(rng.Next(10) * (rng.
NextDouble
() - 0.5)),
121
data.Feature2 + rng.
NextDouble
() - 0.5);
Dynamic\Trainers\Regression\PermutationFeatureImportanceLoadFromDisk.cs (3)
122
Feature1 = (float)(rng.Next(10) * (rng.
NextDouble
() - 0.5)),
123
Feature2 = (float)(rng.Next(10) * (rng.
NextDouble
() - 0.5)),
128
data.Feature2 + rng.
NextDouble
() - 0.5);
Dynamic\Trainers\Regression\Sdca.cs (2)
75
float label = (float)random.
NextDouble
();
81
x => x + (float)random.
NextDouble
()).ToArray()
Dynamic\Trainers\Regression\SdcaWithOptions.cs (2)
91
float label = (float)random.
NextDouble
();
97
x => x + (float)random.
NextDouble
()).ToArray()
Dynamic\Transforms\CalculateFeatureContribution.cs (3)
124
Feature1 = (float)(rng.Next(10) * (rng.
NextDouble
() - 0.5)),
125
Feature2 = (float)(rng.Next(10) * (rng.
NextDouble
() - 0.5)),
130
data.Feature2 + rng.
NextDouble
() - 0.5);
Dynamic\Transforms\CalculateFeatureContributionCalibrated.cs (3)
131
Feature1 = (float)(rng.Next(10) * (rng.
NextDouble
() - 0.5)),
132
Feature2 = (float)(rng.Next(10) * (rng.
NextDouble
() - 0.5)),
137
+ rng.
NextDouble
() - 0.5;
Dynamic\Transforms\Conversion\MapKeyToValueMultiColumn.cs (1)
100
var value = (float)rnd.
NextDouble
() + res * 0.2f;
Dynamic\Transforms\TreeFeaturization\FastForestBinaryFeaturizationWithOptions.cs (1)
126
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Transforms\TreeFeaturization\FastForestRegressionFeaturizationWithOptions.cs (2)
129
float label = (float)random.
NextDouble
();
135
(float)random.
NextDouble
()).ToArray()
Dynamic\Transforms\TreeFeaturization\FastTreeBinaryFeaturizationWithOptions.cs (1)
128
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Transforms\TreeFeaturization\FastTreeRankingFeaturizationWithOptions.cs (1)
124
float randomFloat() => (float)random.
NextDouble
();
Dynamic\Transforms\TreeFeaturization\FastTreeRegressionFeaturizationWithOptions.cs (2)
129
float label = (float)random.
NextDouble
();
135
(float)random.
NextDouble
()).ToArray()
Dynamic\Transforms\TreeFeaturization\FastTreeTweedieFeaturizationWithOptions.cs (2)
129
float label = (float)random.
NextDouble
();
135
(float)random.
NextDouble
()).ToArray()
Dynamic\Transforms\TreeFeaturization\PretrainedTreeEnsembleFeaturizationWithOptions.cs (1)
135
float randomFloat() => (float)random.
NextDouble
();
Microsoft.ML.SamplesUtils (5)
SamplesDatasetUtils.cs (5)
255
Weight = (float)rnd.
NextDouble
()
261
var value = (float)rnd.
NextDouble
();
319
if (naRate <= 0 || rnd.
NextDouble
() > naRate)
321
value = (float)rnd.
NextDouble
();
373
var value = (float)rnd.
NextDouble
() + res * 0.2f;
Microsoft.ML.SearchSpace (1)
Tuner\RandomTuner.cs (1)
34
var featureVec = Enumerable.Repeat(0, d).Select(i => _rnd.
NextDouble
()).ToArray();
Microsoft.ML.StandardTrainers (4)
FactorizationMachine\FactorizationMachineTrainer.cs (1)
318
latentWeightsAligned[vBias + k] = _radius * (float)rng.
NextDouble
();
Optimizer\DifferentiableFunction.cs (2)
358
double a = r.
NextDouble
();
359
double b = r.
NextDouble
();
Standard\Simple\SimpleTrainers.cs (1)
151
return (_random.
NextDouble
() * 2 - 1).ToFloat();
Microsoft.ML.Sweeper (5)
Algorithms\Random.cs (1)
34
return new ParameterSet(SweepParameters.Select(sweepParameter => sweepParameter.CreateFromNormalized(Host.Rand.
NextDouble
())));
Algorithms\SweeperProbabilityUtils.cs (4)
69
u1 = _rng.
NextDouble
();
70
u2 = _rng.
NextDouble
();
104
double u = _rng.
NextDouble
();
113
return _rng.
NextDouble
();
Microsoft.ML.Sweeper.Tests (8)
TestSweeper.cs (8)
70
var normalizedValue = (float)random.
NextDouble
();
152
var result = new RunResult(tResult.ParameterSet, random.
NextDouble
(), true);
211
sweeper.Update(task.CompletedResult().Id, new RunResult(task.CompletedResult().ParameterSet, random.
NextDouble
(), true));
260
var result = new RunResult(task.CompletedResult().ParameterSet, random.
NextDouble
(), true);
387
metrics[i] = random.
NextDouble
();
585
results.Add(new RunResult(parameterSet, random.
NextDouble
(), true));
633
results.Add(new RunResult(parameterSet, random.
NextDouble
(), true));
684
results.Add(new RunResult(parameterSet, random.
NextDouble
(), true));
Microsoft.ML.TestFramework (1)
DataPipe\TestDataPipe.cs (1)
1172
values[i] = (float)(2 * rgen.
NextDouble
() - 1);
Microsoft.ML.Tests (11)
ImagesTests.cs (1)
1109
Features = Enumerable.Repeat(0, InputSize).Select(x => random.
NextDouble
() * 100).ToArray()
Scenarios\Api\CookbookSamples\CookbookSamplesDynamicApi.cs (1)
491
HasChurned = x % 2 == 0 || (r.
NextDouble
() < 0.05),
Scenarios\ClusteringTests.cs (1)
46
var shift = (rand.
NextDouble
() - 0.5) / 10;
TrainerEstimators\FAFMEstimator.cs (3)
139
var value0 = (float)rnd.
NextDouble
();
145
var value1 = (float)rnd.
NextDouble
();
151
var value2 = (float)rnd.
NextDouble
();
TrainerEstimators\TreeEstimators.cs (1)
728
float randomFloat() => (float)(random.
NextDouble
() - 0.5);
Transformers\RffTests.cs (4)
47
new TestClass() { A = Enumerable.Range(0, 100).Select(x => (float)rand.
NextDouble
()).ToArray() },
48
new TestClass() { A = Enumerable.Range(0, 100).Select(x => (float)rand.
NextDouble
()).ToArray() }
95
new TestClass() { A = Enumerable.Range(0, 100).Select(x => (float)rand.
NextDouble
()).ToArray() },
96
new TestClass() { A = Enumerable.Range(0, 100).Select(x => (float)rand.
NextDouble
()).ToArray() }
Microsoft.ML.TimeSeries (1)
PValueTransform.cs (1)
129
dst = (Single)((count + _randomGen.
NextDouble
() * equalCount) / (totalCount + 1));
Microsoft.ML.Tokenizers (1)
Model\Word.cs (1)
118
if (dropout.HasValue && (_random ??= new()).
NextDouble
() < dropout)
Stress.ApiService (1)
TraceCreator.cs (1)
69
if (Random.Shared.
NextDouble
() > 0.05)
System.Linq (1)
System\Linq\Shuffle.SpeedOpt.cs (1)
378
return Random.Shared.
NextDouble
() > probOfDrawingZeroMatches;
System.Numerics.Tensors (3)
System\Numerics\Tensors\netcore\Tensor.cs (3)
450
double u1 = 1.0 - random.
NextDouble
();
451
double u2 = 1.0 - random.
NextDouble
();
471
span[i] = T.CreateChecked(random.
NextDouble
());
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Sample.cs (1)
183
static bool FlipBiasedCoin(Random random, double probTrue) => random.
NextDouble
() < probTrue;