Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ENH Add float32 implementations for BallTree and KDTree #25914

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

Merged
merged 47 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
3cd705b
ENH add float32 support in BallTree and KDTree
OmarManzoor Mar 17, 2023
2071c0e
Remove 32 variant for VALID_METRICS
OmarManzoor Mar 20, 2023
9e35066
Fix import issue
OmarManzoor Mar 21, 2023
98d4f68
Merge branch 'main' into ball_and_kd_tree_float32
OmarManzoor Mar 21, 2023
301afc9
Add tests for ball tree
OmarManzoor Mar 21, 2023
4e666f9
Fix tests and apply some suggestions
OmarManzoor Mar 22, 2023
45b43a6
Add whatsnew entry
OmarManzoor Mar 22, 2023
22d4e37
Update setup files
OmarManzoor Mar 22, 2023
af1aa2a
Update test_ball_tree
OmarManzoor Mar 22, 2023
3093550
Setup.py: continue when sources is empty
OmarManzoor Mar 22, 2023
169495f
Preserve dtype for return outputs and adjust tests
OmarManzoor Mar 24, 2023
ba1ce1b
Add a test for two point correlation
OmarManzoor Mar 24, 2023
c7d959a
Remove debug print
OmarManzoor Mar 24, 2023
66c578a
Add assertions for float dtypes
OmarManzoor Mar 24, 2023
2368aa8
Rename METRICS_TO_TEST
OmarManzoor Mar 24, 2023
5b6c2bc
Revert tempita on simultaneous_sort function
OmarManzoor Mar 24, 2023
96d54c1
Add similar tests for kd tree
OmarManzoor Mar 27, 2023
3eef8fb
Merge branch 'main' into ball_and_kd_tree_float32
OmarManzoor May 2, 2023
8801242
PR suggestions
Jun 5, 2023
22ffce5
Merge branch 'ball_and_kd_tree_float32' of https://github.com/OmarMan…
Jun 5, 2023
d3f6ff4
Merge branch 'main' into ball_and_kd_tree_float32
Jun 5, 2023
5a2c1e7
Additional changes needed to sync with main and include the distance …
Jun 7, 2023
11744c8
Fix imports in test_neighbors_tree.py
Jun 7, 2023
1e24cd9
Correct references to BallTree64 and KDTree64 in doc for neighbors
Jun 7, 2023
26ab322
Rollback some recent changes
Jun 7, 2023
65c3e2b
Fix the doc issue by removing extra metric from ball tree
Jun 7, 2023
9027a92
Change structure - Use a BallTree and KDTree class
Jun 13, 2023
292a3f0
Fix tests and related issues
Jun 13, 2023
0a5fea2
Further fixes and use properties to access attributes of specialized …
Jun 13, 2023
810b1ed
In _estimate_mi in mutual_info if y is continuous set it as np.float6…
Jun 13, 2023
b294a11
Revert new structure
Jun 19, 2023
0527e77
Parameterize applicable tests over 64 and 32 class versions
Jun 19, 2023
738724e
Address all PR suggestions
Jun 22, 2023
2d2da7f
Resolve conflicts
Jun 22, 2023
819377e
Merge branch 'main' into ball_and_kd_tree_float32
Jun 23, 2023
d1b3b49
Merge branch 'main' into ball_and_kd_tree_float32
jjerphan Jun 25, 2023
56dacf5
PR suggestions
Jun 25, 2023
d8cd47e
Merge branch 'ball_and_kd_tree_float32' of https://github.com/OmarMan…
Jun 25, 2023
7e71367
PR suggestion: Use a public BallTree class that inherits from BallTree64
Jun 26, 2023
1d49d97
Merge branch 'main' into ball_and_kd_tree_float32
Jul 5, 2023
aa7cbe4
Applies PR suggestions
Jul 5, 2023
8a1433c
Remove additional metrics
OmarManzoor Jul 7, 2023
e5712ec
Merge branch 'main' into ball_and_kd_tree_float32
OmarManzoor Jul 7, 2023
0d1a58e
Fix unintended error during merge with main
Jul 7, 2023
6327066
Merge branch 'main' into ball_and_kd_tree_float32
Jul 29, 2023
179eb06
Address PR suggestions
Jul 29, 2023
192dfc3
Add missing docs
OmarManzoor Aug 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ sklearn/metrics/_pairwise_distances_reduction/_middle_term_computer.pxd
sklearn/metrics/_pairwise_distances_reduction/_middle_term_computer.pyx
sklearn/metrics/_pairwise_distances_reduction/_radius_neighbors.pxd
sklearn/metrics/_pairwise_distances_reduction/_radius_neighbors.pyx
sklearn/neighbors/_ball_tree.pyx
sklearn/neighbors/_binary_tree.pxi
sklearn/neighbors/_kd_tree.pyx

# Default JupyterLite content
jupyterlite_contents
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ ignore =
sklearn/metrics/_pairwise_distances_reduction/_middle_term_computer.pyx
sklearn/metrics/_pairwise_distances_reduction/_radius_neighbors.pxd
sklearn/metrics/_pairwise_distances_reduction/_radius_neighbors.pyx
sklearn/neighbors/_ball_tree.pyx
sklearn/neighbors/_binary_tree.pxi
sklearn/neighbors/_kd_tree.pyx


[codespell]
Expand Down
18 changes: 12 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,9 @@ def check_package_status(package, min_version):
},
],
"neighbors": [
{"sources": ["_ball_tree.pyx"], "include_np": True},
{"sources": ["_kd_tree.pyx"], "include_np": True},
{"sources": ["_binary_tree.pxi.tp"], "include_np": True},
{"sources": ["_ball_tree.pyx.tp"], "include_np": True},
{"sources": ["_kd_tree.pyx.tp"], "include_np": True},
{"sources": ["_partition_nodes.pyx"], "language": "c++", "include_np": True},
{"sources": ["_quad_tree.pyx"], "include_np": True},
],
Expand Down Expand Up @@ -499,13 +500,18 @@ def configure_extension_modules():
# `source` is a Tempita file
tempita_sources.append(source)

# Do not include pxd files that were generated by tempita
if os.path.splitext(new_source_path)[-1] == ".pxd":
continue
sources.append(new_source_path)
# Only include source files that are pyx files
if os.path.splitext(new_source_path)[-1] == ".pyx":
sources.append(new_source_path)

gen_from_templates(tempita_sources)

# Do not progress if we only have a tempita file which we don't
# want to include like the .pxi.tp extension. In such a case
# sources would be empty.
if not sources:
continue

# By convention, our extensions always use the name of the first source
source_name = os.path.splitext(os.path.basename(sources[0]))[0]
if submodule:
Expand Down
195 changes: 0 additions & 195 deletions sklearn/neighbors/_ball_tree.pyx

This file was deleted.

Loading