You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello @WillKoehrsen, thanks for your magic functions.
However, I tried to follow the tutorial for my CSV file for a regression learning, and in the end I received a message. Here are the codes:
/content/feature_selector.py in identify_zero_importance(self, task, eval_metric, n_iterations, early_stopping)
304 if early_stopping:
305
--> 306 train_features, valid_features, train_labels, valid_labels = train_test_split(features, labels, test_size = 0.15)
307
308 # Train the model with early stopping
/usr/local/lib/python3.6/dist-packages/sklearn/model_selection/_split.py in train_test_split(*arrays, **options)
2029 test_size = 0.25
2030
-> 2031 arrays = indexable(*arrays)
2032
2033 if shuffle is False:
/usr/local/lib/python3.6/dist-packages/sklearn/utils/validation.py in indexable(*iterables)
227 else:
228 result.append(np.array(X))
--> 229 check_consistent_length(*result)
230 return result
231
/usr/local/lib/python3.6/dist-packages/sklearn/utils/validation.py in check_consistent_length(*arrays)
202 if len(uniques) > 1:
203 raise ValueError("Found input variables with inconsistent numbers of"
--> 204 " samples: %r" % [int(l) for l in lengths])
205
206
ValueError: Found input variables with inconsistent numbers of samples: [25446, 1]
Environment: Google colab
Python version: 3.6.3
Thank you in advance.
The text was updated successfully, but these errors were encountered:
Hello @WillKoehrsen, thanks for your magic functions.
However, I tried to follow the tutorial for my CSV file for a regression learning, and in the end I received a message. Here are the codes:
` file_name = 'GYT_0.csv'
train = pd.read_csv(io.StringIO(uploaded[file_name].decode('ISO-8859-1')),sep=';')
train_labels = ['Delaitotal']
train = train.drop(columns = ['Delaitotal'])
fs = FeatureSelector(data = train, labels = train_labels)
fs.identify_zero_importance(task = 'regression',eval_metric = 'l2') `
Here is the message:
ValueError Traceback (most recent call last)
in ()
1
2
----> 3 fs.identify_zero_importance(task = 'regression',eval_metric = 'l2')
4
5
/content/feature_selector.py in identify_zero_importance(self, task, eval_metric, n_iterations, early_stopping)
304 if early_stopping:
305
--> 306 train_features, valid_features, train_labels, valid_labels = train_test_split(features, labels, test_size = 0.15)
307
308 # Train the model with early stopping
/usr/local/lib/python3.6/dist-packages/sklearn/model_selection/_split.py in train_test_split(*arrays, **options)
2029 test_size = 0.25
2030
-> 2031 arrays = indexable(*arrays)
2032
2033 if shuffle is False:
/usr/local/lib/python3.6/dist-packages/sklearn/utils/validation.py in indexable(*iterables)
227 else:
228 result.append(np.array(X))
--> 229 check_consistent_length(*result)
230 return result
231
/usr/local/lib/python3.6/dist-packages/sklearn/utils/validation.py in check_consistent_length(*arrays)
202 if len(uniques) > 1:
203 raise ValueError("Found input variables with inconsistent numbers of"
--> 204 " samples: %r" % [int(l) for l in lengths])
205
206
ValueError: Found input variables with inconsistent numbers of samples: [25446, 1]
Environment: Google colab
Python version: 3.6.3
Thank you in advance.
The text was updated successfully, but these errors were encountered: