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

Detection predictions blending based on clustering sampled gaussians #116

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jorisvandenbossche
Copy link
Member

This already adds the one based on HDBSCAN.

@codecov
Copy link

codecov bot commented Feb 16, 2018

Codecov Report

Merging #116 into master will decrease coverage by 1.61%.
The diff coverage is 12.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #116      +/-   ##
==========================================
- Coverage      87%   85.39%   -1.62%     
==========================================
  Files          70       70              
  Lines        2602     2657      +55     
==========================================
+ Hits         2264     2269       +5     
- Misses        338      388      +50
Impacted Files Coverage Δ
rampwf/prediction_types/detection.py 58.49% <12.28%> (-26.13%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7a4b7e0...7d7a6dc. Read the comment docs.

c = mask.sum() / max_n_samples
x, y = km.cluster_centers_[i]
r = np.mean((data[mask] - km.cluster_centers_[i])**2)
objs.append((c, x, y, r))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the choice of average of squares instead of the Euclidean distance ?

Copy link
Member Author

Choose a reason for hiding this comment

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

You mean for the calculation of the radius r ? Because I initially used the radius as the variance of multivariate normal that I sampled from. So therefore here using that as an estimate of the radius.


objs = []

for i in range(n_clusters):
mask = labels == i
c = mask.sum() / max_n_samples
x, y = data[mask].mean(axis=0)
r = np.sqrt(np.mean((data[mask] - np.array([x, y]))**2)) * 2
r = np.mean((data[mask] - np.array([x, y]))**2)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

Copy link
Contributor

@aboucaud aboucaud left a comment

Choose a reason for hiding this comment

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

LGTM

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 this pull request may close these issues.

None yet

2 participants