-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #214 from sjsrey/region-docs
Region docs
- Loading branch information
Showing
3 changed files
with
28 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,9 @@ | |
Journal of Geographical Information Science. Accepted 2020-04-12. | ||
""" | ||
|
||
__author__ = ["Ran Wei", "Serge Rey", "Elijah Knaap"] | ||
__email__ = "[email protected]" | ||
|
||
from ..BaseClass import BaseSpOptHeuristicSolver | ||
from .base import ( | ||
w_to_g, | ||
|
@@ -727,8 +730,8 @@ class MaxPHeuristic(BaseSpOptHeuristicSolver): | |
Set to ``True`` for reporting solution progress/debugging. | ||
Default is ``False``. | ||
Returns | ||
------- | ||
Attributes | ||
---------- | ||
max_p : int | ||
The number of regions. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
""" | ||
Region k-means | ||
K-means with the constraint that all clusters form a spatially connected component. | ||
""" | ||
|
||
__author__ = "Serge Rey" | ||
__email__ = "[email protected]" | ||
|
||
|
||
from collections import defaultdict | ||
import numpy | ||
from ..BaseClass import BaseSpOptHeuristicSolver | ||
|
@@ -14,7 +25,7 @@ | |
|
||
|
||
def region_k_means(X, n_clusters, w): | ||
"""Solve the region-K-means problem, the K-means with the constraint | ||
"""Solve the region-K-means problem with the constraint | ||
that each cluster forms a spatially connected component. | ||
Parameters | ||
|
@@ -119,7 +130,7 @@ def region_k_means(X, n_clusters, w): | |
|
||
|
||
class RegionKMeansHeuristic(BaseSpOptHeuristicSolver): | ||
"""Solve the region-K-means problem, the K-means with the constraint | ||
"""Solve the region-K-means problem with the constraint | ||
that each cluster forms a spatially connected component. | ||
|
@@ -138,14 +149,15 @@ class RegionKMeansHeuristic(BaseSpOptHeuristicSolver): | |
Attributes | ||
---------- | ||
labels_ : | ||
... | ||
centroids_ : | ||
... | ||
labels_ : numpy.array | ||
Region IDs for observations | ||
iters_ : | ||
... | ||
centroids_ : numpy.ndarray | ||
Floating point array of centroids in the shape of ``(k, n_features)`` | ||
found at the last iteration of ``region_k_means``. | ||
iters : int | ||
The number of iterations for the reassignment phase. | ||
""" | ||
|
||
|