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

Functional #189

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

Functional #189

wants to merge 3 commits into from

Conversation

ljwolf
Copy link
Member

@ljwolf ljwolf commented Aug 12, 2021

This is a bit of metaprogramming that re-rexpresses most of the esda stats classes as functions that just return the statistic and a simulated p-value.

Still needs work with the LOSH and Spatial_Pearson statistics, but this is one of the two APIs I think we should adopt. The other is the LOSH/Spatial_Pearson-style sklearn estimator.

@ljwolf ljwolf added the WIP work in progress (for discussion) label Aug 12, 2021
@codecov-commenter
Copy link

codecov-commenter commented Aug 12, 2021

Codecov Report

Merging #189 (fc7a4d5) into master (4a63e0b) will decrease coverage by 2.71%.
The diff coverage is 21.60%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #189      +/-   ##
==========================================
- Coverage   80.59%   77.88%   -2.72%     
==========================================
  Files          42       45       +3     
  Lines        4277     4444     +167     
==========================================
+ Hits         3447     3461      +14     
- Misses        830      983     +153     
Impacted Files Coverage Δ
esda/crand_perf_nogit.py 0.00% <0.00%> (ø)
esda/crand_perf_sim.py 0.00% <0.00%> (ø)
esda/functions.py 0.00% <0.00%> (ø)
esda/lee.py 21.87% <60.00%> (+1.44%) ⬆️
esda/losh.py 88.09% <76.92%> (-1.65%) ⬇️
esda/geary_local.py 86.66% <80.00%> (-1.06%) ⬇️
esda/join_counts_local.py 98.00% <80.00%> (-2.00%) ⬇️
esda/join_counts_local_bv.py 96.29% <80.00%> (-1.14%) ⬇️
esda/join_counts_local_mv.py 98.11% <80.00%> (-1.89%) ⬇️
esda/geary_local_mv.py 98.46% <93.33%> (-1.54%) ⬇️
... and 3 more

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 4a63e0b...fc7a4d5. Read the comment docs.

esda/crand_perf_nogit.py Outdated Show resolved Hide resolved
esda/crand_perf_sim.py Outdated Show resolved Hide resolved
klassname = klass.__name__
name = klass.__name__.lower()
if klassname == "LOSH":
defn = f"def {name}(*args, **kwargs):\n\tobj = {klassname}(*args, **kwargs)\n\treturn obj._statistic, obj.pval"
Copy link
Member Author

Choose a reason for hiding this comment

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

These have to separate the init and fit phases, so I need to figure out how to re-write the signature so that the options all go through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP work in progress (for discussion)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants