What can I do if I have a distribution that includes multiple types?
datavistics opened this issue · 4 comments
I have a scenario where some values are a range and a string type. Is there a way to have a more complex distribution?
{var1: [range(1,10), 'None']}
Hi, Thanks for asking your question.
The answer depends on your context, some of the simple workarounds are as below:
- {var1: [range(1,11)]}, Where, 11th value can represent 'None', then in your objective function your can consider 11th value differently.
- Define separately two vars, so now in objective function you can consider var2 for selection of 'None' values.
{var1: [range(1,10)],
var2: ['None', 'SomthingElse']}
If this doesn't work for you, let me know more about your scenario, and I will try to provide you a working Mango code for your case.
regards,
Sandeep.
Closing this issue, please feel free to open it, if needed.
Hey @sandeep-iitr , sorry I missed the notification.
Option 1 looks like a workaround that could work.
Understanding option 2: Does "SomethingElse" mean that its going to take the value from var1?
From an optimization standpoint which is better? Im leaning towards option 2.
From an optimization standpoint, using option-1 is better when 'None' has some form of relationship (In the decision boundary of your function) with other var1: in range(1,10). If such a relationship exists Mango will be able to do better. If such a relationship doesn't exist, then it will still optimize it but may not extrapolate internally as it should do.
In both, cases Mango will work and will give you a reasonable solution. Generally, using fewer dimensions helps to find an optimal solution with few iterations. So if you don't know what the decision boundary of your function looks like, then Option-1 has fewer dimensions and will be a good choice.
Yes, in option 2: Does "SomethingElse" mean that it is going to take the value from var1. You can also test both on a small problem in your use case and see which one works well for your setting.