Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Feb 2, 2020

Conversation

najeeb-kazmi
Copy link
Member

Fixes #4752

@harishsk harishsk merged commit 6f2e94f into dotnet:master Feb 2, 2020
if (samplingKeyColumn == null)
{
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