Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tylerjereddy/pycon-2017
Mastering scipy.spatial PyCon 2017 Tutorial
https://github.com/tylerjereddy/pycon-2017
computational-geometry pycon python-3 scipy
Last synced: 29 days ago
JSON representation
Mastering scipy.spatial PyCon 2017 Tutorial
- Host: GitHub
- URL: https://github.com/tylerjereddy/pycon-2017
- Owner: tylerjereddy
- License: mit
- Created: 2017-03-24T19:44:58.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-15T17:56:39.000Z (over 7 years ago)
- Last Synced: 2024-08-01T00:58:38.592Z (3 months ago)
- Topics: computational-geometry, pycon, python-3, scipy
- Language: Jupyter Notebook
- Size: 11.8 MB
- Stars: 25
- Watchers: 5
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pycon-2017
Mastering scipy.spatial PyCon 2017 Tutorial## Dependencies
The tutorial is designed to be executed in a single Jupyter (5.0) notebook in Python 3.x (I've been using 3.5 / 3.6 mostly) and the necessary files may be cloned from this github repo. The easiest way to identify any library dependencies you may be missing is probably to try running all cells in the notebook (`Cell` -> `Run All`) and checking if there are any issues. Nonetheless, I've tried to consolidate major import statements near the top of the notebook, and the following is a summary of the versions I've used:| library import name | version used |
|---------------------|--------------|
| scipy | `0.19.0` |
| numpy | `1.12.1` |
| matplotlib | `2.0.0` |
| PIL | `4.1.0` |
| networkx | `1.11` |A few other files (image files, small ad hoc Python libraries) are stored in the repo and also needed to run the full notebook.
## Talk Outline
1) Introduction: Computational Geometry and scipy.spatial
2) Distances between arrays of points
- scipy.spatial.distance_matrix
- Euclidean (L2 norm)
- Rectilinear (L1 norm)
- scipy.spatial.distance.cdist
- Faster than distance_matrix for Euclidean norm
- Faster than distance_matrix for L1 norm
- Using cdist for Mahalanobis distance -- clustering and outlier detection
- scipy.spatial.distance.pdist
- pdist basics -- very simple example
- pdist 'real-world' example
3) Distances between single numeric vectors
- Calculate the Euclidean distance between two arrays
- Calculate the cityblock distance between two arrays
- Calculate the weighted Minkowski distance between two arrays
4) Distances between single boolean vectors
- Calculate the hamming distance between two 1D arrays
- Calculate the Jaccard distance between two 1D arrays
- Calculate the Yule distance (dissimilarity) between two 1D boolean arrays
5) Distances in Large Data Sets: Binary Space Partitioning
- General Concept of Binary Space Partitioning (BSP)
- Simple Example of General BSP
- k-d trees
- Example Exploring k-d trees with scipy.spatial
6) Convex Hulls
- Convexity, Convex Hulls and General Position
- Practical Algorithm Time & Space Complexities
- Determine the time complexity of the `ConvexHull` algorithm used by `scipy.spatial` (which is actually just a wrapper for the popular `qhull` package)
- Can the Python community do better than `scipy.spatial.ConvexHull`?
- Practical Examples with `scipy.spatial.ConvexHull`
- 2D
- 3D
7) Delaunay Triangulations
- Definition and Basic Information
- The Empty Circle Property
- Practical Applications of `scipy.spatial.Delaunay()`
- 2D
- Measuring the time complexity of `scipy.spatial.Delaunay()`
8) Voronoi Diagrams
- Definition and Importance
- Overview of Algorithms and their Time Complexities (2D)
- Practical Problem Solving with `scipy.spatial.Voronoi()`
- 2D
- 3D
- Measuring the Time Complexity for 2D `scipy.spatial.Voronoi()`
- `scipy.spatial.SphericalVoronoi()`
- Calculating Surface Area of Spherical Polygons
9) Shape Comparison
- Procrustes analysis
- Examples using scipy.spatial.procrustes
- Simple Example -- Two Circles
- More complex shapes -- comparison of two bone structures
- The Hausdorff Distance
- Simple Example: Concentric circles with one outlier
- The Frechet Distance (Proposed)
- The Classic / Intuitive Interpretation (Informal Definition)
- Discrete Frechet Distance Example -- Path of an Autonomous Vehicle
10) Miscellaneous Topics
- Hyperrectangles
- Exploring scipy.spatial.Rectangle with some examples
11) Discussion -- What would you really like to have available in scipy.spatial?