I am a newbie in machine learning using python and pandas dataframe. I am training my model and making predictions on the x_test(dataframe). I want to make the predictions for each row(sample) in the x_test and want to append that row to a new dataframe(new_train) if the prediction value is less than some value(0.4). I have provided the body of my idea. Could you please help me out?
c = XGBRegressor()
dt = c.fit(x_train, y_train)
new_train = pd.DataFrame()
for rows in x_test:
y_pred = c.predict(x_test[rows])
if y_pred < 0.4:
new_train.append(x_test[rows])