Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

gnnwrgnnwr 命令行

Agent Skill

gnnwr 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

267

周安装

11

GitHub Stars

23

下载量

87
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:gnnwr(gnnwr 命令行)
来源仓库:https://github.com/steadfastasart/geoscience-skills
仓库路径:skills/gnnwr
安装命令:
npx skills add https://github.com/steadfastasart/geoscience-skills --skill gnnwr
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/steadfastasart/geoscience-skills --skill gnnwr

简介

gnnwr 用于处理 GitHub 仓库、Issue 和 Pull Request 协作信息。

  • 适用于围绕代码变更、仓库状态或协作事项进行整理的场景。
  • 通过 npx skills add 命令安装,需结合原始 README 确认具体用法。
  • 安装前建议确认权限范围和维护状态,注意是否触发联网或文件读写操作。
  • gnnwr 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

GNNWR - Geographically Neural Network Weighted Regression

Quick Reference

from gnnwr import models, datasets, utils
import pandas as pd

data = pd.read_csv("data.csv")

train, val, test = datasets.init_dataset(
    data=data, test_ratio=0.2, valid_ratio=0.1,
    x_column=["x1", "x2", "x3"], y_column=["y"],
    spatial_column=["lon", "lat"],  # REQUIRED: geographic coords
    batch_size=32, process_fn="minmax_scale"
)

model = models.GNNWR(train, val, test, use_gpu=True, optimizer="Adam", start_lr=0.01)
model.run(max_epoch=200, early_stop=30)

result = model.reg_result(only_return=True)  # DataFrame: coef_x1, coef_x2, ..., Pred_y
print(model.result())                         # R², AIC, RMSE, F-tests summary

Spatiotemporal (GTNNWR)

train, val, test = datasets.init_dataset(
    data=data, ...,
    spatial_column=["lon", "lat"],
    temp_column=["year", "month"],  # add temporal coords
    use_model="gtnnwr"
)
model = models.GTNNWR(train, val, test, use_gpu=True)

Large-Scale (N > 10k) — KNN Mode

train, val, test = datasets.init_dataset(
    data=data, ..., knn_k=500  # only k nearest neighbor distances
)
# Memory: N=100k full=55GB → knn_k=2000 only 763MB

Key Classes

ClassPurpose
models.GNNWRSpatial regression with neural network geographic weighting
models.GTNNWRSpatiotemporal regression with temporal + spatial weighting
datasets.init_datasetData splitting, normalization, distance matrix construction
utils.VisualizeBuilt-in folium interactive maps for coefficients and predictions

Essential Operations

init_dataset Parameters

ParameterDefaultNotes
knn_kNoneKNN sparse distance; None=full matrix
process_fn"minmax_scale"or "standard_scale"
spatial_funBasicDistanceEuclidean; or ManhattanDistance
ReferenceNone"train", "train_val", or custom DataFrame
sample_seed42Reproducibility

Model Hyperparameters

ParameterRecommendedNotes
optimizer"Adam"Also: SGD, AdamW, Adagrad, RMSprop
start_lr0.01–0.1Critical tuning point
drop_out0.20.0–0.5
dense_layersNone (auto)Auto: power-of-2 sequence from input_dim to n_coef
early_stop20–50Patience; -1=disabled
batch_normTrueStabilizes training
use_olsTrueOLS-initialized output layer

Diagnostics

diag = model._test_diagnosis
diag.R2()           # always available
diag.RMSE()         # always available
diag.AIC()          # needs lite=False (auto for N<10k)
diag.AICc()         # corrected AIC
diag.F1_Global()    # GNNWR vs OLS significance
diag.F2_Global()    # spatial weight significance
diag.F3_Local()     # per-variable significance → (dict1, dict2)

lite=True (auto when N>10k): only R²/RMSE; Hat-matrix diagnostics skipped.

Visualization Patterns

Folium Interactive Maps (built-in)

viz = utils.Visualize(model, lon_lat_columns=["lon", "lat"], zoom=5)
m1 = viz.display_dataset(name="all", y_column="y")
m1.save("dataset_map.html")

for col in [c for c in result.columns if c.startswith("coef_")]:
    m = viz.coefs_heatmap(data_column=col, steps=20)
    m.save(f"map_{col}.html")

Matplotlib Static Maps (publication-ready)

import matplotlib.pyplot as plt

fig, axes = plt.subplots(2, 3, figsize=(18, 12))
coef_cols = [c for c in result.columns if c.startswith("coef_")]

for ax, col in zip(axes.flat, coef_cols):
    sc = ax.scatter(
        result["lon"], result["lat"],
        c=result[col], cmap="RdYlBu_r", s=5, alpha=0.8,
        vmin=result[col].quantile(0.02), vmax=result[col].quantile(0.98)
    )
    ax.set_title(col.replace("coef_", "β_"), fontsize=14)
    plt.colorbar(sc, ax=ax, shrink=0.8)

plt.suptitle("Spatially Varying Coefficients (GNNWR)", fontsize=16)
plt.tight_layout()
plt.savefig("coefficients_map.png", dpi=300, bbox_inches="tight")

GeoPandas + Contextily (with basemap)

import geopandas as gpd
import contextily as ctx

gdf = gpd.GeoDataFrame(result, geometry=gpd.points_from_xy(result.lon, result.lat), crs="EPSG:4326")
gdf_web = gdf.to_crs(epsg=3857)

fig, ax = plt.subplots(figsize=(12, 10))
gdf_web.plot(column="coef_x1", ax=ax, cmap="RdYlBu_r", legend=True,
             markersize=5, alpha=0.7, legend_kwds={"shrink": 0.6})
ctx.add_basemap(ax, source=ctx.providers.CartoDB.Positron)
ax.set_title("β_x1 Spatial Variation")
ax.set_axis_off()
plt.savefig("coef_basemap.png", dpi=300, bbox_inches="tight")

When to Use vs Alternatives

Use CaseToolWhy
Spatially varying coefficients (neural net)GNNWRNon-linear weighting, scalable, coefficient maps
Classical geographically weighted regressionmgwr / GWR4Traditional bandwidth-based, well-established theory
Spatial interpolation (no covariates)verde / scikit-gstatGridding / kriging without regression
Global regression baselinestatsmodels / scikit-learnNo spatial non-stationarity assumed
Spatiotemporal varying coefficientsGTNNWRGNNWR extended with temporal dimension
Large-scale spatial regression (N > 100k)GNNWR + knn_kSparse distance matrix, O(n·k²) diagnostics
Geostatistical simulationgeostatspy / SGeMSStochastic realizations, uncertainty quantification

Choose GNNWR when: You need spatially varying regression coefficients with neural network-based geographic weighting, especially for large datasets where classical GWR is computationally infeasible.

Choose classical GWR when: You need well-established inferential statistics, bandwidth-based weighting, and simpler model interpretation.

Choose verde/kriging when: You need spatial interpolation without explanatory variables — pure spatial prediction from observed values.

Common Workflows

Spatial Regression Analysis

  • EDA: Check spatial distribution, feature correlations, OLS baseline
  • Data split: init_dataset with appropriate ratios and sample_seed=42
  • Train: Start with defaults, tune start_lr and early_stop
  • Diagnose: R², RMSE, F1 (GNNWR vs OLS), F2 (spatial weight significance)
  • Visualize: Coefficient maps, residual spatial distribution, pred vs obs
  • Interpret: Where do coefficients vary most? Which variables show strongest non-stationarity? (F3_Local)
  • Report: Model summary table + coefficient maps + diagnostic statistics

Common Issues

IssueSolution
Model degenerates to global regressionForgot spatial_column — always pass it
OOM on distance matrixN > 10k without knn_k; use knn_k=500–2000
Loss explodes during trainingstart_lr too high; start with 0.01
OverfittingNo early_stop; always set 20–50
Coefficients on wrong scaleUse reg_result() for denormalized predictions
GTNNWR behaves like GNNWRMissing temp_column; silently falls back

References

  • Diagnostics — DIAGNOSIS methods, F-tests, residual analysis
  • Visualization — Detailed visualization patterns and publication figures

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.2%
按下载量换算30

Claude

33.2%
按下载量换算29

Cursor

20.13%
按下载量换算18

Gemini CLI

8.99%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills