Machine Learning - Training and Testing - Training and Testing in Sklearn
Machine Learning Training and Testing Training and Testing in Sklearn We have 2d numpy array X of 100 datapoints and 4 features and 1d array y of 100 target values. What is the output of this code? X_train, X_test, y_train, y_test = train_test_split(X, y) print(X_train.shape, y_train.shape) what i've tried : 1 already search the https://www.sololearn.com/Discuss and google but no enlight for this question 2 tested in jupyter notebook pip install -U sklearn import numpy as np from sklearn.model_selection import train_test_split X = np.array([[100], [4] ] ) y = np.array(100) X_train, X_test, y_train, y_test = train_test_split(X, y) traceback error TypeError: Singleton array array(100) cannot be considered a valid collection. my question : how to get the result ? ( ___1___ , ___2___ ) ( ___3___ ,) thanks