jasmcaus / opencv-course

Learn OpenCV in 4 Hours - Code used in my Python and OpenCV course on freeCodeCamp.
https://youtu.be/oXlwWbU8l2o
MIT License
1.11k stars 955 forks source link

execution of line 63 produces error #8

Closed harryhancock closed 3 years ago

harryhancock commented 3 years ago

TypeError Traceback (most recent call last)

in 59 60 # Creating train and validation data ---> 61 split_data = train_test_split(featureSet, labels, val_ratio=.2) 62 x_train, x_val, y_train, y_val = (np.array(item) for item in split_data) 63 /opt/conda/lib/python3.7/site-packages/sklearn/model_selection/_split.py in train_test_split(*arrays, **options) 2123 2124 if options: -> 2125 raise TypeError("Invalid parameters passed: %s" % str(options)) 2126 2127 arrays = indexable(*arrays) TypeError: Invalid parameters passed: {'val_ratio': 0.2} Has something to do with line 63, and change to train_test_split function: # Creating train and validation data split_data = train_test_split(featureSet, labels, val_ratio=.2) x_train, x_val, y_train, y_val = (np.array(item) for item in split_data)
jasmcaus commented 3 years ago

Thanks for pointing this out! I've fixed this in a commit. Closing this issue now. Feel free to open it if need be.