Scalable GWR plots¶
This page documents 1 public symbols. Each entry includes its purpose, import path, full API docstring, and the maintained example that exercises it.
plot_scalable_gwr_kernel¶
Plot fitted polynomial-kernel components and their mixture.
| Property | Value |
|---|---|
| Type | function |
| Import | from pygwrx.plotting import plot_scalable_gwr_kernel |
| Signature | plot_scalable_gwr_kernel(model: 'Any', *, max_distance: 'Optional[float]' = None, n_points: 'int' = 200, theme: 'str' = 'default', figsize: 'Optional[Tuple[float, float]]' = None, title: 'str' = 'Scalable GWR multiscale kernel approximation') -> 'Tuple[plt.Figure, np.ndarray]' |
| Maintained example | examples/plotting/03_robust_regularized_bootstrap.py |
plot_scalable_gwr_kernel ¶
plot_scalable_gwr_kernel(
model: Any,
*,
max_distance: Optional[float] = None,
n_points: int = 200,
theme: str = "default",
figsize: Optional[Tuple[float, float]] = None,
title: str = "Scalable GWR multiscale kernel approximation"
) -> Tuple[plt.Figure, np.ndarray]
Plot fitted polynomial-kernel components and their mixture.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Any
|
Fitted :class: |
required |
max_distance
|
Optional[float]
|
Largest displayed distance. By default, three fitted base bandwidths are shown. |
None
|
n_points
|
int
|
Number of distance samples. |
200
|
theme
|
str
|
Plotting theme. |
'default'
|
figsize
|
Optional[Tuple[float, float]]
|
Optional figure size. |
None
|
title
|
str
|
Figure title. |
'Scalable GWR multiscale kernel approximation'
|
Returns:
| Type | Description |
|---|---|
Tuple[Figure, ndarray]
|
Matplotlib |
Source code in src/pygwrx/plotting/scalable.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
Runnable examples used on this page¶
examples/plotting/03_robust_regularized_bootstrap.py
# SPDX-FileCopyrightText: 2026 Jinghao Hu
# SPDX-License-Identifier: MIT
"""All robust, GLM, Lasso, mixed, bootstrap, and scalable plots."""
# Allow this script to run directly from any working directory.
import sys
from pathlib import Path
_PROJECT_ROOT = Path(__file__).resolve().parents[2]
_EXAMPLES_ROOT = _PROJECT_ROOT / "examples"
_SRC_ROOT = _PROJECT_ROOT / "src"
for _path in (_SRC_ROOT, _EXAMPLES_ROOT):
if str(_path) not in sys.path:
sys.path.insert(0, str(_path))
import matplotlib
matplotlib.use("Agg", force=True)
from _common import save_plot
from _models import regularized_models
from pygwrx.plotting import (
plot_bootstrap_bandwidths,
plot_bootstrap_pvalues,
plot_gwglm_residuals,
plot_gwlasso_active_map,
plot_gwlasso_alpha,
plot_gwlasso_selection_frequency,
plot_mixed_gwr_coefficients,
plot_rgwr_convergence,
plot_rgwr_weights,
plot_scalable_gwr_kernel,
)
X, y, coords, rgwr, gwglm, gwlasso, mixed, bootstrap, scalable = regularized_models()
plots = {
"rgwr_weights.png": plot_rgwr_weights(rgwr),
"rgwr_convergence.png": plot_rgwr_convergence(rgwr),
"gwglm_residuals.png": plot_gwglm_residuals(gwglm),
"gwlasso_frequency.png": plot_gwlasso_selection_frequency(gwlasso),
"gwlasso_active.png": plot_gwlasso_active_map(gwlasso, "x1"),
"gwlasso_alpha.png": plot_gwlasso_alpha(gwlasso),
"mixed_coefficients.png": plot_mixed_gwr_coefficients(mixed),
"bootstrap_pvalues.png": plot_bootstrap_pvalues(bootstrap, "x1"),
"bootstrap_bandwidths.png": plot_bootstrap_bandwidths(bootstrap),
"scalable_kernel.png": plot_scalable_gwr_kernel(scalable),
}
for name, result in plots.items():
print(save_plot(result, name))