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

Parallelize Gini impurity calculation for oblique splitter #415

Closed
eigenvivek opened this issue Jan 13, 2021 · 0 comments · Fixed by #416
Closed

Parallelize Gini impurity calculation for oblique splitter #415

eigenvivek opened this issue Jan 13, 2021 · 0 comments · Fixed by #416

Comments

@eigenvivek
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

The existing ObliqueSplitter implementation calculates Gini impurity for each potential split in series.

This is slow. As @parthgvora noted:

Note that the code for this method needs to be parallelized. This is a major
bottleneck in integration with scikit-learn.

Describe the solution you'd like

Replace this code block with a joblib parallelization:

# Loop through projected features and examples to find best split
# This can be parallelized for sure
for j in range(self.proj_dims):
# Sort labels by the jth feature
idx = np.argsort(proj_X[:, j])
y_sort = y_sample[idx]
Q[1:-1, j] = np.array(
[self.score(y_sort, i) for i in range(1, n_samples - 1)]
)

Describe alternatives you've considered

Additional context (e.g. screenshots)

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

Successfully merging a pull request may close this issue.

2 participants