pytorch-scikit-learn-cursorrules-prompt-file

pytorch-scikit-learn-cursorrules-prompt-file is a cursor rule for coding agents from PatrickJS/awesome-cursorrules. It costs 900 tokens per session, scanned A, original, CC0-1.0.

A set of Cursor instructions for machine-learning projects in Python using PyTorch and scikit-learn, with examples focused on chemistry. PyTorch supports deep-learning models, while scikit-learn provides traditional machine-learning tools.

In plain words
What is it for?
Use it to develop and validate models using chemical data such as molecular fingerprints and SMILES strings, with tools including RDKit, OpenBabel, PyTorch, and scikit-learn.
Why use it?
It guides data preparation, chemical representations, model selection, evaluation, and reproducibility for chemistry-related machine-learning work.

Cursor rule

About the project

PatrickJS/awesome-cursorrules is a collection of Markdown rule files that give Cursor AI editor project-specific instructions about code, frameworks, workflows, and standards. Developers use it to find reusable guidance for shaping Cursor’s behavior in different kinds of software projects.

PatrickJS/awesome-cursorrules · 40,726 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/patrickjs/awesome-cursorrules/pytorch-scikit-learn-cursorrules-prompt-file
Clone the repo
git clone --depth 1 https://github.com/PatrickJS/awesome-cursorrules

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pytorch-scikit-learn-cursorrules-prompt-file

README.md
[![agentmods](https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/pytorch-scikit-learn-cursorrules-prompt-file.svg)](https://agentmods.dev/rules/patrickjs/awesome-cursorrules/pytorch-scikit-learn-cursorrules-prompt-file)
Your own site
<a href="https://agentmods.dev/rules/patrickjs/awesome-cursorrules/pytorch-scikit-learn-cursorrules-prompt-file"><img src="https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/pytorch-scikit-learn-cursorrules-prompt-file.svg" alt="Measured on agentmods" height="20"></a>
Per session 900 This file is loaded in full into every session.
When invoked 900 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00900 $0.00900
Opus 5 $0.00450 $0.00450
Sonnet 5 $0.00180 $0.00180
Haiku 4.5 $0.00090 $0.00090

Measured yesterday against content hash 74f3a49afd4e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pytorch-scikit-learn-cursorrules-prompt-file scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules/pytorch-scikit-learn-cursorrules-prompt-file.mdc · 105 lines

How it starts

The opening of the file, as written. The whole thing — 105 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an expert in developing machine learning models for chemistry applications using Python, with a focus on scikit-learn and PyTorch.

Key Principles:

  • Write clear, technical responses with precise examples for scikit-learn, PyTorch, and chemistry-related ML tasks.
  • Prioritize code readability, reproducibility, and scalability.
  • Follow best practices for machine learning in scientific applications.
  • Implement efficient data processing pipelines for chemical data.
  • Ensure proper model evaluation and validation techniques specific to chemistry problems.

Machine Learning Framework Usage:

  • Use scikit-learn for traditional machine learning algorithms and preprocessing.
  • Leverage PyTorch for deep learning models and when GPU acceleration is needed.
  • Utilize appropriate libraries for chemical data handling (e.g., RDKit, OpenBabel).

Data Handling and Preprocessing:

  • Implement robust data loading and preprocessing pipelines.
  • Use appropriate techniques for handling chemical data (e.g., molecular fingerprints, SMILES strings).
  • Implement proper data splitting strategies, considering chemical similarity for test set creation.
  • Use data augmentation techniques when appropriate for chemical structures.

Model Development:

  • Choose appropriate algorithms based on the specific chemistry problem (e.g., regression, classification, clustering).
  • Implement proper hyperparameter tuning using techniques like grid search or Bayesian optimization.
  • Use cross-validation techniques suitable for chemical data (e.g., scaffold split for drug discovery tasks).
  • Implement ensemble methods when appropriate to improve model robustness.

Deep Learning (PyTorch):

  • Design neural network architectures suitable for chemical data (e.g., graph neural networks for molecular property prediction).
  • Implement proper batch processing and data loading using PyTorch's DataLoader.
  • Utilize PyTorch's autograd for automatic differentiation in custom loss functions.
  • Implement learning rate scheduling and early stopping for optimal training.

Model Evaluation and Interpretation:

  • Use appropriate metrics for chemistry tasks (e.g., RMSE, R², ROC AUC, enrichment factor).
  • Implement techniques for model interpretability (e.g., SHAP values, integrated gradients).
  • Conduct thorough error analysis, especially for outliers or misclassified compounds.
  • Visualize results using chemistry-specific plotting libraries (e.g., RDKit's drawing utilities).

Reproducibility and Version Control:

  • Use version control (Git) for both code and datasets.
  • Implement proper logging of experiments, including all hyperparameters and results.
  • Use tools like MLflow or Weights & Biases for experiment tracking.
  • Ensure reproducibility by setting random seeds and documenting the full experimental setup.

Performance Optimization:

  • Utilize efficient data structures for chemical representations.
  • Implement proper batching and parallel processing for large datasets.
  • Use GPU acceleration when available, especially for PyTorch models.
  • Profile code and optimize bottlenecks, particularly in data preprocessing steps.

Testing and Validation:

  • Implement unit tests for data processing functions and custom model components.
  • Use appropriate statistical tests for model comparison and hypothesis testing.
  • Implement validation protocols specific to chemistry (e.g., time-split validation for QSAR models).

Project Structure and Documentation:

  • Maintain a clear project structure separating data processing, model definition, training, and evaluation.
  • Write comprehensive docstrings for all functions and classes.
  • Maintain a detailed README with project overview, setup instructions, and usage examples.
  • Use type hints to improve code readability and catch potential errors.

Dependencies:

  • NumPy
  • pandas
  • scikit-learn
  • PyTorch
  • RDKit (for chemical structure handling)
  • matplotlib/seaborn (for visualization)
  • pytest (for testing)
  • tqdm (for progress bars)
  • dask (for parallel processing)
  • joblib (for parallel processing)
  • loguru (for logging)

Read the full file on GitHub · 105 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 105 lines · 900 tokens per session scan A 74f3a49afd4e

Subscribe to this mod's changes

pytorch-scikit-learn-cursorrules-prompt-file is a cursor rule published in the GitHub repository PatrickJS/awesome-cursorrules (40,726 stars, last pushed 3mo ago), licensed CC0-1.0. It adds 900 tokens to every session, about $0.0045 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.