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
Tpot examples do not seem to differentiate/evolve? #503
Comments
I think the population size of 50 and generation number of 5 in examples may be too small to show evolving. |
Right. Does it work better if you set |
Actually, while working on a new extension to TPOT and analyzing my results, I found the same issue to be true (in both the 'vanilla' 0.8.1 version of TPOT and my extension). EDIT: I made a mistake on when to log the population, over representing the amount of duplicates and cache hits. This mistake is currently present in the above notebook. |
Wow, that's a lot of duplicates! I wonder if we can change the mutation/xover functions to only produce individuals not in the cache using the pre_check function, @weixuanfu2016? |
FWIW I upped the pop size to 150 on the iris example and 1st gen at .990909090909091 with no changes beyond that in subsequent generations was looking for something to really show the power that I assume is here! |
@dartdog Good to hear! Indeed, the initial population seems to be generated fairly diverse :) so that would align with getting better results by increasing population size (even in the 1st generation). @rhiever I think you can do this in the
to
Of course you probably want to use a for-loop defining some amount of max tries instead to avoid infinite loops. However, I would still try and see if the behavior is caused by a bug. Considering 30% of individuals will have a random insert mutation each generation (on average), it seems very weird to me that can get 99% cache hits consistently. Edit: As stated below, bug was with logging, actual numbers rise much more slowly. |
Oops! It turns out the problem does exist, but is not as severe as stated in the notebook. In addition to changing where the logging happens, I now also have a direct duplicate/cache hit counter directly where they happen in the code in |
@rhiever that is a good idea. I will work on it. @PG-TUe thank you for the notebook and idea. Maybe my understanding of @dartdog check the partial log below, I saw that scores changed in the early generations but fixed in the later generations. I think this problem in the example is easy for getting a very good pipeline in the early generations. As mentioned above, lower population diversity in later populations is indeed a concern for slowing down optimization process. I will work on a solution to increase population diversity in later generations.
|
@weixuanfu2016 No, your idea of cache hits was correct. As stated just before you made your post (you probably missed it since you were typing yours), I made a mistake raising cache-hits significantly (specifically, I counted logged the My new results are just in (with correct logging) and results are similar to yours. Here is a (quickly and badly made) bar chart link. |
@PG-TUe thank you for double-checking it! |
I still think the suggested changes to |
Thank you for the suggestion. I have a little concern that it might cause a infinite loop. Could you please make a PR for these suggested changes? We could test it later.
… On Jun 22, 2017, at 8:20 PM, PG-TUe ***@***.***> wrote:
I still think the suggested changes to _random_mutation_operator and _mate_operator, or alternatively _pre_test would be a good!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#503 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AUG7KmY1_Rlfm4MWCLwWI_Wn2hmHHpnDks5sGwTbgaJpZM4OBlIm>.
|
@PG-TUe I will work on this PR and test it since it is just some small changes. |
@weixuanfu2016 I actually worked on this before I managed to check in here ^^;; |
FYI my new results following the advice here, now shows progress, I do have xxgboost installed so that is why I don't get that message,, but wondering, why don't I get these lines?
also would be very nice to have more insight as to what is going on internally? What is being tried?
|
@dartdog
From the top of my head, I am not sure what is exposed in the most recent version of TPOT, but I think you can access results of all evaluated pipelines with small tip: to show code blocks, instead of using a single quote, use three, i.e.:
|
@weixuanfu2016 I worked on the issue, my work can be found here: https://github.com/PG-TUe/tpot/tree/no_repeats
The reason I did not commit a pull request yet is because the last point is circumventing a problem, rather than fixing it. While two individuals with each only one Primitive can have crossover, they must have the same typed terminals (in our case, this means that it would be the same base learner), in this case cross over will swap out a terminal (in our case, a parameter value). The problems of duplicates in a generation was largely removed by the fact that mutation and crossover now almost always provide a new individual, rather than one seen before. I ran the same setup as yesterday (digits, 10 pop, 50 gens), though I cut it short after 20 generations, because they take much longer now, with all these new individuals ;) I think that in practice, this solution is probably good enough (for now). |
tpot.evaluated_individuals_ looks quite helpful... at this point all I can think of is maybe a way to pretty the output up? |
@dartdog
I got something like this:
For the final line, we could 'prettify'
to
Anything else you had in mind? |
actually the output of tpot.evaluated_individuals_ in a more attractive format? It is a bit dump like...
|
Okay, that makes sense. At this point I would like to defer from going into this aspect any further on this specific issue-thread. |
feel free to close as to not pile things up proc=pd.DataFrame(tpot.evaluated_individuals_)
|
@dartdog Will do once the respective pull request is made. |
@PG-TUe Thank you for the fixes. For crossover, I think only one individual with at least 2 Primitive in a pair can make a crossover. We also need to change crossover operator for this purpose. For example:
Though crossover may not make big difference comparing with mutation. I think you can make a PR for these fixes. |
@weixuanfu2016 The length of an individual is defined by the number of primitives and terminals (code you linked).
So two individuals are eligble for crossover if they have any one terminal in common. I will go ahead and make a PR. * technically all one-primitives individuals have one terminal type in common regardless of primitive types, which is the terminal with |
Further,, (sorry)
|
the scores in |
Closing this issue for now. Please feel free to re-open if you have any more questions or comments. |
Running the example the initial optimization values found do not change?
Context of the issue
so for instance on the Iris classifier example I ran it and got the following:
/home/tom/anaconda3/envs/py36n/lib/python3.6/site-packages/sklearn/cross_validation.py:44: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
"This module will be removed in 0.20.", DeprecationWarning)
Optimization Progress: 31%|███ | 92/300 [00:23<00:32, 6.41pipeline/s]
Generation 1 - Current best internal CV score: 0.9746376811594203
Optimization Progress: 47%|████▋ | 141/300 [00:39<00:30, 5.23pipeline/s]
Generation 2 - Current best internal CV score: 0.9746376811594203
Optimization Progress: 63%|██████▎ | 190/300 [00:50<00:14, 7.69pipeline/s]
Generation 3 - Current best internal CV score: 0.9746376811594203
Optimization Progress: 77%|███████▋ | 231/300 [00:57<00:07, 8.68pipeline/s]
Generation 4 - Current best internal CV score: 0.9746376811594203
Generation 5 - Current best internal CV score: 0.9746376811594203
Best pipeline: GaussianNB(input_matrix)
0.921052631579
So best internal CV score Never changes..
Seeing the same when running the Minst example.. IE no change in scores..
One would expect to see some search activity with differing values??
minst output:
Optimization Progress: 31%|███▏ | 94/300 [05:29<04:56, 1.44s/pipeline]
Generation 1 - Current best internal CV score: 0.9859273244941604
Optimization Progress: 48%|████▊ | 143/300 [10:57<12:22, 4.73s/pipeline]
Generation 2 - Current best internal CV score: 0.9859273244941604
Optimization Progress: 62%|██████▏ | 187/300 [13:09<04:19, 2.30s/pipeline]
Generation 3 - Current best internal CV score: 0.9859273244941604
Optimization Progress: 77%|███████▋ | 231/300 [15:04<03:09, 2.74s/pipeline]
Generation 4 - Current best internal CV score: 0.9859273244941604
Generation 5 - Current best internal CV score: 0.9859273244941604
Best pipeline: LinearSVC(PolynomialFeatures(input_matrix, PolynomialFeatures__degree=2, PolynomialFeatures__include_bias=DEFAULT, PolynomialFeatures__interaction_only=DEFAULT), LinearSVC__C=0.0001, LinearSVC__dual=True, LinearSVC__loss=DEFAULT, LinearSVC__penalty=l2, LinearSVC__tol=0.1)
0.986666666667
The text was updated successfully, but these errors were encountered: