Skip to content
Snippets Groups Projects
Commit d2c507f6 authored by Danilo Ferreira de Lima's avatar Danilo Ferreira de Lima
Browse files

Fixed KDE scoring.

parent cc61c96a
No related branches found
No related tags found
No related merge requests found
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
Estimate high-resolution photon spectrometer data from low-resolution non-invasive measurements. Estimate high-resolution photon spectrometer data from low-resolution non-invasive measurements.
""" """
VERSION = "0.0.8" VERSION = "0.0.9"
...@@ -775,7 +775,7 @@ class Model(TransformerMixin, BaseEstimator): ...@@ -775,7 +775,7 @@ class Model(TransformerMixin, BaseEstimator):
q = np.quantile(intensity, [0.10, 0.90]) q = np.quantile(intensity, [0.10, 0.90])
l, h = q[0], q[1] l, h = q[0], q[1]
x = intensity*((intensity > l) & (intensity < h)) + l*(intensity <= l) + h*(intensity >= h) x = intensity*((intensity > l) & (intensity < h)) + l*(intensity <= l) + h*(intensity >= h)
log_prob = self.kde_xgm.score_samples(x) log_prob = self.kde_xgm.score_samples(x.reshape(-1, 1))
w = np.exp(-log_prob) w = np.exp(-log_prob)
w = w/np.median(w) w = w/np.median(w)
return w return w
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment