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
Customed Metric Function executes Twice? #208
Comments
Sorry but I don't understand what your problem is, most of the output is missing. Have you removed/edited some of the output? As I cannot run any code, recreate your problem, understand what commands you have run, there is very little I can do to help without more information. |
@trevorstephens ,Sorry for my expression. |
Without a reproducible example it's near impossible for me to look into this. It's possible this is the out of bag fitness being calculated? I won't comment further without a full reproducible example of the problem you wish to solve. Impossible to know what you are doing |
Try crafting a toy dataset with your problem using the sklearn blobs or something like that, otherwise I cannot look into what is happening. |
`import pandas as pd rng = check_random_state(0) def _my_metric(y, y_pred, w): function_set = ['add', 'sub', 'mul', 'div', @trevorstephens .It seems that I have encountered a new problem. Why did I add ‘print(value)’ in the custom metric function, but did not print the metric result in the process of training the model? |
My output looks like this:
The reason the output is doubled is because you activated sampling with
If you set
Actually the OOB fitness and the other fitness technically shouldn't be the same. Not sure if this is a bug. Could be because of the datatset and the size. |
The problem is that you didn't include the parameter Your fitness function needs to look like this:
Your output will then look like this:
Also, I have to say your custom fitness function is bad for evaluation. |
Thx @hwulfmeyer thought it was probably the OOB fitness, appreciate you helping out! 😄 |
@hwulfmeyer I got it, thank you very much! By the way, the function was created casually, i'll never use it. haha! |
Hello,
I custom a metric function, and print the metric result every time when a new formula is generated. But I find the metric function will be executed twice each time, just like the image below. It doubles the training time, so can you help me figure out the reason?
Thank you very much!
The text was updated successfully, but these errors were encountered: