-
Notifications
You must be signed in to change notification settings - Fork 59
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
Add random_state to HyperparameterOptimization class - Fixes for #125 #131
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3b238c7
set seed for numpy
papaemman 81483f4
Revert "set seed for numpy"
papaemman 8dbc83f
add a random_state argument
papaemman 7c57c38
Merge pull request #3 from papaemman/add_random_state
papaemman 365f8bd
add random state for hyperopt fmin function
papaemman 4a7e6e5
Merge pull request #4 from papaemman/add_random_state
papaemman 9a567dd
add rstate for hyperparameter optimization and add a test for it
papaemman 3063b57
Merge pull request #5 from papaemman/add_random_state
papaemman 75af498
fixed MR comments
sayanchk 7fd2720
fix attempt for ci cd
sayanchk b6bcd1c
fix attempt 2 for ci cd
sayanchk 9972515
fix attempt 3 for ci cd
sayanchk d831b49
fix attempt 4 for ci cd
sayanchk ab804a3
version update for a minor fix release
sayanchk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .random_state_validation import check_random_state |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import numpy as np | ||
import numbers | ||
|
||
def check_random_state(seed): | ||
"""Turn seed into a np.random.RandomState instance | ||
|
||
:param int seed: seed for the random state | ||
:return: None, int or instance of RandomState | ||
If seed is None, return the RandomState singleton used by np.random. | ||
If seed is an int, return a new RandomState instance seeded with seed. | ||
If seed is already a RandomState instance, return it. | ||
Otherwise raise ValueError. | ||
:rtype: np.random.RandomState or None | ||
""" | ||
if seed is None or seed is np.random: | ||
return np.random.mtrand._rand | ||
if isinstance(seed, numbers.Integral): | ||
return np.random.RandomState(seed) | ||
if isinstance(seed, np.random.RandomState): | ||
return seed | ||
raise ValueError( | ||
"%r cannot be used to seed a numpy.random.RandomState instance" % seed | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
|
||
setup( | ||
name='luminaire', | ||
version='0.4.2', | ||
version='0.4.3', | ||
|
||
license='Apache License 2.0', | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add upper bounds due to this serialization issue with pandas and higher pandas and statsmodels versions. Will open a separate issues to look into these.