算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
ml-experiment-standards【设计与创意】Always invoke for training, validating, tuning, benchmarking, or claiming readiness of a predictive model. Covers leakage audits, spatial and grouped splits, metrics, reproducibility, and honest reporting. Invoke especially when spatial dependence, split design, or deployment geography is unknown; uncertainty is a reason to use this skill. Do not tri…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Purpose: every ML job (quick prototypes included) is reproducible, leakage-free, and metric-justified. These are not optional polish; every skipped item typically returns as "the model collapsed in production" or "the result didn't replicate".
Before any model, produce and show: distributions, missingness rates, outliers, target balance, salient correlations. Metric and loss choice depend on this information; a model recommendation without EDA is a guess.
At every split decision, answer explicitly (and write the answer as a code comment): "Does the training set contain indirect information about any test sample?"
| Data type | Correct split | Why |
|---|---|---|
| Independent samples | Stratified k-fold | Preserves class ratios |
| Time series | TimeSeriesSplit / walk-forward | Future must not leak into past |
| Spatial data | Spatial block CV — see references/spatial-cv-protocol.md | Neighbors are near-duplicates |
| Grouped data (patient, parcel, scene) | GroupKFold | A group must not straddle the split |
sklearn.pipeline.Pipeline — CV then fits correctly by construction.The spatial protocol in references/spatial-cv-protocol.md is the single
canonical source for this repo — other skills link here; do not restate it.
Never choose a metric by default; write a one-sentence rationale:
Every training script follows this shape (script-first; no notebook magic):
"""Experiment: <name>. Goal and success criterion: <one sentence>."""
from dataclasses import dataclass, asdict
import json, random
import numpy as np
@dataclass
class Config:
seed: int = 42
lr: float = 1e-3
batch_size: int = 32
epochs: int = 100
patience: int = 10 # early stopping
def set_seed(seed: int) -> None:
random.seed(seed)
np.random.seed(seed)
# if torch: torch.manual_seed(seed); torch.cuda.manual_seed_all(seed)
def main(cfg: Config) -> None:
set_seed(cfg.seed)
... # data -> split -> pipeline -> train -> evaluate
with open("runs/run_meta.json", "w", encoding="utf-8") as f:
json.dump({"config": asdict(cfg), "metrics": metrics}, f, indent=2)
if __name__ == "__main__":
main(Config())
pip freeze > requirements.txt).geo-deep-learning.Position every model in its chain in one paragraph: data source → cleaning → features/versioning → training → evaluation → deployment (batch/real-time) → monitoring (data/model drift). Even for a prototype, note "what this step becomes in production".
## Experiment: <name>
- Data: n=<>, split: <strategy + rationale>
- Baseline: <model> → <metric ± CI>
- Model: <model> → <metric ± CI>
- Leakage audit: <what was checked>
- Next step: <single recommendation>
When reporting differences, respect statistical honesty: if the gap doesn't exceed the across-fold std, say "no clear difference" — no p-hacking, no selective reporting.