Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receiving strange TypeError #40

Closed
finbarrtimbers opened this issue Jan 5, 2017 · 4 comments
Closed

Receiving strange TypeError #40

finbarrtimbers opened this issue Jan 5, 2017 · 4 comments

Comments

@finbarrtimbers
Copy link

I have the following code:

df = pd.read_csv('data.csv', header=0, engine='c')
mat = df.as_matrix()
X = mat[:, 1:]
X_train, X_test = train_test_split(X, test_size = 0.2)
variance = forestci.random_forest_error(model, X_train, X_test)

When I run it, it throws the error TypeError: random_forest_error() takes exactly 4 arguments (3 given).

However, there are only three non-optional arguments listed in the documentation.
If I add a fourth argument for inbag, I then get an error saying that inbag is defined twice. Any ideas of what's causing this? I'm happy to write a PR if you point me towards the cause.

@arokem
Copy link
Contributor

arokem commented Jan 5, 2017

Thanks for reporting!

How did you install forestci? We did change the API in #37, so if you installed from pip, you might want to use the examples as they were before that change (e.g., here: https://github.com/scikit-learn-contrib/forest-confidence-interval/tree/03e9c146eeb7a857764a070ac9ca21f93a137a7e/examples).

We will also make a new release soon, so that pip installations match the documentation, but we're still also working through some other issues, so it might take us a little bit longer.

@finbarrtimbers
Copy link
Author

Thanks, that was it. It seems to work now (my machine is killing the process because it takes too much memory, but that's my problem).

@arokem
Copy link
Contributor

arokem commented Jan 5, 2017

Might also be related to this PR #39

@finbarrtimbers
Copy link
Author

Thanks, I'll check that out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants