Generation

generate functionMon, 27 Mar 2023

The code below gives a ValueError: Input variables with an inconsistent number of samples were found: [8082, 5572]. Fix it! from sklearn.model_selection import train_test_split X_train, X_test, y_train, y_test = train_test_split(tfidf, cats, test_size=0.3, random_state=42)

def fix_data(X_train, X_test, y_train, y_test): return X_train[:y_train.shape[0]], X_test[:y_test.shape[0]], y_train, y_test

Questions about programming?Chat with your personal AI assistant