How to use Claude to combine rules and ML classification
Claude Code reviewed a dataframe project and integrated a hybrid classifier that learned from rule-classified records. The author reported a 99.3% match and about one minute of runtime.
Suggested prompt
Suggested prompt written by Agents In Use, not the source author. Replace bracketed inputs and review tool permissions first.
Review [dataframe project] and its existing rules for assigning [target column]. Propose features and weighting for a hybrid classifier. Keep rule-based classifications, train a model on them, and classify unresolved records. Evaluate against [reference labels] and report runtime and errors.
Reach people exploring AI agents
See placements →Evidence at a glance
Sourced account- Source poster / publisher
- jm4
- Original account
- Read the source ↗
- Published
- Source link checked
- Reported result
- The author reported a 99.3% match from the automated process, which ran in about one minute versus roughly four hours for the previous manual work.
- Human involvement
- The author supplied existing rules and discussed features and weighting; the post does not describe a formal evaluation protocol.
A linked account supports attribution. It does not mean we independently reproduced its result.
Report an issue with this case
Open correction emailOpens your email app with the case link included. Nothing is sent automatically.
How the agent did it
- Implemented matching rules for a dataframe classification task.
- Asked Claude Code for a hybrid rules-and-ML approach.
- Discussed model features and weighting with Claude Code.
The author had a dataframe task in which one column's value depended on values in several other columns. Existing matching rules handled most records, but data-quality problems left gaps. They asked Claude Code to implement a hybrid approach combining those rules with machine learning, then discussed features and weighting with it.
Claude Code reviewed the whole project, built the model and integrated it with the existing implementation. The resulting process first uses the author's rules to classify records. It trains a model on those classifications and then applies that model to the remaining records. This preserved the existing rules as part of the workflow rather than replacing them outright.
The author reported a 99.3% match for the automated version of work previously performed manually. They said implementation took the AI a few minutes and cost a couple of dollars. The resulting program reportedly ran in about one minute, compared with roughly four hours for the manual process. The post does not explain the match evaluation methodology.
Who it's for: Developers with useful classification rules whose unresolved records could benefit from an additional model.
Prompt
Suggested prompt (written by Agents In Use, not the author's)
Source: Hacker News · jm4
Frequently asked questions
How were the rules and machine learning combined?
The process classified records with existing rules, trained a model on those classifications and used the model to classify the remaining records.
What accuracy and runtime did the author report?
The author reported a 99.3% match and a runtime of about one minute, compared with roughly four hours manually. The post does not detail the evaluation methodology.
More details
Remaining steps
- Had Claude review the project, build the model and integrate it.
- Reported the automated process's match rate and runtime.
About this account
Claude Code reviewed the project and implemented and integrated the model after discussion of the approach.
Platform: Hacker News. Attribution: https://news.ycombinator.com/item?id=44434010. Prompt: Suggested (written by Agents In Use, not the author's). Sourced by the Agents In Use pipeline.
Credit: jm4 on Hacker News
Source published
Added to Agents In Use
Source checked
Tools and topics
Claude Code
Dataframes · Machine learning · Classification
Editorial completeness: 100/100. Measures documented fields, not agent performance or verified outcomes.