Skip to content

Data splits to default to MLContext seed when not specified#4764

Merged
harishsk merged 1 commit intodotnet:masterfrom
najeeb-kazmi:4752
Feb 2, 2020
Merged

Data splits to default to MLContext seed when not specified#4764
harishsk merged 1 commit intodotnet:masterfrom
najeeb-kazmi:4752

Conversation

@najeeb-kazmi
Copy link
Member

Fixes #4752

@najeeb-kazmi najeeb-kazmi requested a review from a team as a code owner February 1, 2020 01:35
@harishsk harishsk merged commit 6f2e94f into dotnet:master Feb 2, 2020
{
samplingKeyColumn = data.Schema.GetTempColumnName("SamplingKeyColumn");
data = new GenerateNumberTransform(env, data, samplingKeyColumn, (uint?)seed);
data = new GenerateNumberTransform(env, data, samplingKeyColumn, (uint?)(seed ?? host.Rand.Next()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why fallback to host.Rand.Next() instead of the fixed seed given to the MLContext?

I think this is doing (1), then (4) from: #4752 (comment)

TrainTestSplit etc should listen to MLContext seed if not given by the user for the specific component.

I think the precedence for PRNG seeds should be:

  1. User seed specified for the component instance (or from parent component if hiding behind another)
  2. User seed specified in MLContext
  3. Default seed in component (unsure if we should remove these, might be a component-by-component discussion)
  4. Random (and more random than current -- see Use a GUID when creating the temp path #4645 (comment))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MLContext seed isn't exposed, i.e. I cannot directly use mlContext.Seed. The seed for Host.Rand is set from MLContext though.

@najeeb-kazmi najeeb-kazmi deleted the 4752 branch February 13, 2020 22:39
@ghost ghost locked as resolved and limited conversation to collaborators Mar 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default seed is not propagated from MLContext

3 participants