Traffic-Signs-Detect-German
Traffic-Signs-Detect-German copied to clipboard
sklearn.cross_vaildation deprecated, StratifiedShuffleSplit not working
Hello,
with the current version of sklearn, 0.20.2, the stratifiedshufflesplit function in the jupyter notebook file gts.ipynb does not work any more. This is due to sklearn.cross_validation being deprecated. If this repo is still being actively maintained, a fix would be appreciated, otherwise I would issue a pull request.
Best regards
Greetings,
Did you fix the issue for the latest scikit version? Kindly share the changes.
Thank you.
I was stuck on this. any update?
I wrote my own script for generating tfrecords.
Kindly share the code
On 11 Jun 2019 9:03 pm, "Vishal Rajendra Kumar" [email protected] wrote:
I wrote my own script for generating tfrecords.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/xfqbuaa/Traffic-Signs-Detect-German/issues/3?email_source=notifications&email_token=ALS677GNTDKCHFWZHPUEYZTPZ7AWJA5CNFSM4GM2VX3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXNRGYQ#issuecomment-500896610, or mute the thread https://github.com/notifications/unsubscribe-auth/ALS677FYBIDHEZQLSYGQCVTPZ7AWJANCNFSM4GM2VX3A .
can you share the code
can you share the code
Sorry for the ugly code, but this is my fix
def stratifiedshufflesplit(data, test_size=0.3, thres=1):
y_less = data.groupby("id").filter(lambda x: len(x) <= thres)
data = pd.concat([data, y_less], ignore_index=True)
X = data['img']
y = data['id']
sss = StratifiedShuffleSplit(n_splits=1, test_size=test_size)
train_index, test_index = list(*sss.split(X, y))
X_train, X_test = data.iloc[train_index], data.iloc[test_index]
return X_train, X_test