Traffic-Signs-Detect-German icon indicating copy to clipboard operation
Traffic-Signs-Detect-German copied to clipboard

sklearn.cross_vaildation deprecated, StratifiedShuffleSplit not working

Open Lugges991 opened this issue 6 years ago • 6 comments

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

Lugges991 avatar Jan 02 '19 13:01 Lugges991

Greetings,

Did you fix the issue for the latest scikit version? Kindly share the changes.

Thank you.

v-prgmr avatar Apr 11 '19 08:04 v-prgmr

I was stuck on this. any update?

NandhaKishorM avatar Jun 11 '19 15:06 NandhaKishorM

I wrote my own script for generating tfrecords.

v-prgmr avatar Jun 11 '19 15:06 v-prgmr

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 .

NandhaKishorM avatar Jun 11 '19 15:06 NandhaKishorM

can you share the code

NandhaKishorM avatar Jun 11 '19 16:06 NandhaKishorM

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

Mkemp63 avatar Oct 09 '19 14:10 Mkemp63