[Python] Invalid classes inferred from unique values of `y`. Expected: [0 1 2 3 4 5], got [1 2...

Discussão em 'Python' iniciado por Stack, Fevereiro 17, 2025.

  1. Stack

    Stack Membro Participativo

    I've trained dataset using XGB Classifier, but I got this error in local. It worked on Colab and also my friends don't have any problem with same code. I don't know what that error means...

    Invalid classes inferred from unique values of y. Expected: [0 1 2 3 4 5], got [1 2 3 4 5 6]

    this is my code, but I guess it's not the reason.

    start_time = time.time()
    xgb = XGBClassifier(n_estimators = 400, learning_rate = 0.1, max_depth = 3)
    xgb.fit(X_train.values, y_train)
    print('Fit time : ', time.time() - start_time)

    Continue reading...

Compartilhe esta Página