ml-algorithms
Use this skill for MLAlgorithms (`mla`) educational machine-learning implementations: classical estimators, clustering/reduction, metrics, NeuralNet building blocks, and DQN examples.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- ml-algorithms
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use this skill for MLAlgorithms (`mla`) educational machine-learning implementations: classical estimators, clustering/reduction, metrics, NeuralNet building blocks, and DQN examples.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/api-reference.md3.8 KB
- 参考文档references/repo-provenance.md2.9 KB
- 参考文档references/repo-routing-metadata.json525 B
- 参考文档references/troubleshooting.md3.1 KB
- 参考文档references/workflows.md3.4 KB
- 脚本scripts/run_import_smoke.py5.2 KB
03 SKILL.md 正文
MLAlgorithms Repo Skill
Use this skill when a task asks about the rushter/MLAlgorithms package, the mla Python distribution, or its minimal NumPy/SciPy/autograd implementations of common machine-learning algorithms. The package is educational rather than production-optimized: favor small examples, explicit NumPy arrays, deterministic seeds, and direct metric checks.
First checks
-
Install the package and its scientific Python dependencies in an isolated environment. The public distribution name is
mla. -
Confirm the package imports:
python - <<'PY' import mla from mla.linear_models import LinearRegression from mla.kmeans import KMeans from mla.neuralnet import NeuralNet print("mla import ok") PY -
Run
scripts/run_import_smoke.py --jsonfrom this skill directory to inspect package imports, dependency versions, important signatures, and compatibility warnings without training, plotting, downloading, or reading original examples. -
Read
references/repo-provenance.mdbefore deciding whether this skill is current for a checkout or should be refreshed.
Route by user goal
- Classical supervised estimators: use
sub-skills/classical-estimators/SKILL.mdfor linear/logistic regression, KNN, Naive Bayes, SVM kernels, random forests, gradient boosting, and experimental factorization machines. - Unsupervised and reduction workflows: use
sub-skills/unsupervised-and-reduction/SKILL.mdfor KMeans, GaussianMixture, PCA, t-SNE, RBM, demo dataset loaders, distances, and no-display clustering/reduction checks. - Neural network building blocks: use
sub-skills/neural-network-building-blocks/SKILL.mdforNeuralNet, layers, activations, initializers, constraints, regularizers, optimizers, CNN/RNN/LSTM recipes, and DQN wiring.
Common decisions
- Package name: install/query distribution
mla; import packagemla. - No CLIs: the project exposes Python APIs and example modules, not console entry points. Use bundled skill scripts for safe checks.
- Backend: selected workflows are CPU-only. A visible GPU is not required for this package.
- Compatibility: the current dataset text loader uses deprecated
np.bool; prefer NumPy<1.24or patch the loader before usingload_nietzsche()with modern NumPy. The DQN loop expects legacy Gym reset/step signatures, so do not assume Gymnasium compatibility. - Shapes: most estimators expect 2D feature arrays. Neural layers use explicit 2D dense, 3D sequence, or 4D image tensors.
- Plots and long examples: repo examples include plotting, MNIST ConvNet, RNN text generation, and CartPole DQN training. Treat those as reference workflows unless the user explicitly authorizes longer runs or display side effects.
Root references
references/api-reference.md: package-wide imports, metrics, datasets, dependency facts, and public API index.references/workflows.md: how to select and combine the sub-skills for common tasks.references/troubleshooting.md: cross-cutting install/import, dependency, data-loader, plotting, and runtime problems.references/repo-provenance.md: source snapshot and refresh triggers.references/repo-routing-metadata.json: structured metadata for the managed repo-skills router.
Bundled helpers
scripts/run_import_smoke.py: safe package/dependency/signature check for the active Python environment.sub-skills/classical-estimators/scripts/run_classical_smoke.py: small supervised estimator checks.sub-skills/unsupervised-and-reduction/scripts/run_unsupervised_smoke.py: small clustering/reduction/RBM checks.sub-skills/neural-network-building-blocks/scripts/run_neural_smoke.py: small dense/RBM/DQN-wiring checks.
Minimal examples
Classical estimator:
from mla.linear_models import LogisticRegression
model = LogisticRegression(lr=0.01, max_iters=300)
model.fit(X_train, y_train)
proba = model.predict(X_test)
labels = (proba >= 0.5).astype(int)
Unsupervised estimator:
from mla.kmeans import KMeans
model = KMeans(K=3, init="++", max_iters=50)
model.fit(X)
labels = model.predict()
Neural model:
from mla.neuralnet import NeuralNet
from mla.neuralnet.layers import Dense, Activation
from mla.neuralnet.optimizers import Adam
model = NeuralNet([Dense(16), Activation("relu"), Dense(1)], Adam(), loss="mse", max_epochs=5)
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).