-
Notifications
You must be signed in to change notification settings - Fork 56
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
add Lee (2001) local spatial Pearson #51
Conversation
also maybe want to keep/return the "spatial smoothing scalars" from lee |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with minor changes/updates.
class Spatial_Pearson(BaseEstimator): | ||
def __init__(self, connectivity=None, permutations=999): | ||
self.connectivity = connectivity | ||
self.permutations = permutations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be type caster here just in case the user give permutations
as something other than an integer?
self.permutations = int(permutations)
class Local_Spatial_Pearson(BaseEstimator): | ||
def __init__(self, connectivity = None, permutations=999): | ||
self.connectivity = connectivity | ||
self.permutations = permutations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment in line 39
The significance testing is not correct; not sure how I'm screwing up the form of the null statistic, but it's definitely not right. Will look into. |
I think I've fixed up that code for the local inference. Stil need docstrings & unittests. Before I do that, can I get a ruling on the sklearn dependency from maintainers? If I rewrite this, I'd use array checking logic from spreg, or I'd write my own. |
Oh also on the API; this uses init().fit()-style stuff, which is different from the existing pattern. |
@ljwolf Are there any real drawbacks to having |
I think sklearn dependency is +1 |
docstrings and tests are added. |
@ljwolf is this WIP stil, or ready to merge? |
It's ready if the sklearn dependency is accounted for? |
This adds the Lee local spatial pearson estimators, alongside a wrapped version of the R code you can use to get them from spdep. This still needs