deep-learning - 多层感知器分类器属性
问题描述
我正在使用来自 scikit-learn 的多层感知器分类器在 MNIST 数据集上训练一个神经网络,用于专门对数据集中的数字 0,1 和 7 进行分类。
这是代码片段:
from sklearn.neural_network import MLPClassifier
mlp = MLPClassifier(hidden_layer_sizes=4, max_iter=1000, verbose = True,
random_state=211)
在这里,我们如何决定为 hidden_layer_sizes 和 max_iter 分配什么值?
我正在尝试使用损失函数来查看我的模型是如何学习的。请看下面:
import matplotlib.pyplot as plt
plt.plot(mlp.loss_curve_)
plt.xlabel('Number of epochs')
plt.ylabel('loss')
plt.title('The loss curve for our mlp classifier')
None
看上面的情节,我应该推断和理解什么以及我的模型是如何学习的?
然后我得出一个学习性能指标的分类报告:
from sklearn.metrics import classification_report
report = classification_report(y_test, y_pred)
print(report)
precision recall f1-score support
0 1.00 1.00 1.00 59 1 1.00 1.00 1.00 60 7 1.00 1.00 1.00 59 accuracy 1.00 178 macro avg 1.00 1.00 1.00 178 weighted avg 1.00 1.00 1.00 178
从上面的分类报告中需要了解什么以及数字0,1和7在上面的报告中是如何分类的?
谢谢!!
解决方案
推荐阅读
- amazon-cloudfront - AWS CloudFront:源域名和备用域名 = 相同的域名
- python - terraform google cloud run 添加云 sql 连接
- python - 用 mitmproxy 修改 json body
- sql - 如何将半码转换为 sql
- java - 在 Device Farm 中访问 TestNG 测试的测试资源时出现问题
- php - 在 twig (1.*) 模板中保留变量之间的空格
- python - 如何使用 python 从某个网站复制文本?
- python - 使用 Matplot lib 的多个绘图
- python - 无法从 Django 中的“gensim.summarization”模块导入
- bash - 文件尚不存在“这超出了 GitHub 的文件大小限制 100.00 MB”