You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I'm trying to understand density-ratio estimation including RuLSIF for implementing transition detection w.r.t. smart home data. Thank you for making such useful module.
As written in the RuLSIF.py, I read one reference 'A Least-squares Approach to Direct Importance Estimation' about LOOCV to understand how sigma and lambda are determined.
In this reference, it says that it randomly chooses kernel centers from test data "without replacement".
But line 48 of RuLSIF.py, centers = x[randint(nx, size=kernel_num)]
If we run the code, it chooses elements with replacement so there are duplicated data points.
So, I think the code should be changed into this. from numpy.random import choice centers = x[choice(nx, kernel_num, replace=False)]
Please check whether it is right and give some comments!
Thank you.
The text was updated successfully, but these errors were encountered:
you might be possibly interested in my branch, featuring uniquenumpy.random.choice (without replacement) that has superseded numpy.random.randint for kernel centers selection. Furthermore, by applying numpy.percentile the choice is stratified with respect to (possibly multivariate) x values. Please refer to the semi_stratified_sample function.
Hello. I'm trying to understand density-ratio estimation including RuLSIF for implementing transition detection w.r.t. smart home data. Thank you for making such useful module.
As written in the RuLSIF.py, I read one reference 'A Least-squares Approach to Direct Importance Estimation' about LOOCV to understand how sigma and lambda are determined.
In this reference, it says that it randomly chooses kernel centers from test data "without replacement".
But line 48 of RuLSIF.py,
centers = x[randint(nx, size=kernel_num)]
If we run the code, it chooses elements with replacement so there are duplicated data points.
So, I think the code should be changed into this.
from numpy.random import choice
centers = x[choice(nx, kernel_num, replace=False)]
Please check whether it is right and give some comments!
Thank you.
The text was updated successfully, but these errors were encountered: