@ashivani X_val,y_val = X_val.iloc[:,:-1],X_val.iloc[:,-1] it showing too many indexers errors, as X_val contains only one column
@ashivani y_pred = classifier.predict(X_val)
shows error X has 16 features per sample; expecting 17 like this.
Hey,
Rerun the cell in which we are splitting the data into train and validation set. The error occurs because after splitting we are using the same variable name “X_val” and removing the target column from it in, due to which its size is decreasing by 1 column.
1 Like