我尝试使用CatBoostRegressor
但我在预测中得到了一些负面价值。
我该如何解决?
所有代码
X_train, y_train = train[['Distance', 'DepTime']].values, train['dep_delayed_15min'].map({'Y': 1, 'N': 0}).values
X_test = test[['Distance', 'DepTime']].values
X_train_part, X_valid, y_train_part, y_valid = train_test_split(X_train, y_train, test_size=0.3, random_state=17)
model_cbr = CatBoostRegressor(iterations=500, loss_function='RMSE', learning_rate=1, depth=7).fit(X_train, y_train)
predictions = model_cbc.predict(X_test)