From e9b082ff8da0273f214fbeef2769aa4a11dfeaa1 Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sat, 29 Nov 2025 18:51:00 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 15 +++++ README.md | 3 + commands/build-classifier.md | 15 +++++ plugin.lock.json | 65 +++++++++++++++++++ skills/classification-model-builder/SKILL.md | 52 +++++++++++++++ .../assets/README.md | 7 ++ .../assets/model_config_template.json | 59 +++++++++++++++++ .../references/README.md | 8 +++ .../scripts/README.md | 7 ++ 9 files changed, 231 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 commands/build-classifier.md create mode 100644 plugin.lock.json create mode 100644 skills/classification-model-builder/SKILL.md create mode 100644 skills/classification-model-builder/assets/README.md create mode 100644 skills/classification-model-builder/assets/model_config_template.json create mode 100644 skills/classification-model-builder/references/README.md create mode 100644 skills/classification-model-builder/scripts/README.md diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..e8dc2e5 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,15 @@ +{ + "name": "classification-model-builder", + "description": "Build classification models", + "version": "1.0.0", + "author": { + "name": "Claude Code Plugins", + "email": "[email protected]" + }, + "skills": [ + "./skills" + ], + "commands": [ + "./commands" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..134c0c9 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# classification-model-builder + +Build classification models diff --git a/commands/build-classifier.md b/commands/build-classifier.md new file mode 100644 index 0000000..7e9e4fa --- /dev/null +++ b/commands/build-classifier.md @@ -0,0 +1,15 @@ +--- +description: Execute AI/ML task with intelligent automation +--- + +# AI/ML Task Executor + +You are an AI/ML specialist. When this command is invoked: + +1. Analyze the current context and requirements +2. Generate appropriate code for the ML task +3. Include data validation and error handling +4. Provide performance metrics and insights +5. Save artifacts and generate documentation + +Support modern ML frameworks and best practices. diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..2785ccd --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,65 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:jeremylongshore/claude-code-plugins-plus:plugins/ai-ml/classification-model-builder", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "29012716cc45a55b174fc11d37814310b9595b18", + "treeHash": "4b20839a4de31732f9809004baab007840820b00652b7ae3345e60cc446037f9", + "generatedAt": "2025-11-28T10:18:12.863029Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "classification-model-builder", + "description": "Build classification models", + "version": "1.0.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "b4fbc607cd6daefb6e34102a984bfcec3ed5d9a0aeaa7284387607dd11f44f32" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "7e80bf4c992b6a667ca33016f282153a36feed9e9655a48ea1d7054eb366a8bb" + }, + { + "path": "commands/build-classifier.md", + "sha256": "043efb83e2f02fc6d0869c8a3a7388d6e49f6c809292b93dd6a97a1b142e5647" + }, + { + "path": "skills/classification-model-builder/SKILL.md", + "sha256": "145226f0d43d399857ddd469bdcf553157ca3f115cd856af074e659bf4fcfbf0" + }, + { + "path": "skills/classification-model-builder/references/README.md", + "sha256": "7137f7951c677b69c02b54378c6baede8a3f2f5b12444b42fb07748b162be364" + }, + { + "path": "skills/classification-model-builder/scripts/README.md", + "sha256": "f34b55e139dd729e7c01f2565a2e4d9067a3c8b4c112507c9a9025a8d08e1513" + }, + { + "path": "skills/classification-model-builder/assets/model_config_template.json", + "sha256": "155440871a59cde5686deb5612c8ae96c9430cc0ef44609bedc40b95ead23164" + }, + { + "path": "skills/classification-model-builder/assets/README.md", + "sha256": "9fa0cab51814ea07fe24bae19e5952b995ae6c546b446725e2519586b1a4b177" + } + ], + "dirSha256": "4b20839a4de31732f9809004baab007840820b00652b7ae3345e60cc446037f9" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file diff --git a/skills/classification-model-builder/SKILL.md b/skills/classification-model-builder/SKILL.md new file mode 100644 index 0000000..a939a78 --- /dev/null +++ b/skills/classification-model-builder/SKILL.md @@ -0,0 +1,52 @@ +--- +name: building-classification-models +description: | + This skill enables Claude to construct and evaluate classification models using provided datasets or specifications. It leverages the classification-model-builder plugin to automate model creation, optimization, and reporting. Use this skill when the user requests to "build a classifier", "create a classification model", "train a classification model", or needs help with supervised learning tasks involving labeled data. The skill ensures best practices are followed, including data validation, error handling, and performance metric reporting. +allowed-tools: Read, Write, Edit, Grep, Glob, Bash +version: 1.0.0 +--- + +## Overview + +This skill empowers Claude to efficiently build and deploy classification models. It automates the process of model selection, training, and evaluation, providing users with a robust and reliable classification solution. The skill also provides insights into model performance and suggests potential improvements. + +## How It Works + +1. **Context Analysis**: Claude analyzes the user's request, identifying the dataset, target variable, and any specific requirements for the classification model. +2. **Model Generation**: The skill utilizes the classification-model-builder plugin to generate code for training a classification model based on the identified dataset and requirements. This includes data preprocessing, feature selection, model selection, and hyperparameter tuning. +3. **Evaluation and Reporting**: The generated model is trained and evaluated using appropriate metrics (e.g., accuracy, precision, recall, F1-score). Performance metrics and insights are then provided to the user. + +## When to Use This Skill + +This skill activates when you need to: +- Build a classification model from a given dataset. +- Train a classifier to predict categorical outcomes. +- Evaluate the performance of a classification model. + +## Examples + +### Example 1: Building a Spam Classifier + +User request: "Build a classifier to detect spam emails using this dataset." + +The skill will: +1. Analyze the provided email dataset to identify features and the target variable (spam/not spam). +2. Generate Python code using the classification-model-builder plugin to train a spam classification model, including data cleaning, feature extraction, and model selection. + +### Example 2: Predicting Customer Churn + +User request: "Create a classification model to predict customer churn using customer data." + +The skill will: +1. Analyze the customer data to identify relevant features and the churn status. +2. Generate code to build a classification model for churn prediction, including data validation, model training, and performance reporting. + +## Best Practices + +- **Data Quality**: Ensure the input data is clean and preprocessed before training the model. +- **Model Selection**: Choose the appropriate classification algorithm based on the characteristics of the data and the specific requirements of the task. +- **Hyperparameter Tuning**: Optimize the model's hyperparameters to achieve the best possible performance. + +## Integration + +This skill integrates with the classification-model-builder plugin to automate the model building process. It can also be used in conjunction with other plugins for data analysis and visualization. \ No newline at end of file diff --git a/skills/classification-model-builder/assets/README.md b/skills/classification-model-builder/assets/README.md new file mode 100644 index 0000000..8a58129 --- /dev/null +++ b/skills/classification-model-builder/assets/README.md @@ -0,0 +1,7 @@ +# Assets + +Bundled resources for classification-model-builder skill + +- [ ] model_config_template.json: A template JSON file for specifying model configurations, including hyperparameters and training parameters. +- [ ] example_dataset.csv: A sample CSV dataset that can be used for testing the classification model builder. +- [ ] report_template.html: An HTML template for generating the model performance report. diff --git a/skills/classification-model-builder/assets/model_config_template.json b/skills/classification-model-builder/assets/model_config_template.json new file mode 100644 index 0000000..971f813 --- /dev/null +++ b/skills/classification-model-builder/assets/model_config_template.json @@ -0,0 +1,59 @@ +{ + "_comment": "Model configuration template for the classification model builder plugin.", + "model_name": "ExampleClassifier", + "_comment": "A descriptive name for your model.", + "model_type": "RandomForestClassifier", + "_comment": "The type of classification model to use (e.g., RandomForestClassifier, LogisticRegression, SVM).", + "data_path": "data/training_data.csv", + "_comment": "Path to the CSV file containing the training data.", + "target_column": "target", + "_comment": "The name of the column containing the target variable.", + "features": [ + "feature1", + "feature2", + "feature3", + "feature4" + ], + "_comment": "List of column names to use as features. If empty, all columns except the target_column will be used.", + "hyperparameters": { + "_comment": "Hyperparameters specific to the chosen model type.", + "n_estimators": 100, + "_comment": "Number of trees in the random forest (example for RandomForestClassifier).", + "max_depth": 10, + "_comment": "Maximum depth of the trees (example for RandomForestClassifier).", + "learning_rate": 0.1 + "_comment": "Learning rate for gradient boosting models (example for GradientBoostingClassifier)." + }, + "training_parameters": { + "_comment": "Parameters related to the training process.", + "test_size": 0.2, + "_comment": "The proportion of the data to use for testing.", + "random_state": 42, + "_comment": "A random seed for reproducibility.", + "stratify": true + "_comment": "Whether to stratify the target variable during train/test split." + }, + "evaluation_metrics": [ + "accuracy", + "precision", + "recall", + "f1-score", + "roc_auc" + ], + "_comment": "List of evaluation metrics to compute on the test set.", + "model_save_path": "models/example_classifier.pkl", + "_comment": "Path to save the trained model.", + "feature_importance": true, + "_comment": "Boolean value to toggle feature importance calculation.", + "preprocessing": { + "_comment": "Configuration for data preprocessing steps.", + "handle_missing_values": "impute", + "_comment": "How to handle missing values (e.g., 'impute', 'remove', 'none').", + "missing_value_strategy": "mean", + "_comment": "Strategy for imputation (e.g., 'mean', 'median', 'most_frequent').", + "scale_features": true, + "_comment": "Whether to scale numerical features using StandardScaler or similar.", + "feature_scaling_method": "standard" + "_comment": "Method to use for feature scaling ('standard' or 'minmax')." + } +} \ No newline at end of file diff --git a/skills/classification-model-builder/references/README.md b/skills/classification-model-builder/references/README.md new file mode 100644 index 0000000..703b91b --- /dev/null +++ b/skills/classification-model-builder/references/README.md @@ -0,0 +1,8 @@ +# References + +Bundled resources for classification-model-builder skill + +- [ ] model_evaluation_metrics.md: Detailed explanations of various classification model evaluation metrics (accuracy, precision, recall, F1-score, AUC-ROC) and their interpretation. +- [ ] data_preprocessing_guide.md: Best practices for data preprocessing, including handling missing values, feature scaling, and encoding categorical variables. +- [ ] model_selection_guide.md: Guidelines for selecting the appropriate classification model based on the characteristics of the dataset and the problem being solved. +- [ ] hyperparameter_tuning.md: Techniques for hyperparameter tuning to optimize model performance. diff --git a/skills/classification-model-builder/scripts/README.md b/skills/classification-model-builder/scripts/README.md new file mode 100644 index 0000000..fc289ff --- /dev/null +++ b/skills/classification-model-builder/scripts/README.md @@ -0,0 +1,7 @@ +# Scripts + +Bundled resources for classification-model-builder skill + +- [ ] model_builder.py: Automates the process of building, training, and evaluating classification models. Takes dataset path and model configuration as input. +- [ ] data_validator.py: Validates the input dataset for common issues like missing values, incorrect data types, and imbalanced classes. +- [ ] report_generator.py: Generates a comprehensive report of the model's performance, including metrics like accuracy, precision, recall, and F1-score.