You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to fit my TPOTRegressor using a customized scoring function. I have followed the instructions as per given on the website but it throws an error.
defrmsl_error(y, h):
""" Compute the Root Mean Squared Log Error for hypothesis h and targets y Args: h - numpy array containing predictions with shape (n_samples, n_targets) y - numpy array containing targets with shape (n_samples, n_targets) """returnnp.sqrt(np.square(np.log(h+1) -np.log(y+1)).mean())
fromsklearn.metrics.scorerimportmake_scorermy_custom_scorer=make_scorer(rmsl_error, greater_is_better=False)
fromtpotimportTPOTRegressor#del final_df['day']tpot=TPOTRegressor(generations=10, population_size=50, verbosity=2,n_jobs=-1,cv=iter_cv,scoring=my_custom_scorer)
print ('aaaaaaaaaaaaaaaaa')
tpot.fit(final_df.iloc[:,final_df.columns!='count'].values,final_df.iloc[:,6].values)
print ('bbbbbbbbbbbbbbbb')
The following is the screenshot of the error message:
Same function works fine for any other regressor
The text was updated successfully, but these errors were encountered:
Please check the issue #645 . I think it is a notebook-related issue. You may not use n_jobs > 1 with customized scoring functions using current version (0.9.1) of TPOT in Jupyter notebook. Also I fixed another bug in the new scoring API and merged into dev branch. I will work on this issue and release a patch soon.
I am trying to fit my TPOTRegressor using a customized scoring function. I have followed the instructions as per given on the website but it throws an error.
The following is the screenshot of the error message:
Same function works fine for any other regressor
The text was updated successfully, but these errors were encountered: