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

Feature addition, add noise to mimic #42

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

parkds
Copy link
Contributor

@parkds parkds commented Oct 11, 2019

This feature lets users add noise to mimic.

Users can add an optional "noise" argument to set the noise between 0.00 ~ 0.10, which corresponds to 0 to 10% noise. (Which gets renormalized). The default is set to 0.

0.01 corresponds to adding 1% probability to all probabilities and conditional probabilities to the features and then renormalizing them.

Adopted from 4.3 Refining Samples Generated by MIMIC in Randomized Local Search as Successive Estimation of Probability Densities by Charles L. Isbell, Jr.

Copy link
Owner

@gkhayes gkhayes left a comment

Choose a reason for hiding this comment

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

Hi @parkds,
Thanks for making this PR. I've recommended a few minor changes, but once those are made, I'm happy to merge, as it looks pretty good.
Regards,
Genevieve.

@@ -456,7 +456,7 @@ def genetic_alg(problem, pop_size=200, mutation_prob=0.1, max_attempts=10,


def mimic(problem, pop_size=200, keep_pct=0.2, max_attempts=10,
max_iters=np.inf, curve=False, random_state=None, fast_mimic=False):
max_iters=np.inf, curve=False, random_state=None, fast_mimic=False,noise=0):
Copy link
Owner

Choose a reason for hiding this comment

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

Could you please update the parameters list to include a description of the noise parameter.

@@ -272,6 +272,7 @@ def __init__(self, length, fitness_fn, maximize=True, max_val=2):
self.sample_order = []
self.prob_type = 'discrete'
self.mimic_speed = False
self.noise=0
Copy link
Owner

Choose a reason for hiding this comment

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

I can't see where self.noise gets updated to the noise value set in the mimic function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants