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