diff --git a/spopt/region/azp_util.py b/spopt/region/azp_util.py index 4213058c..05ab7df2 100755 --- a/spopt/region/azp_util.py +++ b/spopt/region/azp_util.py @@ -153,11 +153,9 @@ def __init__(self, spatially_extensive_attr, threshold, decorated_strategy): Parameters ---------- spatially_extensive_attr : numpy.ndarray - See corresponding argument in - ``region.max_p_regions.heuristics.MaxPRegionsHeu.fit_from_scipy_sparse_matrix``. + Values that will serve as domain for the threshold constraint threshold : numbers.Real or numpy.ndarray - See corresponding argument in - ``region.max_p_regions.heuristics.MaxPRegionsHeu.fit_from_scipy_sparse_matrix`` + Value for the threshold constraint decorated_strategy : AllowMoveStrategy The ``AllowMoveStrategy`` related to the algorithms local search. """ diff --git a/spopt/region/maxp.py b/spopt/region/maxp.py index 7e9d7432..ffb66b8f 100644 --- a/spopt/region/maxp.py +++ b/spopt/region/maxp.py @@ -6,6 +6,9 @@ Journal of Geographical Information Science. Accepted 2020-04-12. """ +__author__ = ["Ran Wei", "Serge Rey", "Elijah Knaap"] +__email__ = "sjsrey@gmail.com" + 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. diff --git a/spopt/region/region_k_means.py b/spopt/region/region_k_means.py index 6d8c0db5..973c4bc6 100644 --- a/spopt/region/region_k_means.py +++ b/spopt/region/region_k_means.py @@ -1,3 +1,14 @@ +""" +Region k-means + + +K-means with the constraint that all clusters form a spatially connected component. +""" + +__author__ = "Serge Rey" +__email__ = "sjsrey@gmail.com" + + 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. """