ValueError: Found input variables with inconsistent numbers of samples: [103, 10838]

X_train,X_test, y_train, y_test =
cross_validation.train_test_split(train_data,train_target,test_size=0.4, random_state=0)

You are running into that error because your train_data and train_target don't have the same length (which is what train_test_split requires), i.e., X.shape[0] != Y.shape[0]

简单点说就是train_data和train_target长度必须保持一致

你可能感兴趣的:(ValueError: Found input variables with inconsistent numbers of samples: [103, 10838])