1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] LightGBM Error When Trying to Continue Training

Discussão em 'Python' iniciado por Stack, Setembro 11, 2024.

  1. Stack

    Stack Membro Participativo

    I have an existing LightGBM model. I'm trying to continue training on. It has 9 features. I'm trying to add a 10th. I don't have the source materials for the original file, only the 9Models.txt file that is used for the booster.

    data = np.array(data)
    label = np.array(label)
    params = {}
    train_data = lgb.Dataset(data, label=label, free_raw_data=False)
    gbm = lgb.train(params, train_data, keep_training_booster=True, num_boost_round = 10, init_model='9Models.txt')


    When I try to run this, I get:

    lightgbm.basic.LightGBMError: The number of features in data (1) is not the same as it was in training data (11).


    I'm at a loss for what to do next here.

    I tried changing parameters, I tried setting:

    predict_disable_shape_check=true

    but that leads to this error:

    lightgbm.basic.LightGBMError: Number of class for initial score error

    Continue reading...

Compartilhe esta Página