So, I've been trying to split my dataset into a 70-30 ratio using train_test_split
in order to work things out with sklearn
's PLS. However, I encountered an error that says:
# Read data
df = pd.read_csv(
filepath_or_buffer='colontumor.csv',
header=None,
sep=',')
df.tail()
X = df.iloc[:, :-1].values
# Split data to train and test on 70-30 ratio
X_train, X_test = train_test_split(
X, test_size=0.30, random_state=None)
pls = PLSRegression(n_components=2)
pls.fit(X_train, X_test)
Y_pred = pls2.predict(X_train)
and somehow encountered this error:
Line (17): pls.fit(X_train, X_test)
ValueError: Found input variables with inconsistent numbers of samples: [43, 19]
Is there any solution for this? I've been circling around for like hours now.