Which loss function shoud be chosen when use eval_metric in CatBoostRegressor?

Viewed 877

I use this code to test my dataset with CatBoostRegressor.

import pandas as pd
from sklearn.model_selection import train_test_split
import catboost
# from sklearn.model_selection import KFold
from sklearn.feature_selection import RFECV

train_data = pd.read_csv('train.txt',sep='\t')
test_data = pd.read_csv('test.txt',sep='\t')
X = train_data.iloc[:,:-1]
y = train_data['target']
model = catboost.CatBoostRegressor(
                           #loss_function="?",#Which loss function matches the RMSE?
                           eval_metric="RMSE",
                           task_type="GPU",
                           learning_rate=0.01,
                           iterations=10000,
                           random_seed=42,
                           od_type="Iter",
                           depth=10,
                           early_stopping_rounds=500
                          )
rfecv = RFECV(estimator = model,cv = 5,scoring = 'neg_mean_squared_error')
rfecv.fit(X, y)
df = pd.DataFrame(rfecv.predict(test_data))
df.to_csv("my.txt", index=False, header=False)

My eval_metric is RMSE. Actually I want to use MSE, but I found that there is no MSE in eval_metric.

I want to use loss_function in CatBoostRegressor,but which loss function matches the RMSE?

The output of the program is like this.

0:  learn: 0.9764416    total: 392ms    remaining: 1h 5m 19s
1:  learn: 0.9688846    total: 1.24s    remaining: 1h 43m 13s
2:  learn: 0.9612971    total: 1.8s     remaining: 1h 40m 9s
3:  learn: 0.9538684    total: 2.59s    remaining: 1h 47m 46s
4:  learn: 0.9464696    total: 3.21s    remaining: 1h 47m 3s
5:  learn: 0.9393371    total: 3.88s    remaining: 1h 47m 43s
6:  learn: 0.9322354    total: 4.33s    remaining: 1h 42m 57s
7:  learn: 0.9251417    total: 4.88s    remaining: 1h 41m 30s
8:  learn: 0.9180682    total: 5.6s     remaining: 1h 43m 36s
9:  learn: 0.9110297    total: 6.22s    remaining: 1h 43m 38s
10: learn: 0.9040694    total: 7s       remaining: 1h 45m 53s
11: learn: 0.8972301    total: 7.64s    remaining: 1h 45m 59s
……

I can't see loss and RMSE. What should I add to output loss and RMSE?

0 Answers
Related