![]() |
n_estimators error - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Data Science (https://python-forum.io/forum-44.html) +--- Thread: n_estimators error (/thread-24273.html) |
n_estimators error - Scott - Feb-07-2020 I ran a Genetic Algorithm and got recommended the following pipeline: Best pipeline: ExtraTreesRegressor(LinearSVR(input_matrix, C=0.001, dual=True, epsilon=0.001, loss=squared_epsilon_insensitive, tol=0.0001), bootstrap=True, max_features=0.55, min_samples_leaf=12, min_samples_split=13, n_estimators=100) I tried running the below and got this error: ET = ExtraTreesRegressor(LinearSVR(C=0.001, dual=True, epsilon=0.001, loss='squared_epsilon_insensitive', tol=0.0001), bootstrap=True, max_features=0.55, min_samples_leaf=12, min_samples_split=13, n_estimators=100) %time ET.fit(kgb_x, kgb_y) I am assuming input matrix is the data and predictors as I could find no hyper-parameter information about it. I am getting the below error: --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-33-275935d83b8e> in <module>() 1 ET = ExtraTreesRegressor(LinearSVR(C=0.001, dual=True, epsilon=0.001, loss='squared_epsilon_insensitive', tol=0.0001), ----> 2 bootstrap=True, max_features=0.55, min_samples_leaf=12, min_samples_split=13, n_estimators=100) 3 4 get_ipython().magic('time ET.fit(kgb_x, kgb_y)') TypeError: __init__() got multiple values for argument 'n_estimators' Can anyone see where I have multiple n_estmators? Thanks RE: n_estimators error - scidam - Feb-07-2020 According to official docs, the first argument of ExtraTreesRegressor is the number of estimators. You passed LinearSVR(C=0.001, dual=True, epsilon=0.001, loss='squared_epsilon_insensitive', tol=0.0001) as its first argument and, finally, you define n_estimators=100 as last argument. So, you defined n_estimators twice.
|