Export weights (formula) from Random Forest Regressor in Scikit-Learn I trained a prediction model with Scikit Learn in Python (Random Forest Regressor) and I want to extract somehow the weights of each feature to create an excel tool for manual prediction.

The only thing that I found is the model.feature_importances_ but it doesn't help.

Is there any way to achieve it?

def performRandomForest(X_train, y_train, X_test, y_test):

    '''Perform Random Forest Regression'''

    from sklearn.ensemble  import  RandomForestRegressor

    model  =  RandomForestRegressor()
    model.fit( X_train , y_train )

    #make predictions
    expected  = y_test
    predicted  = model.predict( X_test )

    #summarize the fit of the model
    mse  = np.mean(( predicted - expected )** 2)
    accuracy = ( model.score ( X_train , y_train ))

    return model, mse, accuracy


At the moment, I use the model.predict([features]) to do it, but I need it in an excel file.
The SKompiler library might help:

from skompiler import skompile
skompile(rf.predict_proba).to('excel')


Check out this video.