unsupervised-learning
Run and debug ML-From-Scratch unsupervised PCA, clustering, association mining, GMM, genetic search, and RBM workflows.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- unsupervised-learning
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Run and debug ML-From-Scratch unsupervised PCA, clustering, association mining, GMM, genetic search, and RBM workflows.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/algorithm-catalog.md4.1 KB
- 参考文档references/troubleshooting.md6.5 KB
- 参考文档references/workflows.md5.7 KB
- 脚本scripts/run_association_smoke.py3.9 KB
- 脚本scripts/run_clustering_smoke.py4.0 KB
- 脚本scripts/run_optimization_smoke.py3.3 KB
03 SKILL.md 正文
ML-From-Scratch Unsupervised Learning
Use this sub-skill when a task asks for ML-From-Scratch workflows in clustering,
dimensionality reduction, density modeling, association mining, transaction
rules, string-target genetic search, or RBM reconstruction. It assumes the
mlfromscratch package is importable in a CPU Python environment and keeps all
runtime guidance self-contained.
Route here
- PCA dimensionality reduction with
PCA().transform(X, n_components). - Clustering with
KMeans,DBSCAN,PAM, orGaussianMixtureModel. - Frequent itemset and rule mining with
AprioriorFPGrowth. - Toy optimization/search with
GeneticAlgorithmtargeting a string. - Advanced unsupervised reconstruction with
RBM.
Route elsewhere
- Supervised regressors, classifiers, trees, ensembles, Bayes, LDA, SVM,
boosting, and supervised neural estimators:
../supervised-learning/. - Low-level neural-network layers, losses, optimizers, CNN/RNN/MLP, GAN,
DCGAN, and autoencoder assembly details:
../deep-learning/. - CartPole, DQN, Gym reset/step compatibility, replay memory, and rendering:
../reinforcement-learning/. - Cross-cutting package install/import issues:
../../references/troubleshooting.md.
Start with these references
references/algorithm-catalog.mdfor constructors, methods, return values, state, and known API quirks.references/workflows.mdfor safe recipes: clustering/PCA, association mining with string normalization, genetic search, and RBM reconstruction.references/troubleshooting.mdfor scaling, DBSCAN density parameters, KMeans empty clusters, transaction formatting, support/confidence, RBM speed, and headless plotting.../../references/package-overview.mdfor package-level install context.../../references/shared-utilities.mdfor shared helpers such asnormalize,standardize,euclidean_distance, and plotting helpers.
Fast bundled checks
Run these from this sub-skill directory or adapt their in-memory patterns:
python scripts/run_clustering_smoke.py --help
python scripts/run_clustering_smoke.py
python scripts/run_association_smoke.py
python scripts/run_optimization_smoke.py --iterations 5
The bundled scripts avoid network access, credentials, destructive writes, and interactive plotting. They are smoke checks for import/API usability, not benchmark or quality claims.
Operating reminders
- These classes use repo-specific APIs, not scikit-learn estimators. Most
clustering classes expose
predict(X)directly; PCA exposestransform(X, n_components); there is often no separatefitcall. - Cluster labels are arbitrary IDs. Compare partitions by counts, separation, or downstream use rather than expecting fixed label numbers.
- Set
numpy.random.seed(...)before KMeans, PAM, GMM, or GeneticAlgorithm when a deterministic result is needed. - Scale or standardize numeric features before distance- or covariance-based algorithms unless all features are already comparable.
- Normalize string transactions before Apriori; use count-style support for FPGrowth in this implementation.
- Treat RBM as an advanced, slower reconstruction workflow. Start with tiny batches and few iterations before scaling up.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).