博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
提升算法的sklearn-kit的API
阅读量:4145 次
发布时间:2019-05-25

本文共 1712 字,大约阅读时间需要 5 分钟。

Turns Out…

We can see from the scores above that our Naive Bayes model actually does a pretty good job of classifying spam and “ham.” However, let’s take a look at a few additional models to see if we can’t improve anyway.

Specifically in this notebook, we will take a look at the following techniques:

Another really useful guide for ensemble methods can be found .

These ensemble methods use a combination of techniques you have seen throughout this lesson:

  • Bootstrap the data passed through a learner (bagging).
  • Subset the features used for a learner (combined with bagging signifies the two random components of random forests).
  • Ensemble learners together in a way that allows those that perform best in certain areas to create the largest impact (boosting).

In this notebook, let’s get some practice with these methods, which will also help you get comfortable with the process used for performing supervised machine learning in Python in general.

Since you cleaned and vectorized the text in the previous notebook, this notebook can be focused on the fun part - the machine learning part.

This Process Looks Familiar…

In general, there is a five step process that can be used each time you want to use a supervised learning method (which you actually used above):

  1. Import the model.
  2. Instantiate the model with the hyperparameters of interest.
  3. Fit the model to the training data.
  4. Predict on the test data.
  5. Score the model by comparing the predictions to the actual values.

Follow the steps through this notebook to perform these steps using each of the ensemble methods: BaggingClassifier, RandomForestClassifier, and AdaBoostClassifier.

Step 1: First use the documentation to import all three of the models.

转载地址:http://vifti.baihongyu.com/

你可能感兴趣的文章
JavaScript substr() 方法
查看>>
JavaScript slice() 方法
查看>>
JavaScript substring() 方法
查看>>
HTML 5 新的表单元素 datalist keygen output
查看>>
(转载)正确理解cookie和session机制原理
查看>>
jQuery ajax - ajax() 方法
查看>>
将有序数组转换为平衡二叉搜索树
查看>>
最长递增子序列
查看>>
从一列数中筛除尽可能少的数,使得从左往右看这些数是从小到大再从大到小...
查看>>
判断一个整数是否是回文数
查看>>
经典shell面试题整理
查看>>
腾讯的一道面试题—不用除法求数字乘积
查看>>
素数算法
查看>>
java多线程环境单例模式实现详解
查看>>
将一个数插入到有序的数列中,插入后的数列仍然有序
查看>>
在有序的数列中查找某数,若该数在此数列中,则输出它所在的位置,否则输出no found
查看>>
万年历
查看>>
作为码农你希望面试官当场指出你错误么?有面试官这样遭到投诉!
查看>>
好多程序员都认为写ppt是很虚的技能,可事实真的是这样么?
查看>>
如果按照代码行数发薪水会怎样?码农:我能刷到公司破产!
查看>>