Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
n_estimators error
#1
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
Reply
#2
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.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020