分类算法简介_分类-简介

分类算法简介

分类算法简介

分类-简介 (Classification - Introduction)

分类简介 (Introduction to Classification)

Classification may be defined as the process of predicting class or category from observed values or given data points. The categorized output can have the form such as “Black” or “White” or “spam” or “no spam”.

分类可以定义为根据观测值或给定数据点预测类别或类别的过程。 分类的输出可以采用“黑色”或“白色”或“垃圾邮件”或“无垃圾邮件”的形式。

Mathematically, classification is the task of approximating a mapping function (f) from input variables (X) to output variables (Y). It is basically belongs to the supervised machine learning in which targets are also provided along with the input data set.

在数学上,分类是从输入变量(X)到输出变量(Y)近似映射函数(f)的任务。 它基本上属于有监督的机器学习,在该机器学习中,还提供了目标以及输入数据集。

An example of classification problem can be the spam detection in emails. There can be only two categories of output, “spam” and “no spam”; hence this is a binary type classification.

分类问题的一个示例可以是电子邮件中的垃圾邮件检测。 只能有两类输出,“垃圾邮件”和“无垃圾邮件”; 因此,这是一个二进制类型分类。

To implement this classification, we first need to train the classifier. For this example, “spam” and “no spam” emails would be used as the training data. After successfully train the classifier, it can be used to detect an unknown email.

为了实现这种分类,我们首先需要训练分类器。 在此示例中,“垃圾邮件”和“无垃圾邮件”电子邮件将用作培训数据。 成功训练分类器后,可以将其用于检测未知电子邮件。

分类中学习者的类型 (Types of Learners in Classification)

We have two types of learners in respective to classification problems −

对于分类问题,我们有两种类型的学习者-

懒惰的学习者 (Lazy Learners)

As the name suggests, such kind of learners waits for the testing data to be appeared after storing the training data. Classification is done only after getting the testing data. They spend less time on training but more time on predicting. Examples of lazy learners are K-nearest neighbor and case-based reasoning.

顾名思义,这类学习者在存储训练数据后等待测试数据出现。 仅在获取测试数据后才进行分类。 他们花在培训上的时间更少,但花在预测上的时间却更多。 懒惰学习者的例子有K近邻和基于案例的推理。

渴望学习者 (Eager Learners)

As opposite to lazy learners, eager learners construct classification model without waiting for the testing data to be appeared after storing the training data. They spend more time on training but less time on predicting. Examples of eager learners are Decision Trees, Naïve Bayes and Artificial Neural Networks (ANN).

与懒惰的学习者相反,热心的学习者在存储训练数据后无需等待测试数据出现就构造分类模型。 他们花更多的时间在训练上,而花更少的时间在预测上。 渴望学习的人的例子有决策树,朴素贝叶斯和人工神经网络(ANN)。

在Python中构建分类器 (Building a Classifier in Python)

Scikit-learn, a Python library for machine learning can be used to build a classifier in Python. The steps for building a classifier in Python are as follows −

Scikit-learn是用于机器学习的Python库,可用于在Python中构建分类器。 在Python中构建分类器的步骤如下-

步骤1:导入必要的python包 (Step1: Importing necessary python package)

For building a classifier using scikit-learn, we need to import it. We can import it by using following script −

为了使用scikit-learn构建分类器,我们需要将其导入。 我们可以使用以下脚本导入它-


import sklearn

步骤2:导入数据集 (Step2: Importing dataset)

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值