R2Score as a metric in 09_tabular error

So I was trying different metrics for the tabular_learner in 09_tabular notebook and got the following error when I tried using the coefficient of determination R^2:

TypeError: R2Score() takes from 0 to 1 positional arguments but 2 were given

Does anybody know why this is happening?

Did you pass R2Score instead of R2Score() as your metric by any chance? I believe that should fix it :slight_smile:

2 Likes

Wow, this was the problem! I spent so much time getting frustrated with each passing minute. Thank you very much!

1 Like