+4 votes
in Machine Learning by (73.8k points)
I trained the model using the default parameters of CatBoost. Is there any way to know the learning rate used for training the model?

1 Answer

+3 votes
by (348k points)
selected by
 
Best answer

Attribute "learning_rate_ " of the CatBoost classifier can be used to find the learning rate used for training.

This following examples show how to use this attribute.

from catboost import CatBoostClassifier
import numpy as np

def generate_train_data():
    """
    Randomly generate train test data and labels
    """
    np.random.seed(7)

    # train data
    feature_count = 10
    train_data_count = 500
    train_data = np.reshape(np.random.random(train_data_count * feature_count), (train_data_count, feature_count))
    train_labels = np.round(np.random.random(train_data_count))

    return train_data, train_labels

if __name__ == "__main__":
    X_train, y_train = generate_train_data()

    # train the model
    model = CatBoostClassifier(verbose=False)
    model.fit(X_train, y_train)

    # get the learning rate
    print("Learning rate: ", model.learning_rate_)


...