Closed Zeroto521 closed 4 years ago
Thank you for reporting this issue.
Since there are codes (see here) to ensure that there is a least one example from each class and I think it is safe to delete that parameter to avoid this issue.
I fixed it via PR #1129 and it will be merged to development branch soon. And It will be included in next release of TPOT later this month.
For testing the development branch, you may install TPOT with patch into your environment via:
pip install --upgrade --no-deps --force-reinstall git+https://github.com/EpistasisLab/tpot.git@development
I will try this later.
It seems no problem in these days.
Context of the issue & Process to reproduce the issue
There was a data called
y
, its shape was(n, )
and its type waspd.Series
.Its
value_counts
function result likes below.Then let try to use
topt.fit
function.The Error came out.
Possible fix
So I looked into the source code and found a way how to fix it.
https://github.com/EpistasisLab/tpot/blob/219f8c5abe43996abb2c19d6a1767083304a23d3/tpot/tpot.py#L53-L60
stratify=target
should be the problem.From the data
value_counts
, we know11
and12
only show one time.After deleting or noting that parameter, the thing is alright
We should deal with this condition.