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

Probabalistic metric space #87

Merged
merged 12 commits into from
Apr 29, 2021
Merged

Probabalistic metric space #87

merged 12 commits into from
Apr 29, 2021

Conversation

redhog
Copy link
Collaborator

@redhog redhog commented Apr 15, 2021

Point pairs can be sampled randomly. Two random subset of all points are chosen, and the distance matrix is calculated only between these two subsets. The size of each subset is set by samples: if < 1 it specifies a fraction of all points, if >= 1 it specifies the number of points in each subset.

Closes #48

Only look at this after merging #84

@redhog redhog marked this pull request as draft April 15, 2021 08:00
@mmaelicke
Copy link
Owner

wow it's going really fast here...
I'll try to keep up with your pace :)

@redhog
Copy link
Collaborator Author

redhog commented Apr 15, 2021

This is all stuff I'm building for a single feature in our software. For a bit of background: We have built (and are using) https://github.com/emerald-geomodelling/EmeraldTriangles to manage triangulated datasets. Among those are topography, and while that usually is delivered as a raster (geotiff) and easy to sample to the TIN (which is typically build from a grid + all measurement points), sometimes it comes as an existing TIN that we just add the new (grid + measurement) points to. In that case I wanted to use kriging on topo too, not just measurements. But for such a topo (DTM) TIN, the number of points is very large, and I ran into all the things I've been addressing in these two PRs.

@redhog
Copy link
Collaborator Author

redhog commented Apr 15, 2021

For now the scikit-gstat kriging is done outside of EmeraldTriangles, but my goal is to have a utility function in that library that uses vertice points with a non-nan value in some column as observations, kriging to all rows with nan values in the same column.

@redhog redhog changed the base branch from master to crosskriging April 20, 2021 07:39
@redhog redhog changed the base branch from crosskriging to master April 20, 2021 07:39
@redhog redhog marked this pull request as ready for review April 20, 2021 07:39
@codecov
Copy link

codecov bot commented Apr 20, 2021

Codecov Report

Merging #87 (7b63fb9) into master (6d972e9) will increase coverage by 0.08%.
The diff coverage is 93.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #87      +/-   ##
==========================================
+ Coverage   90.92%   91.01%   +0.08%     
==========================================
  Files          15       15              
  Lines        1785     1847      +62     
==========================================
+ Hits         1623     1681      +58     
- Misses        162      166       +4     
Impacted Files Coverage Δ
skgstat/MetricSpace.py 87.75% <93.33%> (+3.84%) ⬆️
skgstat/Variogram.py 97.05% <100.00%> (+0.01%) ⬆️

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 6d972e9...7b63fb9. Read the comment docs.

@redhog
Copy link
Collaborator Author

redhog commented Apr 26, 2021

@mmaelicke This is ready for merging now whenever you have time :)

Copy link
Owner

@mmaelicke mmaelicke left a comment

Choose a reason for hiding this comment

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

@redhog, looks good to me, nice extension.
I think with two unittests we can bring the coverage back. Both could use the Variogram to instantiate a ProbabilisticMetricSpace with two different sample sizes. That should cover all the new code.
If you want me to do that, just go ahead and assign me to the PR, I think I will find some time towards the end of the week.

skgstat/MetricSpace.py Show resolved Hide resolved
skgstat/MetricSpace.py Outdated Show resolved Hide resolved
skgstat/MetricSpace.py Outdated Show resolved Hide resolved
skgstat/MetricSpace.py Show resolved Hide resolved
skgstat/MetricSpace.py Outdated Show resolved Hide resolved
skgstat/Variogram.py Show resolved Hide resolved
@redhog
Copy link
Collaborator Author

redhog commented Apr 27, 2021

Btw, @mmaelicke I saw you added me to the citation! Thanks! I made an account with orcid so maybe you coul update the author list on zenodo there to point to my id https://orcid.org/0000-0002-8254-1163?

Copy link
Owner

@mmaelicke mmaelicke left a comment

Choose a reason for hiding this comment

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

@redhog, thanks for adding all the stuff, I think everything is addressed. There is one more thing that came to my mind, should be an easy fix
Best

skgstat/MetricSpace.py Outdated Show resolved Hide resolved
skgstat/MetricSpace.py Outdated Show resolved Hide resolved
skgstat/MetricSpace.py Outdated Show resolved Hide resolved
Copy link
Owner

@mmaelicke mmaelicke left a comment

Choose a reason for hiding this comment

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

Thanks! Great PR, I really like it.

@mmaelicke
Copy link
Owner

You can merge whenever you want. I will add the changelog and release the new version to PyPI, this afternoon

@redhog redhog merged commit 2320748 into master Apr 29, 2021
@mmaelicke mmaelicke deleted the probabalistic-metric-space branch February 10, 2022 07:34
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.

Sampling of point pairs
2 participants