scikit-learn
应用 scikit-learn 构建机器学习模型
Também disponível em: K-Dense-AI
通过 scikit-learn 指导快速构建机器学习模型。涵盖分类、回归、聚类、预处理、管道和模型评估,提供可直接使用的示例。
Baixar o ZIP da skill
Upload no Claude
Vá em Configurações → Capacidades → Skills → Upload skill
Ative e comece a usar
Testar
A utilizar "scikit-learn". Build a classification model to predict customer churn
Resultado esperado:
- Model: RandomForestClassifier with 100 estimators
- Preprocessing: StandardScaler for numeric features, OneHotEncoder for categorical
- Cross-validation accuracy: 94.2% (+/- 1.3%)
- Top predictive features: contract_type, monthly_charges, tenure
- Recommendations: Consider GradientBoosting for higher accuracy, collect more features about customer complaints
Auditoria de Segurança
SeguroAll 566 static findings are FALSE POSITIVES. The static analyzer misidentified markdown documentation syntax (backticks for code formatting) as shell commands, Python import examples as dynamic imports, and 'PC2' (Principal Component 2) as C2 command-and-control keywords. This is a pure documentation/reference skill containing legitimate scikit-learn ML examples with no network calls, credential access, or file exfiltration capabilities.
Fatores de risco
⚡ Contém scripts (2)
⚙️ Comandos externos (2)
Pontuação de qualidade
O Que Você Pode Construir
构建生产级机器学习管道
创建端到端的机器学习工作流,包括预处理、模型训练、评估和超参数调优。
比较机器学习算法
使用标准化指标和交叉验证评估不同的分类器、回归器和聚类方法。
应用无监督学习
使用聚类、降维和异常检测技术发现数据中的模式。
Tente Estes Prompts
使用 scikit-learn 构建分类模型。使用 breast cancer 数据集。使用 train-test split、StandardScaler 预处理、RandomForest 分类器,并显示 classification report。
使用 scikit-learn 对 iris 数据集进行聚类分析。比较 K-Means、DBSCAN 和 AgglomerativeClustering。使用 elbow method 和 silhouette score 找到最佳聚类数。使用 PCA 可视化结果。
创建完整的机器学习管道,使用 ColumnTransformer 处理混合的数值和分类数据。包括预处理(插补、缩放、编码)、用于降维的 PCA 和 GradientBoosting 分类器。使用 GridSearchCV 进行超参数调优。
使用交叉验证评估分类模型。显示 accuracy、precision、recall、F1-score 和 ROC AUC。创建 confusion matrix 和 learning curves。使用 stratified k-fold 比较不平衡类别。
Melhores Práticas
- 始终使用管道来防止交叉验证中的数据泄露
- 在使用需要归一化输入的算法(SVM、KNN、神经网络)之前缩放特征
- 对于分类使用分层分割以保持类别分布
Evitar
- 在分割之前对所有数据进行预处理(导致数据泄露)
- 对不平衡的分类问题仅使用准确率
- 不为实验设置 random_state 以确保可重复性