I practice XGBClassifier() to predict the target in iris dataset. here is the code:
#iris dataset, set data to X and target to y
iris = datasets.load_iris()
X = iris.data
y = iris.target
#import datasets from sklearn, train_test_split from sklearn.model_selection
X_train, x_test , y_train, y_test = train_test_split(X, y, test_size=0.20, random_state=1)
model = XGBClassifier(n_estimators = 100, learning_rate = 0.1,verbosity = 1, random_state = 1)
model.fit(X_train, y_train)
y_pred = model.predict(X_test)
from sklearn.metrics import mean_squared_error as MSE
rmse = np.sqrt(MSE(y_train,y_pred))
print(rmse)
when I use mean_squared_error from sklean.metrics I get an error
ValueError: Found input variables with inconsistent numbers of samples: [120, 30]