| |
|
开发:
C++知识库
Java知识库
JavaScript
Python
PHP知识库
人工智能
区块链
大数据
移动开发
嵌入式
开发工具
数据结构与算法
开发测试
游戏开发
网络协议
系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程 数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁 |
-> Python知识库 -> How to Evaluate The Performance of Deep Learning Models -> 正文阅读 |
|
[Python知识库]How to Evaluate The Performance of Deep Learning Models |
There are a lot of decisions to make when designing and configuring your deep learning models.In this blog you will discover a few ways that you can use to evaluate model performance using Keras. After completing this lesson. You will know:
1.1 Empirically Evaluate Network ConfigurationsDeep learning is often used on problems that have very large datasets.Deep learning is often used on problems that have very large datasets. 1.2 Data SplitingThe large amount of data and the complexity of the models require very long training times. As such, it is typically to use a simple separation of data into training and test datasets or training and validation datasets. Keras provides two convenient ways of evaluating your deep learning algorithms this way:
1.2.1 Use a Automatic Verification DatasetKeras can separate a portion of your training data into a validation dataset and evaluate the performance of your model on that validation dataset each epoch.You can do this by setting the validation_split argument on the fit() function to a percentage of the size of your training dataset. The example below demonstrates the use of using an automatic validation dataset on the Pima Indians onset of diabetes dataset:
? 1.2.2 Use a Manual Verification DatasetKeras also allow you? to manually specify the dataset to use for validation during training. we handy train_test_split() function from the Python scikit-learn machine learning library to separate our data into a training and test dataset. We use 67% for training and the remaining 33% of the data for validation. The validation dataset can be specified to the fit() function in Keras by the validation_data argument. It takes a tuple of the input and output datasets. 1.3 Manual k-Fold Cross ValidationThe gold standard for machine learning model evaluation is k-fold cross validation. It provides a robust estimate of the performance of a model on unseen data.It provides a robust estimate of the performance of a model on unseen data. ????? Cross validation is often not used for evaluating deep learning models because of the greater computational expense. In the example below we use the handy StratifiedKFold class1 from the scikit-learn Python machine learning library to split up the training dataset into 2 folds. The folds are stratified, meaning that the algorithm attempts to balance the number of instances of each class in each fold. The example creates and evaluates 10 models using the 2 splits of the data and collects all of the scores. The verbose output for each epoch is turned o? by passing verbose=0 to the fit() and evaluate() functions on the model. The performance is printed for each model and it is stored. The average and standard deviation of the model performance is then printed at the end of the run to provide a robust estimate of model accuracy.
Notice that we had to re-create the model each loop to then fit and evaluate it with the data for the fold. In the next lesson we will look at how we can use Keras models natively with the scikit-learn machine learning library. 1.4 SummaryIn this lesson, you discovered the importance of having a robust way to estimate the performance of your deep learning models on unseen data. You learned three ways that you can estimate the performance of your deep learning models in Python using the Keras library:
1.4.1 NextYou now know how to evaluate your models and estimate their performance. In the next lesson you will discover how you can best integrate your Keras models with the scikit-learn machine learning library. |
|
|
上一篇文章 下一篇文章 查看所有文章 |
|
开发:
C++知识库
Java知识库
JavaScript
Python
PHP知识库
人工智能
区块链
大数据
移动开发
嵌入式
开发工具
数据结构与算法
开发测试
游戏开发
网络协议
系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程 数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁 |
360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 | -2024/11/15 13:34:54- |
|
网站联系: qq:121756557 email:121756557@qq.com IT数码 |