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

Caught and logged exception with randomforest #16

Closed
mschulkind opened this issue Mar 7, 2015 · 11 comments
Closed

Caught and logged exception with randomforest #16

mschulkind opened this issue Mar 7, 2015 · 11 comments
Labels

Comments

@mschulkind
Copy link

Things seem to work, but I'm seeing a exception in the console with a small test app:

java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: -1

Runnable source here:
https://github.com/mschulkind/smile-test

This is the bulk of it:

DelimitedTextParser parser = new DelimitedTextParser();
parser.setColumnNames(true);
parser.setDelimiter(",");
parser.setResponseIndex(new NumericAttribute("MEDV"), 13);

AttributeDataset dataset = parser.parse("housing.csv");

double[][] x = dataset.toArray(new double[dataset.size()][]);
double[] y = dataset.toArray(new double[dataset.size()]);

RandomForest forest = 
    new RandomForest(dataset.attributes(), x, y, 200); // Exception logged here.
@haifengl
Copy link
Owner

haifengl commented Mar 7, 2015

Thanks for the bug report! Do you have a stack dump?

@mschulkind
Copy link
Author

That's it because the random forest implementation swallows it.

The interesting thing is that the forest still appears to work correctly
after that.
On Mar 6, 2015 9:07 PM, "Haifeng Li" notifications@github.com wrote:

Thanks for the bug report! Do you have a stack dump?


Reply to this email directly or view it on GitHub
#16 (comment).

@mschulkind
Copy link
Author

@haifengl
Copy link
Owner

haifengl commented Mar 7, 2015

Thanks! Can you please change that line to ex.printStackTrace() and run it again?

@haifengl
Copy link
Owner

Fixed. Can you try version 1.0.2? Thanks! If your machine is multi-core, it should be faster now.

@haifengl
Copy link
Owner

@mschulkind Any updates? Thanks!

@mschulkind
Copy link
Author

Sorry for the delay. I was out of town.

I just updated and I no longer get the exception. Thanks.

Any idea why my example never exits though? It seems like it must be
hanging on a background thread or something. If I simple comment out the
line to create the random forest, it exits cleanly, but with it, it just
hangs, although it does return from the call to new.

On Thu, Mar 12, 2015 at 9:17 AM, Haifeng Li notifications@github.com
wrote:

@mschulkind https://github.com/mschulkind Any updates? Thanks!


Reply to this email directly or view it on GitHub
#16 (comment).

@haifengl
Copy link
Owner

Do you mean that everything runs fine and you get all results, but the program doesn't exit? Or the program hangs in the creating the random forest? Thanks!

@mschulkind
Copy link
Author

Things run, but the program never exits. It hangs after main() returns.

On Thu, Mar 12, 2015 at 10:44 AM, Haifeng Li notifications@github.com
wrote:

Do you mean that everything runs fine and you get all results, but the
program doesn't exit? Or the program hangs in the creating the random
forest? Thanks!


Reply to this email directly or view it on GitHub
#16 (comment).

@haifengl
Copy link
Owner

There is a thread pool, shared by many algorithms. If you are the master branch, you can use

smile.util.MulticoreExecutor.shutdown()

at the end of your program to exit smoothly. Thanks!

@mschulkind
Copy link
Author

Thanks!

On Thu, Mar 12, 2015 at 11:27 AM, Haifeng Li notifications@github.com
wrote:

There is a thread pool, shared by many algorithms. If you are the master
branch, you can use

smile.util.MulticoreExecutor.shutdown()

at the end of your program to exit smoothly. Thanks!


Reply to this email directly or view it on GitHub
#16 (comment).

@haifengl haifengl added the bug label Oct 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants