Skip to content

Conversation

@Micky774
Copy link
Contributor

Reference Issues/PRs

Towards #24686

What does this implement/fix? Explain your changes.

  1. Updated data arrays to utilize memoryviews
  2. Improved removed trailing underscore
  3. Trimmed extraneous method

Any other comments?

Copy link
Member

@jjerphan jjerphan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you, @Micky774.

Co-authored-by: Julien Jerphanion <[email protected]>
Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

cdef union_(self, cnp.intp_t x, cnp.intp_t y):
cdef cnp.ndarray[cnp.intp_t, ndim=2] data_arr
data_arr = np.zeros((size, 2), dtype=np.intp)
data_arr.T[0] = np.arange(size)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems a little waste to create a new array just for setting the values of another array. What is the performance like for doing it manually for large size?

for i in range(size):
    data_arr[i, 0] = i

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thomasjpfan thomasjpfan merged commit 1a751b6 into scikit-learn:hdbscan Mar 14, 2023
@Micky774 Micky774 deleted the hdbscan_treeunion_clean branch March 14, 2023 22:03
Micky774 added a commit to Micky774/scikit-learn that referenced this pull request May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants