2 types derived from Random
Microsoft.ML.Core (1)
Utilities\Random.cs (1)
86internal sealed class TauswortheHybrid : Random
System.Private.CoreLib (1)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Random.cs (1)
747private sealed class ThreadSafeRandom : Random
244 instantiations of Random
Aspire.Hosting.CodeGeneration.Go (1)
GoLanguageSupport.cs (1)
84? new Random(request.PortSeed.Value)
Aspire.Hosting.CodeGeneration.Java (1)
JavaLanguageSupport.cs (1)
74? new Random(request.PortSeed.Value)
Aspire.Hosting.CodeGeneration.Python (1)
PythonLanguageSupport.cs (1)
106? new Random(request.PortSeed.Value)
Aspire.Hosting.CodeGeneration.Rust (1)
RustLanguageSupport.cs (1)
88? new Random(request.PortSeed.Value)
Aspire.Hosting.CodeGeneration.TypeScript (1)
TypeScriptLanguageSupport.cs (1)
99? new Random(request.PortSeed.Value)
Aspire.Hosting.Tests (1)
ApplicationModel\ResourceAnnotationCollectionTests.cs (1)
191var random = new Random(42);
Aspire.Hosting.TestUtilities (1)
Helpers\Network.cs (1)
29var random = new Random();
Aspire.MongoDB.Driver.v2.Tests (2)
SnappyCompressionTests.cs (2)
24new Random(42).NextBytes(data); 62new Random(42).NextBytes(data);
ILCompiler.DependencyAnalysisFramework (1)
DependencyAnalyzer.cs (1)
113stackPopRandomizer = new Random(seed);
ILCompiler.ReadyToRun (2)
Compiler\FileLayoutOptimizer.cs (1)
198Random rand = new Random(0);
Compiler\ProfileDataManager.cs (1)
178Random rand = new Random(method.GetHashCode());
ILCompiler.RyuJit (1)
parent\ILCompiler.ReadyToRun\Compiler\FileLayoutOptimizer.cs (1)
198Random rand = new Random(0);
Microsoft.Arcade.Common (1)
ExponentialRetry.cs (1)
13private Random _random = new Random();
Microsoft.AspNetCore.DataProtection.MicroBenchmarks (1)
Benchmarks\SpanDataProtectorComparison.cs (1)
76var random = new Random(42); // Fixed seed for consistent results
Microsoft.CodeAnalysis (1)
InternalUtilities\TextKeyedCache.cs (1)
250r = new Random();
Microsoft.CodeAnalysis.CSharp (1)
Utilities\ValueSetFactory.EnumeratedValueSet.cs (1)
66var candidates = _tc.RandomValues(_membersIncludedOrExcluded.Count + 1, new Random(0), _membersIncludedOrExcluded.Count + 1);
Microsoft.Data.Analysis (1)
DataFrame.cs (1)
346Random rand = new Random();
Microsoft.Extensions.AI.Abstractions.Tests (4)
Contents\DataContentTests.cs (3)
281Random rand = new(42); 896new Random(42).NextBytes(testData); 923new Random(42).NextBytes(testData);
Embeddings\BinaryEmbeddingTests.cs (1)
60Random r = new(42);
Microsoft.Extensions.AI.Tests (2)
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (1)
2009var value = new Random().Next(100);
ChatCompletion\FunctionInvokingChatClientTests.cs (1)
2258var value = new Random().Next(100);
Microsoft.Extensions.Caching.Hybrid (1)
Internal\HybridCachePayload.cs (1)
38private static readonly Random _entropySource = new(); // doesn't need to be cryptographic
Microsoft.Extensions.Caching.Hybrid.Tests (15)
DistributedCacheTests.cs (3)
71new Random().NextBytes(expected); 117new Random().NextBytes(expected); 279var rand = new Random();
PayloadTests.cs (11)
41new Random().NextBytes(bytes); 74new Random().NextBytes(bytes); 108new Random().NextBytes(bytes); 138new Random().NextBytes(bytes); 174new Random().NextBytes(bytes); 210new Random().NextBytes(bytes); 228new Random().NextBytes(bytes); 255new Random().NextBytes(bytes); 288new Random().NextBytes(bytes); 315new Random().NextBytes(bytes); 338new Random().NextBytes(bytes);
TagSetTests.cs (1)
158var rand = new Random();
Microsoft.Extensions.Http.Diagnostics.Tests (1)
Logging\Internal\RandomStringGenerator.cs (1)
11private static readonly Random _random = new();
Microsoft.Extensions.Options.Contextual.Tests (1)
AcceptanceTests.cs (1)
48private readonly Random _rng = new(0);
Microsoft.Extensions.TimeProvider.Testing.Tests (1)
TimerTests.cs (1)
333var random = new Random();
Microsoft.ML.AutoML (14)
API\BinaryClassificationExperiment.cs (2)
371_rnd = settings.Seed.HasValue ? new Random(settings.Seed.Value) : new Random();
API\MulticlassClassificationExperiment.cs (2)
357_rnd = settings.Seed.HasValue ? new Random(settings.Seed.Value) : new Random();
API\RegressionExperiment.cs (2)
377_rnd = settings.Seed.HasValue ? new Random(settings.Seed.Value) : new Random();
AutoMlUtils.cs (1)
15public static readonly ThreadLocal<Random> Random = new ThreadLocal<Random>(() => new Random());
Sweepers\SmacSweeper.cs (1)
292Random r = new Random();
Tuner\PipelineProposer.cs (2)
79_rand = new Random(settings.Seed.Value); 83_rand = new Random();
Tuner\SmacTuner.cs (2)
29private readonly Random _rnd = new Random(); 82_rnd = new Random(seed.Value);
Utils\RandomNumberGenerator.cs (2)
15_random = new Random(); 20_random = new Random(seed);
Microsoft.ML.AutoML.Samples (2)
AutoMLExperiment.cs (1)
89var random = new Random(seed);
Sweepable\SweepableLightGBMBinaryExperiment.cs (1)
116var random = new Random(seed);
Microsoft.ML.AutoML.Tests (1)
SweeperTests.cs (1)
150Random rand = new Random(0);
Microsoft.ML.Core (1)
Utilities\Random.cs (1)
47return new TauswortheHybrid(new Random());
Microsoft.ML.Core.Tests (1)
UnitTests\TestHosts.cs (1)
40Random rand = new Random();
Microsoft.ML.CpuMath.PerformanceTests (2)
PerformanceTests.cs (2)
59seed = new Random().Next(); 85Random rand = new Random(_seed);
Microsoft.ML.Data (1)
Prediction\Calibrator.cs (1)
1384_random = new System.Random(System.Threading.Interlocked.Increment(ref _randSeed) - 1);
Microsoft.ML.Fairlearn (1)
Reductions\Utilities.cs (1)
26var rand = new Random();
Microsoft.ML.FastTree (11)
BoostingFastTree.cs (1)
100optimizationAlgorithm.DropoutRng = new Random(FastTreeTrainerOptions.Seed);
Dataset\Dataset.cs (1)
582Random rnd = new Random(randomSeed);
FastTree.cs (1)
416_featureSelectionRandom = new Random(FastTreeTrainerOptions.FeatureSelectionSeed);
RandomForestRegression.cs (1)
549_rgen = new Random(0); // Ideally we'd get this from the host.
SumupPerformanceCommand.cs (1)
177Random r = new Random(salt + i);
Training\Applications\ObjectiveFunction.cs (1)
50_rnd = new Random(randomNumberGeneratorSeed);
Training\BaggingProvider.cs (1)
23RndGenerator = new Random(randomSeed);
Training\EnsembleCompression\LassoBasedEnsembleCompressor.cs (1)
63_rnd = new Random(randomSeed);
Training\OptimizationAlgorithms\OptimizationAlgorithm.cs (1)
46DropoutRng = new Random();
Training\ScoreTracker.cs (1)
89Random rndStart = new Random(rngSeed);
Training\TreeLearners\LeastSquaresRegressionTreeLearner.cs (1)
171Rand = new Random(randomSeed);
Microsoft.ML.GenAI.Mistral (1)
MistralCausalLMAgent.cs (1)
162var random = new Random();
Microsoft.ML.IntegrationTests (4)
Datasets\Iris.cs (1)
42var rng = new Random(seed);
Datasets\TypeTestData.cs (1)
111var rng = new Random(seed);
DataTransformation.cs (1)
220var rng = new Random(seed);
Prediction.cs (1)
87var rnd = new Random(1);
Microsoft.ML.PCA (2)
PcaTrainer.cs (1)
283var rng = new Random(seed);
PcaTransformer.cs (1)
309var rnd = columns[iinfo].Seed == null ? Host.Rand : new Random(columns[iinfo].Seed.Value);
Microsoft.ML.PerformanceTests (2)
BenchmarkBase.cs (1)
64Random random = new Random(1);
CacheDataViewBench.cs (1)
60var rand = new Random(0);
Microsoft.ML.Predictor.Tests (2)
TestTransposer.cs (2)
155Random rgen = new Random(0); 221Random rgen = new Random(1);
Microsoft.ML.Samples (96)
Dynamic\DataOperations\CrossValidationSplit.cs (1)
179var random = new Random(seed);
Dynamic\DataOperations\DataViewEnumerable.cs (1)
89var rng = new Random(1234321);
Dynamic\DataOperations\FilterRowsByColumn.cs (1)
89var rng = new Random(1234321);
Dynamic\DataOperations\LoadingSvmLight.cs (1)
15var random = new Random(42);
Dynamic\DataOperations\LoadingText.cs (1)
17var random = new Random(1);
Dynamic\DataOperations\ShuffleRows.cs (1)
77var rng = new Random(1234321);
Dynamic\DataOperations\SkipRows.cs (1)
81var rng = new Random(1234321);
Dynamic\DataOperations\TakeRows.cs (1)
82var rng = new Random(1234321);
Dynamic\DataOperations\TrainTestSplit.cs (1)
86var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\AveragedPerceptron.cs (1)
88var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\AveragedPerceptronWithOptions.cs (1)
99var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\FactorizationMachine.cs (1)
96var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\FastForest.cs (1)
91var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\FastForestWithOptions.cs (1)
103var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\FastTree.cs (1)
94var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\FastTreeWithOptions.cs (1)
106var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\FieldAwareFactorizationMachine.cs (1)
145var rnd = new Random(seed);
Dynamic\Trainers\BinaryClassification\FieldAwareFactorizationMachineWithOptions.cs (1)
156var rnd = new Random(seed);
Dynamic\Trainers\BinaryClassification\Gam.cs (1)
145var rng = new Random(seed);
Dynamic\Trainers\BinaryClassification\GamWithOptions.cs (1)
152var rng = new Random(seed);
Dynamic\Trainers\BinaryClassification\LbfgsLogisticRegression.cs (1)
91var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\LbfgsLogisticRegressionWithOptions.cs (1)
100var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\LdSvm.cs (1)
88var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\LdSvmWithOptions.cs (1)
97var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\LightGbm.cs (1)
91var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\LightGbmWithOptions.cs (1)
102var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\LinearSvm.cs (1)
88var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\LinearSvmWithOptions.cs (1)
97var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\PermutationFeatureImportance.cs (1)
100var rng = new Random(seed);
Dynamic\Trainers\BinaryClassification\PermutationFeatureImportanceLoadFromDisk.cs (1)
86var rng = new Random(seed);
Dynamic\Trainers\BinaryClassification\PriorTrainer.cs (1)
88var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\SdcaLogisticRegression.cs (1)
96var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\SdcaLogisticRegressionWithOptions.cs (1)
108var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\SdcaNonCalibrated.cs (1)
95var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\SdcaNonCalibratedWithOptions.cs (1)
110var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\SgdCalibrated.cs (1)
88var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\SgdCalibratedWithOptions.cs (1)
100var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\SgdNonCalibrated.cs (1)
88var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\SgdNonCalibratedWithOptions.cs (1)
97var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\SymbolicSgdLogisticRegression.cs (1)
91var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\SymbolicSgdLogisticRegressionWithOptions.cs (1)
100var random = new Random(seed);
Dynamic\Trainers\Clustering\KMeans.cs (1)
95var random = new Random(seed);
Dynamic\Trainers\Clustering\KMeansWithOptions.cs (1)
103var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\LbfgsMaximumEntropy.cs (1)
92var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\LbfgsMaximumEntropyWithOptions.cs (1)
100var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\LightGbm.cs (1)
95var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\LightGbmWithOptions.cs (1)
105var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\LogLossPerClass.cs (1)
75var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\NaiveBayes.cs (1)
100var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\OneVersusAll.cs (1)
93var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\PairwiseCoupling.cs (1)
93var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\PermutationFeatureImportance.cs (1)
104var rng = new Random(seed);
Dynamic\Trainers\MulticlassClassification\PermutationFeatureImportanceLoadFromDisk.cs (1)
113var rng = new Random(seed);
Dynamic\Trainers\MulticlassClassification\SdcaMaximumEntropy.cs (1)
99var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\SdcaMaximumEntropyWithOptions.cs (1)
109var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\SdcaNonCalibrated.cs (1)
100var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\SdcaNonCalibratedWithOptions.cs (1)
109var random = new Random(seed);
Dynamic\Trainers\Ranking\FastTree.cs (1)
74var random = new Random(seed);
Dynamic\Trainers\Ranking\FastTreeWithOptions.cs (1)
88var random = new Random(seed);
Dynamic\Trainers\Ranking\LightGbm.cs (1)
74var random = new Random(seed);
Dynamic\Trainers\Ranking\LightGbmWithOptions.cs (1)
89var random = new Random(seed);
Dynamic\Trainers\Ranking\PermutationFeatureImportance.cs (1)
114var rng = new Random(seed);
Dynamic\Trainers\Ranking\PermutationFeatureImportanceLoadFromDisk.cs (1)
121var rng = new Random(seed);
Dynamic\Trainers\Regression\FastForest.cs (1)
75var random = new Random(seed);
Dynamic\Trainers\Regression\FastForestWithOptions.cs (1)
88var random = new Random(seed);
Dynamic\Trainers\Regression\FastTree.cs (1)
75var random = new Random(seed);
Dynamic\Trainers\Regression\FastTreeTweedie.cs (1)
75var random = new Random(seed);
Dynamic\Trainers\Regression\FastTreeTweedieWithOptions.cs (1)
90var random = new Random(seed);
Dynamic\Trainers\Regression\FastTreeWithOptions.cs (1)
91var random = new Random(seed);
Dynamic\Trainers\Regression\Gam.cs (1)
75var random = new Random(seed);
Dynamic\Trainers\Regression\GamAdvanced.cs (1)
143var rng = new Random(seed);
Dynamic\Trainers\Regression\GamWithOptions.cs (1)
86var random = new Random(seed);
Dynamic\Trainers\Regression\GamWithOptionsAdvanced.cs (1)
151var rng = new Random(seed);
Dynamic\Trainers\Regression\LbfgsPoissonRegression.cs (1)
73var random = new Random(seed);
Dynamic\Trainers\Regression\LbfgsPoissonRegressionWithOptions.cs (1)
87var random = new Random(seed);
Dynamic\Trainers\Regression\LightGbm.cs (1)
76var random = new Random(seed);
Dynamic\Trainers\Regression\LightGbmWithOptions.cs (1)
95var random = new Random(seed);
Dynamic\Trainers\Regression\OnlineGradientDescent.cs (1)
64var random = new Random(seed);
Dynamic\Trainers\Regression\OnlineGradientDescentWithOptions.cs (1)
80var random = new Random(seed);
Dynamic\Trainers\Regression\OrdinaryLeastSquares.cs (1)
72var random = new Random(seed);
Dynamic\Trainers\Regression\OrdinaryLeastSquaresWithOptions.cs (1)
84var random = new Random(seed);
Dynamic\Trainers\Regression\PermutationFeatureImportance.cs (1)
110var rng = new Random(seed);
Dynamic\Trainers\Regression\PermutationFeatureImportanceLoadFromDisk.cs (1)
117var rng = new Random(seed);
Dynamic\Trainers\Regression\Sdca.cs (1)
72var random = new Random(seed);
Dynamic\Trainers\Regression\SdcaWithOptions.cs (1)
88var random = new Random(seed);
Dynamic\Transforms\CalculateFeatureContribution.cs (1)
119var rng = new Random(seed);
Dynamic\Transforms\CalculateFeatureContributionCalibrated.cs (1)
126var rng = new Random(seed);
Dynamic\Transforms\Conversion\MapKeyToValueMultiColumn.cs (1)
91var rnd = new Random(0);
Dynamic\Transforms\ImageAnalytics\ConvertToImage.cs (1)
97var random = new Random(seed);
Dynamic\Transforms\TreeFeaturization\FastForestBinaryFeaturizationWithOptions.cs (1)
125var random = new Random(seed);
Dynamic\Transforms\TreeFeaturization\FastForestRegressionFeaturizationWithOptions.cs (1)
126var random = new Random(seed);
Dynamic\Transforms\TreeFeaturization\FastTreeBinaryFeaturizationWithOptions.cs (1)
127var random = new Random(seed);
Dynamic\Transforms\TreeFeaturization\FastTreeRankingFeaturizationWithOptions.cs (1)
123var random = new Random(seed);
Dynamic\Transforms\TreeFeaturization\FastTreeRegressionFeaturizationWithOptions.cs (1)
126var random = new Random(seed);
Dynamic\Transforms\TreeFeaturization\FastTreeTweedieFeaturizationWithOptions.cs (1)
126var random = new Random(seed);
Dynamic\Transforms\TreeFeaturization\PretrainedTreeEnsembleFeaturizationWithOptions.cs (1)
134var random = new Random(seed);
Microsoft.ML.SamplesUtils (4)
SamplesDatasetUtils.cs (4)
246var rnd = new Random(0); 295var rnd = new Random(0); 309var rnd = new Random(0); 365var rnd = new Random(0);
Microsoft.ML.SearchSpace (3)
Tuner\RandomTuner.cs (3)
18_rnd = new Random(seed.Value); 22_rnd = new Random(); 28_rnd = new Random(seed);
Microsoft.ML.StandardTrainers (3)
Optimizer\DifferentiableFunction.cs (3)
163private static readonly Random _r = new Random(5); 260Random r = new Random(5); 299Random r = new Random(5);
Microsoft.ML.Sweeper (3)
Algorithms\KdoSweeper.cs (1)
260Random rng = new Random();
Algorithms\SmacSweeper.cs (1)
301Random r = new Random();
Algorithms\SweeperProbabilityUtils.cs (1)
18_rng = new Random(host.Rand.Next());
Microsoft.ML.Sweeper.Tests (9)
TestSweeper.cs (9)
69var random = new Random(123); 132var random = new Random(42); 182var random = new Random(42); 232var random = new Random(42); 300var random = new Random(42); 352var random = new Random(42); 540var random = new Random(42); 596var random = new Random(42); 644var random = new Random(42);
Microsoft.ML.TestFramework (2)
DataPipe\TestDataPipe.cs (1)
1169Random rgen = new Random(0);
DataPipe\TestDataPipeBase.cs (1)
266using (var c1 = newPipe.GetRowCursor(newPipe.Schema, new Random(123)))
Microsoft.ML.Tests (19)
CalibratedModelParametersTests.cs (1)
99var rand = new Random(10);
FastTreeSumupParityTests.cs (4)
140var rand = new Random(7); 157var rand = new Random(101); 237var rand = new Random(seed); 278var rand = new Random(seed);
FeatureContributionTests.cs (1)
260var rand = new Random(10);
ImagesTests.cs (1)
1103var random = new Random(seed);
PermutationFeatureImportanceTests.cs (2)
817var rand = new Random(10); 884var rand = new Random(10);
Scenarios\Api\CookbookSamples\CookbookSamplesDynamicApi.cs (1)
487var r = new Random(454);
Scenarios\ClusteringTests.cs (1)
34var rand = new Random(1);
TrainerEstimators\FAFMEstimator.cs (1)
124var rnd = new Random(0);
TrainerEstimators\TreeEstimators.cs (1)
727var random = new Random(seed);
Transformers\LineParserTests.cs (1)
56Random rand = new Random();
Transformers\NormalizerTests.cs (3)
1111var rand = new Random(seed); 1182Random rand = new Random(0); 1256Random rand = new Random(0);
Transformers\RffTests.cs (2)
45Random rand = new Random(); 93Random rand = new Random();
Microsoft.ML.Tokenizers (1)
Model\Word.cs (1)
118if (dropout.HasValue && (_random ??= new()).NextDouble() < dropout)
Microsoft.ML.Transforms (2)
Dracula\CountTableTransformer.cs (2)
686var rand = _addNoise ? new Random(_parent.Seeds[iinfo]) : null; 706var rand = _addNoise ? new Random(_parent.Seeds[iinfo]) : null;
Microsoft.NET.Sdk.Publish.Tasks (1)
Tasks\Kudu\KuduDeploy.cs (1)
168string zipFileFullPath = Path.Combine(Path.GetTempPath(), string.Format("Publish{0}.zip", new Random().Next(int.MaxValue)));
Microsoft.Win32.SystemEvents (1)
Microsoft\Win32\SystemEvents.cs (1)
29private static readonly Random s_randomTimerId = new Random();
MilvusPlayground.ApiService (1)
Program.cs (1)
45Random ran = new();
NuGet.Protocol (1)
HttpSource\HttpRetryHandler.cs (1)
92await Task.Delay(TimeSpan.FromMilliseconds((Math.Pow(2, tries) * request.RetryDelay.TotalMilliseconds) + new Random().Next(200)), cancellationToken);
ScenarioTests.Common.Tests (2)
ScenarioTestHelpers.cs (1)
237Random rand = new Random(seed);
ScenarioTestTypes.cs (1)
1139Random rand = new Random(seed);
Shared.Tests (1)
Pools\PoolTests.cs (1)
266var r = new Random(seed);
Stress.ApiService (2)
Program.cs (2)
79var random = new Random(); 231var random = new Random();
System.Data.Odbc (1)
Common\System\Data\ProviderBase\DbConnectionPool.cs (1)
96private static readonly Random s_random = new Random(5101977); // Value obtained from Dave Driver
System.Data.OleDb (1)
System\Data\ProviderBase\DbConnectionPool.cs (1)
336private static readonly Random _random = new Random(5101977); // Value obtained from Dave Driver
System.DirectoryServices (1)
System\DirectoryServices\ActiveDirectory\Utils.cs (1)
945Random random = new Random();
System.ServiceModel.NetNamedPipe (1)
System\Runtime\BackoffTimeoutHelper.cs (1)
31_random = new Random(GetHashCode());
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\Regex.Cache.cs (1)
77private static readonly Random s_random = new Random();
649 references to Random
aspire (5)
Commands\InitCommand.cs (3)
313var ports = AppHostProfilePortGenerator.Generate(Random.Shared); 619effectivePorts = ports ?? AppHostProfilePortGenerator.Generate(Random.Shared); 625effectivePorts = ports ?? AppHostProfilePortGenerator.Generate(Random.Shared);
src\Shared\AppHostProfilePortGenerator.cs (1)
21internal static AppHostProfilePorts Generate(Random random)
Templating\CliTemplateFactory.cs (1)
292return AppHostProfilePortGenerator.Generate(Random.Shared);
Aspire.Cli.Tests (1)
Utils\FileSystemHelperTests.cs (1)
158Random.Shared.NextBytes(randomBytes);
Aspire.Dashboard.Tests (3)
Integration\MockOpenIdAuthority.cs (1)
73lastCode = Random.Shared.Next().ToString(CultureInfo.InvariantCulture);
Integration\ServerRetryHelper.cs (2)
40var nextPortAttempt = 30000 + Random.Shared.Next(10000); 124nextPortAttempt = port + Random.Shared.Next(10, 100);
Aspire.Hosting (4)
Dcp\ProxylessEndpointPortAllocator.cs (4)
49Random.Shared, 54internal ProxylessEndpointPortAllocator(int rangeStart, int rangeEnd, Random random, Func<int, ProtocolType, bool> tryProbe) 295private static int GetRandomCoprimeStep(Random random, int rangeSize) 312private static int GetRandomOffset(Random random, int rangeStart, int rangeEnd)
Aspire.Hosting.CodeGeneration.Go (2)
GoLanguageSupport.cs (2)
83var random = request.PortSeed.HasValue 85: Random.Shared;
Aspire.Hosting.CodeGeneration.Java (2)
JavaLanguageSupport.cs (2)
73var random = request.PortSeed.HasValue 75: Random.Shared;
Aspire.Hosting.CodeGeneration.Python (2)
PythonLanguageSupport.cs (2)
105var random = request.PortSeed.HasValue 107: Random.Shared;
Aspire.Hosting.CodeGeneration.Rust (2)
RustLanguageSupport.cs (2)
87var random = request.PortSeed.HasValue 89: Random.Shared;
Aspire.Hosting.CodeGeneration.TypeScript (3)
src\Shared\AppHostProfilePortGenerator.cs (1)
21internal static AppHostProfilePorts Generate(Random random)
TypeScriptLanguageSupport.cs (2)
98var random = request.PortSeed.HasValue 100: Random.Shared;
Aspire.Hosting.Docker.Tests (1)
DockerComposeTests.cs (1)
416var hostPort = Random.Shared.Next(49152, 65535);
Aspire.Hosting.Tests (2)
ApplicationModel\ResourceAnnotationCollectionTests.cs (1)
191var random = new Random(42);
Dcp\DcpExecutorTests.cs (1)
10307var offset = Random.Shared.Next(span);
Aspire.Hosting.TestUtilities (1)
Helpers\Network.cs (1)
29var random = new Random();
AspireJavaScript.MinimalApi (2)
AppHost.cs (2)
31Random.Shared.Next(-20, 55), 32summaries[Random.Shared.Next(summaries.Length)]
AspireWithMaui.WeatherApi (2)
Controllers\WeatherForecastController.cs (2)
20TemperatureC = Random.Shared.Next(-20, 55), 21Summary = s_summaries[Random.Shared.Next(s_summaries.Length)]
AspireWithNode.AspNetCoreApi (2)
Program.cs (2)
26Random.Shared.Next(-20, 55), 27summaries[Random.Shared.Next(summaries.Length)]
BlazorHosted.WeatherApi (2)
Program.cs (2)
22Random.Shared.Next(-20, 55), 23summaries[Random.Shared.Next(summaries.Length)]
BlazorStandalone.WeatherApi (2)
Program.cs (2)
24Random.Shared.Next(-20, 55), 25summaries[Random.Shared.Next(summaries.Length)]
CustomResources.AppHost (3)
TestResource.cs (3)
50var seconds = Random.Shared.Next(2, 12); 63var randomState = states[Random.Shared.Next(0, states.Length)]; 64var randomStyle = stateStyles[Random.Shared.Next(0, stateStyles.Length)];
Deployers.ApiService (2)
Program.cs (2)
18Random.Shared.Next(-20, 55), 19summaries[Random.Shared.Next(summaries.Length)]
DotNetHostedAgent (2)
Program.cs (2)
41Random.Shared.Next(-20, 55), 42summaries[Random.Shared.Next(summaries.Length)]
ILCompiler.DependencyAnalysisFramework (3)
DependencyAnalyzer.cs (3)
48private readonly Random _randomizer; 50public RandomInsertStack(Random randomizer = null) 108Random stackPopRandomizer = null;
ILCompiler.ReadyToRun (5)
Compiler\FileLayoutOptimizer.cs (1)
198Random rand = new Random(0);
Compiler\ProfileDataManager.cs (4)
178Random rand = new Random(method.GetHashCode()); 261private List<TypeSystemEntityOrUnknown> SampleMethodsCompatibleWithDelegateInvocation(MethodSignature delegateSignature, Random rand) 269private List<TypeSystemEntityOrUnknown> SampleImplementers(TypeDesc type, Random rand) 277private List<TypeSystemEntityOrUnknown> PickSample<T>(IList<T> list, Random rand) where T : TypeSystemEntity
ILCompiler.RyuJit (1)
parent\ILCompiler.ReadyToRun\Compiler\FileLayoutOptimizer.cs (1)
198Random rand = new Random(0);
Keycloak.ApiService (2)
Program.cs (2)
34Random.Shared.Next(-20, 55), 35summaries[Random.Shared.Next(summaries.Length)]
Microsoft.Arcade.Common (1)
ExponentialRetry.cs (1)
13private Random _random = new Random();
Microsoft.AspNetCore.DataProtection (2)
KeyManagement\KeyRingProvider.cs (2)
65JitterRandom = Random.Shared; 72internal Random JitterRandom { get; set; }
Microsoft.AspNetCore.DataProtection.MicroBenchmarks (1)
Benchmarks\SpanDataProtectorComparison.cs (1)
76var random = new Random(42); // Fixed seed for consistent results
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (1)
RedisOutputCacheStore.cs (1)
98var secondsWithJitter = 300 + Random.Shared.Next(-30, 30);
Microsoft.Build.Framework (1)
Utilities\StringUtils.cs (1)
21Random.Shared.GetItems("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+_", dest));
Microsoft.CodeAnalysis (4)
DiagnosticAnalyzer\AnalyzerFileReference.cs (2)
653var random = 655Random.Shared;
InternalUtilities\TextKeyedCache.cs (2)
65private Random? _random; 244var r = _random;
Microsoft.CodeAnalysis.CSharp (35)
Utilities\IConstantValueSetFactory.cs (2)
28IConstantValueSet Random(int expectedSize, Random random); 33ConstantValue RandomValue(Random random);
Utilities\ValueSetFactory.BoolValueSetFactory.cs (2)
42IConstantValueSet IConstantValueSetFactory.Random(int expectedSize, Random random) => random.Next(4) switch 51ConstantValue IConstantValueSetFactory.RandomValue(Random random) => ConstantValue.Create(random.NextDouble() < 0.5);
Utilities\ValueSetFactory.ByteTC.cs (1)
61byte INumericTC<byte>.Random(Random random)
Utilities\ValueSetFactory.CharTC.cs (1)
64char INumericTC<char>.Random(Random random)
Utilities\ValueSetFactory.DecimalTC.cs (1)
115public decimal Random(Random random)
Utilities\ValueSetFactory.DecimalValueSetFactory.cs (2)
23IConstantValueSet IConstantValueSetFactory.Random(int expectedSize, Random random) => _underlying.Random(expectedSize, random); 25ConstantValue IConstantValueSetFactory.RandomValue(Random random) => ConstantValue.Create(DecimalTC.Instance.Random(random));
Utilities\ValueSetFactory.DoubleTC.cs (1)
101double INumericTC<double>.Random(Random random)
Utilities\ValueSetFactory.EnumeratedValueSetFactory.cs (2)
47public IConstantValueSet Random(int expectedSize, Random random) 58ConstantValue IConstantValueSetFactory.RandomValue(Random random)
Utilities\ValueSetFactory.FloatingValueSet.cs (1)
38internal static IConstantValueSet<TFloating> Random(int expectedSize, Random random, FloatingTC<TFloating> tc)
Utilities\ValueSetFactory.FloatingValueSetFactory.cs (2)
27IConstantValueSet IConstantValueSetFactory.Random(int expectedSize, Random random) => 30ConstantValue IConstantValueSetFactory.RandomValue(Random random)
Utilities\ValueSetFactory.IEqualableValueTC.cs (1)
35T[] RandomValues(int count, Random random, int scope = 0);
Utilities\ValueSetFactory.IntTC.cs (1)
71public int Random(Random random)
Utilities\ValueSetFactory.INumericTC.cs (1)
58T Random(Random random);
Utilities\ValueSetFactory.LongTC.cs (1)
61long INumericTC<long>.Random(Random random)
Utilities\ValueSetFactory.NintValueSetFactory.cs (2)
32IConstantValueSet IConstantValueSetFactory.Random(int expectedSize, Random random) 41ConstantValue IConstantValueSetFactory.RandomValue(Random random) => ConstantValue.CreateNativeInt(IntTC.DefaultInstance.Random(random));
Utilities\ValueSetFactory.NonNegativeIntValueSetFactory.cs (2)
53IConstantValueSet IConstantValueSetFactory.Random(int expectedSize, Random random) => s_underlying.Random(expectedSize, random); 55ConstantValue IConstantValueSetFactory.RandomValue(Random random) => s_underlying.RandomValue(random);
Utilities\ValueSetFactory.NuintValueSetFactory.cs (2)
31IConstantValueSet IConstantValueSetFactory.Random(int expectedSize, Random random) 39ConstantValue IConstantValueSetFactory.RandomValue(Random random) => ConstantValue.CreateNativeUInt(UIntTC.Instance.Random(random));
Utilities\ValueSetFactory.NumericValueSet.cs (1)
293internal static IConstantValueSet<T> Random(int expectedSize, Random random, INumericTC<T> tc)
Utilities\ValueSetFactory.NumericValueSetFactory.cs (2)
55public IConstantValueSet Random(int expectedSize, Random random) => 58ConstantValue IConstantValueSetFactory.RandomValue(Random random)
Utilities\ValueSetFactory.SByteTC.cs (1)
60sbyte INumericTC<sbyte>.Random(Random random)
Utilities\ValueSetFactory.ShortTC.cs (1)
61short INumericTC<short>.Random(Random random)
Utilities\ValueSetFactory.SingleTC.cs (1)
105float INumericTC<float>.Random(Random random)
Utilities\ValueSetFactory.StringTC.cs (1)
24string[] IEquatableValueTC<string>.RandomValues(int count, Random random, int scope)
Utilities\ValueSetFactory.UIntTC.cs (1)
61public uint Random(Random random)
Utilities\ValueSetFactory.ULongTC.cs (1)
61ulong INumericTC<ulong>.Random(Random random)
Utilities\ValueSetFactory.UShortTC.cs (1)
61ushort INumericTC<ushort>.Random(Random random)
Microsoft.CodeAnalysis.Workspaces (2)
Diagnostics\HostDiagnosticAnalyzers.cs (2)
276var random = 278Random.Shared;
Microsoft.Data.Analysis (3)
DataFrame.cs (1)
346Random rand = new Random();
DataFrame.IDataView.cs (2)
57DataViewRowCursor IDataView.GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand) 62DataViewRowCursor[] IDataView.GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand)
Microsoft.Extensions.AI.Abstractions.Tests (2)
Contents\DataContentTests.cs (1)
281Random rand = new(42);
Embeddings\BinaryEmbeddingTests.cs (1)
60Random r = new(42);
Microsoft.Extensions.Caching.Hybrid (1)
Internal\HybridCachePayload.cs (1)
38private static readonly Random _entropySource = new(); // doesn't need to be cryptographic
Microsoft.Extensions.Caching.Hybrid.Tests (4)
DistributedCacheTests.cs (3)
279var rand = new Random(); 356public CustomSegment(int size, Random? rand, CustomSegment? previous) 372public CustomMemory(int size, Random? rand = null)
TagSetTests.cs (1)
158var rand = new Random();
Microsoft.Extensions.Http.Diagnostics.Tests (1)
Logging\Internal\RandomStringGenerator.cs (1)
11private static readonly Random _random = new();
Microsoft.Extensions.Http.Resilience (2)
Internal\Randomizer.cs (2)
14public virtual double NextDouble(double maxValue) => Random.Shared.NextDouble() * maxValue; 16public virtual int NextInt(int maxValue) => Random.Shared.Next(maxValue);
Microsoft.Extensions.Options.Contextual.Tests (1)
AcceptanceTests.cs (1)
48private readonly Random _rng = new(0);
Microsoft.Extensions.TimeProvider.Testing.Tests (1)
TimerTests.cs (1)
333var random = new Random();
Microsoft.ML.AutoML (10)
API\BinaryClassificationExperiment.cs (1)
363private readonly Random _rnd;
API\MulticlassClassificationExperiment.cs (1)
348private readonly Random _rnd;
API\RegressionExperiment.cs (1)
368private readonly Random _rnd;
AutoMlUtils.cs (2)
15public static readonly ThreadLocal<Random> Random = new ThreadLocal<Random>(() => new Random());
Experiment\Experiment.cs (1)
38private Random _newContextSeedGenerator;
Sweepers\SmacSweeper.cs (1)
292Random r = new Random();
Tuner\PipelineProposer.cs (1)
41private readonly Random _rand;
Tuner\SmacTuner.cs (1)
29private readonly Random _rnd = new Random();
Utils\RandomNumberGenerator.cs (1)
11private readonly Random _random;
Microsoft.ML.AutoML.Samples (2)
AutoMLExperiment.cs (1)
89var random = new Random(seed);
Sweepable\SweepableLightGBMBinaryExperiment.cs (1)
116var random = new Random(seed);
Microsoft.ML.AutoML.Tests (1)
SweeperTests.cs (1)
150Random rand = new Random(0);
Microsoft.ML.Core (35)
Data\IHostEnvironment.cs (1)
131Random Rand { get; }
Environment\ConsoleEnvironment.cs (3)
394protected override IHost RegisterCore(HostEnvironmentBase<ConsoleEnvironment> source, string shortName, string parentFullName, Random rand, bool verbose) 465public Host(HostEnvironmentBase<ConsoleEnvironment> source, string shortName, string parentFullName, Random rand, bool verbose) 487protected override IHost RegisterCore(HostEnvironmentBase<ConsoleEnvironment> source, string shortName, string parentFullName, Random rand, bool verbose)
Environment\HostEnvironmentBase.cs (7)
122public Random Rand => _rand; 124public HostBase(HostEnvironmentBase<TEnv> source, string shortName, string parentFullName, Random rand, bool verbose) 142Random rand = (seed.HasValue) ? RandomUtils.Create(seed.Value) : RandomUtils.Create(_rand); 350private readonly Random _rand; 388protected HostEnvironmentBase(HostEnvironmentBase<TEnv> source, Random rand, bool verbose, 421Random rand = (seed.HasValue) ? RandomUtils.Create(seed.Value) : RandomUtils.Create(_rand); 436string parentFullName, Random rand, bool verbose);
Utilities\Random.cs (6)
15public static float NextSingle(this Random random) 32public static int NextSigned(this Random random) 76public static TauswortheHybrid Create(Random seed) 142public TauswortheHybrid(Random rng) 150private static uint GetU(Random rng) 155private static uint GetSeed(Random rng)
Utilities\ReservoirSampler.cs (4)
59private readonly Random _rnd; 70public ReservoirSamplerWithoutReplacement(Random rnd, int size, ValueGetter<T> getter) 138private readonly Random _rnd; 149public ReservoirSamplerWithReplacement(Random rnd, int size, ValueGetter<T> getter)
Utilities\Stats.cs (12)
22public static long SampleLong(long rangeSize, Random rand) 53public static double SampleFromGaussian(Random rand) 77public static double SampleFromGamma(Random r, double alpha) 113public static double SampleFromBeta(Random rand, double alpha1, double alpha2) 126public static void SampleFromDirichlet(Random rand, double[] alphas, double[] result) 143public static int SampleFromPoisson(Random rand, double lambda) 203public static float SampleFromLaplacian(Random rand, float mean, float scale) 222public static float SampleFromCauchy(Random rand) 235public static int SampleFromBinomial(Random r, int n, double p) 268public static int Next(Random rand, int n, double p) 286private static int InvTransform(int n, double p, Random rn) 310private static int GenerateLarge(int n, double p, Random rn)
Utilities\Utils.cs (2)
501public static int[] GetRandomPermutation(Random rand, int size) 545public static void Shuffle<T>(Random rand, Span<T> rgv)
Microsoft.ML.Core.Tests (6)
UnitTests\TestHosts.cs (1)
40Random rand = new Random();
UnitTests\TestVBuffer.cs (5)
951private static float ScaleFactor(int trial, Random rgen) 966private static void GenerateSingle(Random rgen, int len, out VBuffer<float> a) 972private static void GenerateVBuffer(Random rgen, int len, int count, out VBuffer<float> dst) 994private static void FillRandomIndices(Random rgen, int[] indices, int len, int count) 1087private static void GeneratePair(Random rgen, int len, out VBuffer<float> a, out VBuffer<float> b, out GenLogic subcase)
Microsoft.ML.CpuMath.PerformanceTests (2)
PerformanceTests.cs (2)
41private float NextFloat(Random rand, int expRange) 85Random rand = new Random(_seed);
Microsoft.ML.Data (115)
Data\DataViewUtils.cs (1)
114IDataView view, IEnumerable<DataViewSchema.Column> columnsNeeded, IHost host, Random rand)
Data\RowCursorUtils.cs (2)
525public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnNeeded, Random rand = null) 532public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnNeeded, int n, Random rand = null)
DataLoadSave\Binary\BinaryLoader.cs (5)
1189private DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 1195var ourRand = _randomShufflePoolRows == _header.RowCount ? null : rand; 1202public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 1208public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null) 1246public Cursor(BinaryLoader parent, IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand)
DataLoadSave\Binary\BinarySaver.cs (1)
740Random rand = data.CanShuffle ? new TauswortheHybrid(_host.Rand) : null;
DataLoadSave\Database\DatabaseLoader.cs (2)
720public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 727public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
DataLoadSave\LegacyCompositeDataLoader.cs (2)
585public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 593public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
DataLoadSave\Text\TextLoader.cs (2)
1662public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 1669public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
DataLoadSave\Transpose\TransposeLoader.cs (2)
622public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 630public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
DataView\AppendRowsDataView.cs (6)
147public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 154public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null) 309private readonly Random _rand; 313public RandCursor(AppendRowsDataView parent, IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand, int[] counts) 409private readonly Random _rand; 417public MultinomialWithoutReplacementSampler(IExceptionContext context, int[] counts, Random rand)
DataView\ArrayDataViewBuilder.cs (3)
235public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 243public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null) 265public Cursor(IChannelProvider provider, DataView view, Func<int, bool> predicate, Random rand)
DataView\BatchDataViewMapperBase.cs (2)
30public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 58public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
DataView\CacheDataView.cs (5)
209public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 229private int[] GetPermutationOrNull(Random rand) 243private DataViewRowCursor GetRowCursorWaiterCore<TWaiter>(TWaiter waiter, Func<int, bool> predicate, Random rand) 255public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null) 272private DataViewRowCursor[] GetRowCursorSetWaiterCore<TWaiter>(TWaiter waiter, Func<int, bool> predicate, int n, Random rand)
DataView\DataViewConstructionUtils.cs (6)
484public abstract DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null); 486public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null) 620public override DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 637Func<int, bool> predicate, Random rand) 703public override DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 772public override DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null)
DataView\EmptyDataView.cs (2)
33public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 39public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
DataView\LambdaFilter.cs (2)
111protected override DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 124public override DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
DataView\OpaqueDataView.cs (2)
28public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 31public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
DataView\RowToRowMapperTransform.cs (2)
189protected override DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 197public override DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
DataView\Transposer.cs (7)
287public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 290public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null) 831public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 842public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null) 862/// <param name="pred">The predicate input into the <see cref="GetRowCursor(IEnumerable{DataViewSchema.Column}, Random)"/> method.</param> 1449public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 1460public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
DataView\TypedCursor.cs (2)
182Random rand = randomSeed.HasValue ? RandomUtils.Create(randomSeed.Value) : null; 203public RowCursor<TRow>[] GetCursorSet(Func<int, bool> additionalColumnsPredicate, int n, Random rand)
DataView\ZipDataView.cs (2)
75public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 103public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
Dirty\ChooseColumnsByIndexTransform.cs (2)
245protected override DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 258public sealed override DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
Evaluators\AucAggregator.cs (6)
45protected AucAggregatorBase(Random rand, int reservoirSize) 125public UnweightedAucAggregator(Random rand, int reservoirSize) 226public WeightedAucAggregator(Random rand, int reservoirSize) 374protected AuPrcAggregatorBase(Random rand, int reservoirSize) 407public UnweightedAuPrcAggregator(Random rand, int reservoirSize) 481public WeightedAuPrcAggregator(Random rand, int reservoirSize)
Evaluators\RankingEvaluator.cs (2)
622public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 625public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
Prediction\Calibrator.cs (1)
1362private readonly Random _random;
Scorers\RowToRowScorerBase.cs (2)
129protected override DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 142public override DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
Training\TrainerUtils.cs (10)
248public static DataViewRowCursor CreateRowCursor(this RoleMappedData data, CursOpt opt, Random rand, IEnumerable<int> extraCols = null) 256CursOpt opt, int n, Random rand, IEnumerable<int> extraCols = null) 514protected static DataViewRowCursor CreateCursor(RoleMappedData data, CursOpt opt, Random rand, params int[] extraCols) 617/// The typed analog to <see cref="IDataView.GetRowCursor(IEnumerable{DataViewSchema.Column},Random)"/>. 623public TCurs Create(Random rand = null, params int[] extraCols) 644public TCurs[] CreateSet(int n, Random rand = null, params int[] extraCols) 736public StandardScalarCursor(RoleMappedData data, CursOpt opt, Random rand = null, params int[] extraCols) 826Random rand = null, params int[] extraCols) 893Random rand = null, params int[] extraCols) 962Random rand = null, params int[] extraCols)
Transforms\BootstrapSamplingTransformer.cs (4)
168protected override DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 179public override DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null) 189private readonly Random _rgen; 195public Cursor(BootstrapSamplingTransformer parent, DataViewRowCursor input, Random rgen)
Transforms\ColumnSelecting.cs (2)
679public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 692public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
Transforms\GenerateNumberTransform.cs (2)
337protected override DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 350public override DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
Transforms\NAFilter.cs (2)
207protected override DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 219public override DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
Transforms\NopTransform.cs (2)
120public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 123public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
Transforms\PerGroupTransformBase.cs (2)
157public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null) 163public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null)
Transforms\RangeFilter.cs (2)
208protected override DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 220public override DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
Transforms\RowShufflingTransformer.cs (7)
225public static DataViewRowCursor GetShuffledCursor(IChannelProvider provider, int poolRows, DataViewRowCursor cursor, Random rand) 251protected override DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 276Random myRandom = rand ?? (shouldShuffleMe || shouldShuffleSource ? RandomUtils.Create(_forceShuffleSeed) : null); 279Random sourceRand = shouldShuffleSource ? RandomUtils.Create(myRandom) : null; 290public override DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null) 467private readonly Random _rand; 502public Cursor(IChannelProvider provider, int poolRows, DataViewRowCursor input, Random rand)
Transforms\SkipTakeFilter.cs (2)
211protected override DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 220public override DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
Transforms\TransformBase.cs (6)
65public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 71var rng = CanShuffle ? rand : null; 99protected abstract DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null); 101public abstract DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null); 734protected override DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 746public sealed override DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
Utilities\LocalEnvironment.cs (3)
66protected override IHost RegisterCore(HostEnvironmentBase<LocalEnvironment> source, string shortName, string parentFullName, Random rand, bool verbose) 93public Host(HostEnvironmentBase<LocalEnvironment> source, string shortName, string parentFullName, Random rand, bool verbose) 115protected override IHost RegisterCore(HostEnvironmentBase<LocalEnvironment> source, string shortName, string parentFullName, Random rand, bool verbose)
Microsoft.ML.DataView (9)
IDataView.cs (9)
47/// <param name="rand">An instance of <see cref="Random"/> to seed randomizing the access for a shuffled cursor.</param> 48DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null); 57/// <see cref="GetRowCursor(IEnumerable{DataViewSchema.Column}, Random)"/>, except partitioned: no two cursors should return the 66/// <see cref="GetRowCursor(IEnumerable{DataViewSchema.Column}, Random)"/>. 70/// <param name="rand">An instance of <see cref="Random"/> to seed randomizing the access.</param> 72DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null); 105/// <see cref="IDataView.GetRowCursorSet(IEnumerable{DataViewSchema.Column}, int, Random)"/>. When getting a set, there is a need 110/// identically configured <see cref="IDataView.GetRowCursor(IEnumerable{DataViewSchema.Column}, Random)"/>. So: for any cursor 113/// <see cref="IDataView.GetRowCursorSet(IEnumerable{DataViewSchema.Column}, int, Random)"/>. In this way, order is determined by
Microsoft.ML.Ensemble (10)
Selector\FeatureSelector\AllFeatureSelector.cs (1)
25public Subset SelectFeatures(RoleMappedData data, Random rand)
Selector\FeatureSelector\RandomFeatureSelector.cs (1)
47public Subset SelectFeatures(RoleMappedData data, Random rand)
Selector\IFeatureSelector.cs (1)
14Subset SelectFeatures(RoleMappedData data, Random rand);
Selector\ISubsetSelector.cs (2)
16IEnumerable<Batch> GetBatches(Random rand); 17IEnumerable<Subset> GetSubsets(Batch batch, Random rand);
Selector\SubsetSelector\AllInstanceSelector.cs (1)
36public override IEnumerable<Subset> GetSubsets(Batch batch, Random rand)
Selector\SubsetSelector\BaseSubsetSelector.cs (2)
55public abstract IEnumerable<Subset> GetSubsets(Batch batch, Random rand); 57public IEnumerable<Batch> GetBatches(Random rand)
Selector\SubsetSelector\BootstrapSelector.cs (1)
46public override IEnumerable<Subset> GetSubsets(Batch batch, Random rand)
Selector\SubsetSelector\RandomPartitionSelector.cs (1)
38public override IEnumerable<Subset> GetSubsets(Batch batch, Random rand)
Microsoft.ML.Fairlearn (1)
Reductions\Utilities.cs (1)
26var rand = new Random();
Microsoft.ML.FastTree (22)
Dataset\Dataset.cs (1)
582Random rnd = new Random(randomSeed);
FastTree.cs (1)
92private Random _featureSelectionRandom;
RandomForestRegression.cs (1)
540private readonly Random _rgen;
SumupPerformanceCommand.cs (8)
104private IEnumerable<int> CreateDense(IChannel ch, Random rgen) 110private IEnumerable<int> CreateSparse(IChannel ch, Random rgen) 160Func<IChannel, Random, IEnumerable<int>> createIntArray; 177Random r = new Random(salt + i); 186private IEnumerator<double> Geometric(double p, Random rgen) 212private IEnumerable<int> CreateDocIndicesCore(double sparsity, Random rgen) 230private IEnumerable<int> CreateDocIndices(double sparsity, Random rgen) 240private void InitSumupInputData(SumupInputData data, double sparsity, Random rgen)
Training\Applications\ObjectiveFunction.cs (1)
27private readonly Random _rnd;
Training\BaggingProvider.cs (1)
15protected Random RndGenerator;
Training\DocumentPartitioning.cs (1)
169public double[] GetDistribution(double[] targets, double[] weights, int quantileSampleCount, Random rand, int leafCount, out double[] distributionWeights)
Training\EnsembleCompression\LassoBasedEnsembleCompressor.cs (1)
56private Random _rnd;
Training\OptimizationAlgorithms\OptimizationAlgorithm.cs (1)
37public Random DropoutRng;
Training\ScoreTracker.cs (1)
89Random rndStart = new Random(rngSeed);
Training\TreeLearners\LeastSquaresRegressionTreeLearner.cs (1)
66protected readonly Random Rand;
Utils\LinqExtensions.cs (3)
84public static int ArgMaxRand<T>(this IEnumerable<T> e, Random rnd, double fraction) where T : IComparable<T> 124public static int ArgMaxRand<T>(this IEnumerable<T> e, int prefix, Random rnd, double fraction) where T : IComparable<T> 251public static int SoftArgMax(this IEnumerable<double> values, Random rand)
Utils\PseudorandomFunction.cs (1)
20public PseudorandomFunction(Random rand)
Microsoft.ML.GenAI.Mistral (1)
MistralCausalLMAgent.cs (1)
162var random = new Random();
Microsoft.ML.IntegrationTests (8)
Datasets\Iris.cs (1)
42var rng = new Random(seed);
Datasets\TypeTestData.cs (5)
111var rng = new Random(seed); 121/// <param name="rng">A <see cref="Random"/> object.</param> 123public static TypeTestData GetRandomInstance(Random rng) 149private static ReadOnlyMemory<char> GetRandomCharSpan(Random rng, int length = 10) 157private static float[] GetRandomFloatArray(Random rng, int length)
DataTransformation.cs (1)
220var rng = new Random(seed);
Prediction.cs (1)
87var rnd = new Random(1);
Microsoft.ML.KMeansClustering (7)
KMeansPlusPlusTrainer.cs (7)
918(ref VBuffer<float> point, int pointRowIndex, float[] weights, Random rand) => 930(float[][] workStateWeights, Random rand, ref float[] weights) => 1615(ref VBuffer<float> point, int pointRowIndex, Heap<WeightedPoint> heap, Random rand) => 1651(Heap<WeightedPoint>[] heaps, Random rand, ref Heap<WeightedPoint> finalHeap) => 1690public delegate void MapAction<TPartitionState>(ref VBuffer<float> point, int rowIndex, TPartitionState state, Random rand); 1691public delegate void ReduceAction<TPartitionState, TGlobalState>(TPartitionState[] intermediates, Random rand, ref TGlobalState result); 1731Random rand = RandomUtils.Create(baseHost.Rand);
Microsoft.ML.LightGbm (6)
LightGbmTrainerBase.cs (6)
846private void GetFeatureValueDense(IChannel ch, FloatLabelCursor cursor, CategoricalMetaData catMetaData, Random rand, out ReadOnlySpan<float> featureValues) 884CategoricalMetaData catMetaData, Random rand, out ReadOnlySpan<int> indices, 942var rand = Host.Rand; 1032var rand = Host.Rand; 1133private void CopyToArray(IChannel ch, FloatLabelCursor cursor, float[] features, CategoricalMetaData catMetaData, Random rand, ref int numElem) 1172int[] indices, float[] features, CategoricalMetaData catMetaData, Random rand, ref int numElem)
Microsoft.ML.Parquet (8)
ParquetLoader.cs (4)
394public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 400public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null) 446private readonly Random _rand; 448public Cursor(ParquetLoader parent, IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand)
PartitionedFileLoader.cs (4)
297public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 302public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null) 388public Cursor(IChannelProvider provider, PartitionedFileLoader parent, IMultiStreamSource files, IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand) 648private IEnumerable<int> CreateFileOrder(Random rand)
Microsoft.ML.PCA (2)
PcaTrainer.cs (1)
283var rng = new Random(seed);
PcaTransformer.cs (1)
309var rnd = columns[iinfo].Seed == null ? Host.Rand : new Random(columns[iinfo].Seed.Value);
Microsoft.ML.PerformanceTests (4)
BenchmarkBase.cs (3)
64Random random = new Random(1); 74public static string CreateRandomLine(int columns, int maxWordLength, Random random) 85public static string CreateRandomColumn(int numwords, int maxWordLength, Random random)
CacheDataViewBench.cs (1)
60var rand = new Random(0);
Microsoft.ML.Predictor.Tests (4)
TestTransposer.cs (4)
106int rowCount, Double density, Random rgen, Func<T> generator, int slotCount, params int[] forceDenseSlot) 139private static T[] GenerateHelper<T>(int rowCount, Double density, Random rgen, Func<T> generator) 155Random rgen = new Random(0); 221Random rgen = new Random(1);
Microsoft.ML.Samples (98)
Dynamic\DataOperations\CrossValidationSplit.cs (1)
179var random = new Random(seed);
Dynamic\DataOperations\DataViewEnumerable.cs (1)
89var rng = new Random(1234321);
Dynamic\DataOperations\FilterRowsByColumn.cs (1)
89var rng = new Random(1234321);
Dynamic\DataOperations\LoadingSvmLight.cs (1)
15var random = new Random(42);
Dynamic\DataOperations\LoadingText.cs (1)
17var random = new Random(1);
Dynamic\DataOperations\ShuffleRows.cs (1)
77var rng = new Random(1234321);
Dynamic\DataOperations\SkipRows.cs (1)
81var rng = new Random(1234321);
Dynamic\DataOperations\TakeRows.cs (1)
82var rng = new Random(1234321);
Dynamic\DataOperations\TrainTestSplit.cs (1)
86var random = new Random(seed);
Dynamic\SimpleDataViewImplementation.cs (2)
173Random rand = null) 180Random rand = null)
Dynamic\Trainers\BinaryClassification\AveragedPerceptron.cs (1)
88var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\AveragedPerceptronWithOptions.cs (1)
99var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\FactorizationMachine.cs (1)
96var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\FastForest.cs (1)
91var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\FastForestWithOptions.cs (1)
103var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\FastTree.cs (1)
94var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\FastTreeWithOptions.cs (1)
106var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\FieldAwareFactorizationMachine.cs (1)
145var rnd = new Random(seed);
Dynamic\Trainers\BinaryClassification\FieldAwareFactorizationMachineWithOptions.cs (1)
156var rnd = new Random(seed);
Dynamic\Trainers\BinaryClassification\Gam.cs (1)
145var rng = new Random(seed);
Dynamic\Trainers\BinaryClassification\GamWithOptions.cs (1)
152var rng = new Random(seed);
Dynamic\Trainers\BinaryClassification\LbfgsLogisticRegression.cs (1)
91var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\LbfgsLogisticRegressionWithOptions.cs (1)
100var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\LdSvm.cs (1)
88var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\LdSvmWithOptions.cs (1)
97var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\LightGbm.cs (1)
91var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\LightGbmWithOptions.cs (1)
102var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\LinearSvm.cs (1)
88var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\LinearSvmWithOptions.cs (1)
97var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\PermutationFeatureImportance.cs (1)
100var rng = new Random(seed);
Dynamic\Trainers\BinaryClassification\PermutationFeatureImportanceLoadFromDisk.cs (1)
86var rng = new Random(seed);
Dynamic\Trainers\BinaryClassification\PriorTrainer.cs (1)
88var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\SdcaLogisticRegression.cs (1)
96var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\SdcaLogisticRegressionWithOptions.cs (1)
108var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\SdcaNonCalibrated.cs (1)
95var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\SdcaNonCalibratedWithOptions.cs (1)
110var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\SgdCalibrated.cs (1)
88var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\SgdCalibratedWithOptions.cs (1)
100var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\SgdNonCalibrated.cs (1)
88var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\SgdNonCalibratedWithOptions.cs (1)
97var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\SymbolicSgdLogisticRegression.cs (1)
91var random = new Random(seed);
Dynamic\Trainers\BinaryClassification\SymbolicSgdLogisticRegressionWithOptions.cs (1)
100var random = new Random(seed);
Dynamic\Trainers\Clustering\KMeans.cs (1)
95var random = new Random(seed);
Dynamic\Trainers\Clustering\KMeansWithOptions.cs (1)
103var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\LbfgsMaximumEntropy.cs (1)
92var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\LbfgsMaximumEntropyWithOptions.cs (1)
100var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\LightGbm.cs (1)
95var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\LightGbmWithOptions.cs (1)
105var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\LogLossPerClass.cs (1)
75var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\NaiveBayes.cs (1)
100var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\OneVersusAll.cs (1)
93var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\PairwiseCoupling.cs (1)
93var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\PermutationFeatureImportance.cs (1)
104var rng = new Random(seed);
Dynamic\Trainers\MulticlassClassification\PermutationFeatureImportanceLoadFromDisk.cs (1)
113var rng = new Random(seed);
Dynamic\Trainers\MulticlassClassification\SdcaMaximumEntropy.cs (1)
99var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\SdcaMaximumEntropyWithOptions.cs (1)
109var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\SdcaNonCalibrated.cs (1)
100var random = new Random(seed);
Dynamic\Trainers\MulticlassClassification\SdcaNonCalibratedWithOptions.cs (1)
109var random = new Random(seed);
Dynamic\Trainers\Ranking\FastTree.cs (1)
74var random = new Random(seed);
Dynamic\Trainers\Ranking\FastTreeWithOptions.cs (1)
88var random = new Random(seed);
Dynamic\Trainers\Ranking\LightGbm.cs (1)
74var random = new Random(seed);
Dynamic\Trainers\Ranking\LightGbmWithOptions.cs (1)
89var random = new Random(seed);
Dynamic\Trainers\Ranking\PermutationFeatureImportance.cs (1)
114var rng = new Random(seed);
Dynamic\Trainers\Ranking\PermutationFeatureImportanceLoadFromDisk.cs (1)
121var rng = new Random(seed);
Dynamic\Trainers\Regression\FastForest.cs (1)
75var random = new Random(seed);
Dynamic\Trainers\Regression\FastForestWithOptions.cs (1)
88var random = new Random(seed);
Dynamic\Trainers\Regression\FastTree.cs (1)
75var random = new Random(seed);
Dynamic\Trainers\Regression\FastTreeTweedie.cs (1)
75var random = new Random(seed);
Dynamic\Trainers\Regression\FastTreeTweedieWithOptions.cs (1)
90var random = new Random(seed);
Dynamic\Trainers\Regression\FastTreeWithOptions.cs (1)
91var random = new Random(seed);
Dynamic\Trainers\Regression\Gam.cs (1)
75var random = new Random(seed);
Dynamic\Trainers\Regression\GamAdvanced.cs (1)
143var rng = new Random(seed);
Dynamic\Trainers\Regression\GamWithOptions.cs (1)
86var random = new Random(seed);
Dynamic\Trainers\Regression\GamWithOptionsAdvanced.cs (1)
151var rng = new Random(seed);
Dynamic\Trainers\Regression\LbfgsPoissonRegression.cs (1)
73var random = new Random(seed);
Dynamic\Trainers\Regression\LbfgsPoissonRegressionWithOptions.cs (1)
87var random = new Random(seed);
Dynamic\Trainers\Regression\LightGbm.cs (1)
76var random = new Random(seed);
Dynamic\Trainers\Regression\LightGbmWithOptions.cs (1)
95var random = new Random(seed);
Dynamic\Trainers\Regression\OnlineGradientDescent.cs (1)
64var random = new Random(seed);
Dynamic\Trainers\Regression\OnlineGradientDescentWithOptions.cs (1)
80var random = new Random(seed);
Dynamic\Trainers\Regression\OrdinaryLeastSquares.cs (1)
72var random = new Random(seed);
Dynamic\Trainers\Regression\OrdinaryLeastSquaresWithOptions.cs (1)
84var random = new Random(seed);
Dynamic\Trainers\Regression\PermutationFeatureImportance.cs (1)
110var rng = new Random(seed);
Dynamic\Trainers\Regression\PermutationFeatureImportanceLoadFromDisk.cs (1)
117var rng = new Random(seed);
Dynamic\Trainers\Regression\Sdca.cs (1)
72var random = new Random(seed);
Dynamic\Trainers\Regression\SdcaWithOptions.cs (1)
88var random = new Random(seed);
Dynamic\Transforms\CalculateFeatureContribution.cs (1)
119var rng = new Random(seed);
Dynamic\Transforms\CalculateFeatureContributionCalibrated.cs (1)
126var rng = new Random(seed);
Dynamic\Transforms\Conversion\MapKeyToValueMultiColumn.cs (1)
91var rnd = new Random(0);
Dynamic\Transforms\ImageAnalytics\ConvertToImage.cs (1)
97var random = new Random(seed);
Dynamic\Transforms\TreeFeaturization\FastForestBinaryFeaturizationWithOptions.cs (1)
125var random = new Random(seed);
Dynamic\Transforms\TreeFeaturization\FastForestRegressionFeaturizationWithOptions.cs (1)
126var random = new Random(seed);
Dynamic\Transforms\TreeFeaturization\FastTreeBinaryFeaturizationWithOptions.cs (1)
127var random = new Random(seed);
Dynamic\Transforms\TreeFeaturization\FastTreeRankingFeaturizationWithOptions.cs (1)
123var random = new Random(seed);
Dynamic\Transforms\TreeFeaturization\FastTreeRegressionFeaturizationWithOptions.cs (1)
126var random = new Random(seed);
Dynamic\Transforms\TreeFeaturization\FastTreeTweedieFeaturizationWithOptions.cs (1)
126var random = new Random(seed);
Dynamic\Transforms\TreeFeaturization\PretrainedTreeEnsembleFeaturizationWithOptions.cs (1)
134var random = new Random(seed);
Microsoft.ML.SamplesUtils (4)
SamplesDatasetUtils.cs (4)
246var rnd = new Random(0); 295var rnd = new Random(0); 309var rnd = new Random(0); 365var rnd = new Random(0);
Microsoft.ML.SearchSpace (1)
Tuner\RandomTuner.cs (1)
12private readonly Random _rnd;
Microsoft.ML.StandardTrainers (19)
FactorizationMachine\FactorizationMachineTrainer.cs (2)
307var rng = _host.Rand; 456var rng = shuffle ? _host.Rand : null;
LdSvm\LdSvmTrainer.cs (6)
497public abstract IEnumerable<VBuffer<float>> SampleForGammaUpdate(Random rand); 498public abstract IEnumerable<LabelFeatures> SampleExamples(Random rand); 529public override IEnumerable<LabelFeatures> SampleExamples(Random rand) 547public override IEnumerable<VBuffer<float>> SampleForGammaUpdate(Random rand) 582public override IEnumerable<VBuffer<float>> SampleForGammaUpdate(Random rand) 618public override IEnumerable<LabelFeatures> SampleExamples(Random rand)
Optimizer\DifferentiableFunction.cs (4)
163private static readonly Random _r = new Random(5); 260Random r = new Random(5); 299Random r = new Random(5); 356private static float SampleFromGaussian(Random r)
Standard\Online\OnlineLinear.cs (1)
322var rand = shuffle ? Host.Rand : null;
Standard\SdcaBinary.cs (4)
561var rands = new Random[maxIterations]; 790private protected virtual void TrainWithoutLock(IProgressChannelProvider progress, FloatLabelCursor.Factory cursorFactory, Random rand, 2108var trainingTasks = new Action<Random, IProgressChannel>[_options.NumberOfIterations]; 2109var rands = new Random[_options.NumberOfIterations];
Standard\SdcaMulticlass.cs (1)
174private protected override void TrainWithoutLock(IProgressChannelProvider progress, FloatLabelCursor.Factory cursorFactory, Random rand,
Standard\Simple\SimpleTrainers.cs (1)
58private readonly Random _random;
Microsoft.ML.Sweeper (3)
Algorithms\KdoSweeper.cs (1)
260Random rng = new Random();
Algorithms\SmacSweeper.cs (1)
301Random r = new Random();
Algorithms\SweeperProbabilityUtils.cs (1)
14private readonly Random _rng;
Microsoft.ML.Sweeper.Tests (9)
TestSweeper.cs (9)
69var random = new Random(123); 132var random = new Random(42); 182var random = new Random(42); 232var random = new Random(42); 300var random = new Random(42); 352var random = new Random(42); 540var random = new Random(42); 596var random = new Random(42); 644var random = new Random(42);
Microsoft.ML.TestFramework (1)
DataPipe\TestDataPipe.cs (1)
1169Random rgen = new Random(0);
Microsoft.ML.Tests (19)
CalibratedModelParametersTests.cs (1)
99var rand = new Random(10);
FastTreeSumupParityTests.cs (4)
140var rand = new Random(7); 157var rand = new Random(101); 237var rand = new Random(seed); 278var rand = new Random(seed);
FeatureContributionTests.cs (1)
260var rand = new Random(10);
ImagesTests.cs (1)
1103var random = new Random(seed);
PermutationFeatureImportanceTests.cs (2)
817var rand = new Random(10); 884var rand = new Random(10);
Scenarios\Api\CookbookSamples\CookbookSamplesDynamicApi.cs (1)
487var r = new Random(454);
Scenarios\ClusteringTests.cs (1)
34var rand = new Random(1);
TrainerEstimators\FAFMEstimator.cs (1)
124var rnd = new Random(0);
TrainerEstimators\TreeEstimators.cs (1)
727var random = new Random(seed);
Transformers\LineParserTests.cs (1)
56Random rand = new Random();
Transformers\NormalizerTests.cs (3)
1111var rand = new Random(seed); 1182Random rand = new Random(0); 1256Random rand = new Random(0);
Transformers\RffTests.cs (2)
45Random rand = new Random(); 93Random rand = new Random();
Microsoft.ML.TimeSeries (7)
PValueTransform.cs (1)
111private Random _randomGen;
SequentialTransformBase.cs (2)
377protected override DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 390public override DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
SequentialTransformerBase.cs (4)
565protected override DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 582public override DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null) 866protected override DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 875public override DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
Microsoft.ML.Tokenizers (1)
Model\Word.cs (1)
14private static Random? _random;
Microsoft.ML.Transforms (28)
CustomMappingFilter.cs (4)
37public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 51public abstract DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null); 73public override DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null) 153public override DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
Dracula\CountTableTransformer.cs (2)
686var rand = _addNoise ? new Random(_parent.Seeds[iinfo]) : null; 706var rand = _addNoise ? new Random(_parent.Seeds[iinfo]) : null;
Dracula\Featurizer.cs (2)
138public void GetFeatures(int iCol, int iSlot, Random rand, long key, Span<float> features) 171private float AddLaplacianNoisePerLabel(int iCol, Random rand, Span<float> counts)
FourierDistributionSampler.cs (3)
67public abstract float Next(Random rand); 184public override float Next(Random rand) 307public override float Next(Random rand)
GroupTransform.cs (2)
158protected override DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 174public override DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
OptionalColumnTransform.cs (2)
323protected override DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 336public override DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
ProduceIdTransform.cs (2)
140protected override DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 153public override DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
RandomFourierFeaturizing.cs (1)
301var rng = columns[i].Seed.HasValue ? RandomUtils.Create(columns[i].Seed.Value) : Host.Rand;
StatefulCustomMappingTransformer.cs (2)
129public override DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null) 229protected override DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null)
StatefulFilterTransform.cs (2)
103public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 115public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null)
SvmLight\SvmLightLoader.cs (4)
424public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 431public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null) 791public DataViewRowCursor GetRowCursor(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) => _view.GetRowCursor(columnsNeeded, rand); 793public DataViewRowCursor[] GetRowCursorSet(IEnumerable<DataViewSchema.Column> columnsNeeded, int n, Random rand = null) => _view.GetRowCursorSet(columnsNeeded, n, rand);
UngroupTransform.cs (2)
180protected override DataViewRowCursor GetRowCursorCore(IEnumerable<DataViewSchema.Column> columnsNeeded, Random rand = null) 191int n, Random rand = null)
Microsoft.NET.Build.Tasks (2)
GenerateBundle.cs (2)
16private readonly Random _jitter = 18Random.Shared;
Microsoft.Win32.SystemEvents (1)
Microsoft\Win32\SystemEvents.cs (1)
29private static readonly Random s_randomTimerId = new Random();
MilvusPlayground.ApiService (1)
Program.cs (1)
45Random ran = new();
mscorlib (1)
parent\ref\mscorlib.cs (1)
390[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Random))]
netstandard (1)
netstandard.cs (1)
1354[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Random))]
ProxylessEndToEnd.ApiService (1)
Program.cs (1)
17return Random.Shared.Next();
ScenarioTests.Common.Tests (2)
ScenarioTestHelpers.cs (1)
237Random rand = new Random(seed);
ScenarioTestTypes.cs (1)
1139Random rand = new Random(seed);
Seq.ApiService (1)
Program.cs (1)
25var number = Random.Shared.Next(min, max);
Shared.Tests (5)
Pools\PoolTests.cs (1)
266var r = new Random(seed);
Throw\ThrowTest.cs (4)
144Random? somethingThatIsNull = null; 157Random? somethingThatIsNull = null; 158Random? somethingNestedThatIsNull = null; 174Random? somethingNestedThatIsNull = null;
Stress.ApiService (19)
ProducerConsumer.cs (2)
40await Task.Delay(Random.Shared.Next(10, 50)); 53await Task.Delay(Random.Shared.Next(10, 50));
Program.cs (5)
79var random = new Random(); 107metrics.RecordHistogram(Random.Shared.NextDouble(), new TagList()); 190if (Random.Shared.Next(2) == 0) 231var random = new Random(); 416Random.Shared.Next(-20, 55),
TestMetrics.cs (1)
42uploadSpeed.Add(Random.Shared.Next(5, 10));
TraceCreator.cs (11)
43await Task.Delay(Random.Shared.Next(10, 50)); 69if (Random.Shared.NextDouble() > 0.05) 106await Task.Delay(Random.Shared.Next(10, 50)); 110await Task.Delay(Random.Shared.Next(10, 50)); 116var eventCount = Random.Shared.Next(0, 5); 120var tagsCount = Random.Shared.Next(0, 5); 132var activityLinkCount = Random.Shared.Next(0, Math.Min(5, _allActivities.Count)); 138var tagsCount = Random.Shared.Next(0, 3); 145if (!IncludeBrokenLinks || Random.Shared.Next() % 2 == 0) 147var a = _allActivities[Random.Shared.Next(0, _allActivities.Count)]; 157if (Random.Shared.Next() % 2 == 0)
Stress.AppHost (2)
TestResource.cs (2)
164var seconds = Random.Shared.Next(2, 12); 177var randomState = states[Random.Shared.Next(0, states.Length)];
Stress.TelemetryService (1)
TelemetryStresser.cs (1)
38value += Random.Shared.Next(0, 10);
System.Collections.Concurrent (1)
System\Collections\Concurrent\ConcurrentStack.cs (1)
631backoff = Random.Shared.Next(1, BACKOFF_MAX_YIELDS);
System.Data.Odbc (1)
Common\System\Data\ProviderBase\DbConnectionPool.cs (1)
96private static readonly Random s_random = new Random(5101977); // Value obtained from Dave Driver
System.Data.OleDb (1)
System\Data\ProviderBase\DbConnectionPool.cs (1)
336private static readonly Random _random = new Random(5101977); // Value obtained from Dave Driver
System.DirectoryServices (1)
System\DirectoryServices\ActiveDirectory\Utils.cs (1)
945Random random = new Random();
System.Linq (11)
System\Linq\Shuffle.cs (1)
67Random.Shared.Shuffle(buffer);
System\Linq\Shuffle.SpeedOpt.cs (10)
17Random.Shared.Shuffle(array); 24Random.Shared.Shuffle(CollectionsMarshal.AsSpan(list)); 47return iterator.TryGetElementAt(Random.Shared.Next(0, iteratorCount), out found); 56return list[Random.Shared.Next(0, listCount)]; 172return iterator.TryGetElementAt(Random.Shared.Next(0, iteratorCount), out found); 181return list[Random.Shared.Next(0, count)]; 223int r = Random.Shared.Next(i + 1); 257long r = Random.Shared.NextInt64(i); 279Random.Shared.Shuffle(CollectionsMarshal.AsSpan(reservoir)); 378return Random.Shared.NextDouble() > probOfDrawingZeroMatches;
System.Linq.AsyncEnumerable (1)
System\Linq\Shuffle.cs (1)
38Random.Shared.Shuffle(array);
System.Net.Ping (1)
System\Net\NetworkInformation\Ping.RawSocket.cs (1)
28ushort id = (ushort)Random.Shared.Next(ushort.MaxValue + 1);
System.Numerics.Tensors (10)
System\Numerics\Tensors\netcore\Tensor.cs (10)
366/// Fills the given <see cref="TensorSpan{T}"/> with random data in a Gaussian normal distribution. <see cref="Random"/> 371/// <param name="random"><see cref="Random"/> to provide random seeding. Defaults to <see cref="Random.Shared"/> if not provided.</param> 373public static ref readonly TensorSpan<T> FillGaussianNormalDistribution<T>(in TensorSpan<T> destination, Random? random = null) where T : IFloatingPoint<T> 375random ??= Random.Shared; 404/// Fills the given <see cref="TensorSpan{T}"/> with random data in a uniform distribution. <see cref="Random"/> 409/// <param name="random"><see cref="Random"/> to provide random seeding. Defaults to <see cref="Random.Shared"/> if not provided.</param> 411public static ref readonly TensorSpan<T> FillUniformDistribution<T>(in TensorSpan<T> destination, Random? random = null) where T : IFloatingPoint<T> 413random ??= Random.Shared;
System.Private.CoreLib (14)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Random.CompatImpl.cs (4)
118/// <summary>Reference to the <see cref="Random"/> containing this implementation instance.</summary> 120private readonly Random _parent; 126public CompatDerivedImpl(Random parent) : this(parent, Shared.Next()) { } 128public CompatDerivedImpl(Random parent, int seed)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Random.cs (5)
30/// <summary>Initializes a new instance of the <see cref="Random"/> class using a default seed value.</summary> 35_impl = GetType() == typeof(Random) ? new XoshiroImpl() : new CompatDerivedImpl(this); 46_impl = GetType() == typeof(Random) ? new CompatSeedImpl(Seed) : new CompatDerivedImpl(this, Seed); 56/// <summary>Provides a thread-safe <see cref="Random"/> instance that may be used concurrently from any thread.</summary> 57public static Random Shared { get; } = new ThreadSafeRandom();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.HillClimbing.cs (2)
75private readonly Random.XoshiroImpl _randomIntervalGenerator = new Random.XoshiroImpl();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (2)
1134public readonly Random.XoshiroImpl random = new Random.XoshiroImpl();
System\Runtime\CompilerServices\RuntimeHelpers.NativeAot.cs (1)
82return Random.Shared.Next();
System.Runtime (1)
src\runtime\artifacts\obj\System.Runtime\Release\net11.0\System.Runtime.Forwards.cs (1)
428[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Random))]
System.Runtime.Extensions (1)
System.Runtime.Extensions.cs (1)
26[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Random))]
System.ServiceModel.NetNamedPipe (1)
System\Runtime\BackoffTimeoutHelper.cs (1)
17private readonly Random _random;
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\Regex.Cache.cs (1)
77private static readonly Random s_random = new Random();
System.Threading.Tasks.Parallel (1)
System\Threading\Tasks\TaskReplicator.cs (1)
166return 100 + Random.Shared.Next(0, 50 * Environment.ProcessorCount);
TestingAppHost1.MyWebApp (2)
Program.cs (2)
29Random.Shared.Next(-20, 55), 30summaries[Random.Shared.Next(summaries.Length)]
TestProject.AppHost (1)
TestProgram.cs (1)
65builder.Configuration["DcpPublisher:ResourceNameSuffix"] = $"{Random.Shared.Next():x}";
Yarp.Backend (2)
Program.cs (2)
25Random.Shared.Next(-20, 55), 26summaries[Random.Shared.Next(summaries.Length)]