mercredi 6 mai 2020

What is the relationship between np random seed with evaluation score of machine learning model

image

np.random.seed(40)

    for i in range(1,100,10):

    print(f'trying model with {i} estimator..')

    cls=RandomForestClassifier(n_estimators=i)

    cls.fit(X_train,y_train)

    print(f'model accuracy on test set {cls.score(X_test,y_test)*100:0.2f}%')

can anyone please tell me why score is changing when i remove np.random.seed(40)... what relation do it have with cls.score .....




Aucun commentaire:

Enregistrer un commentaire