Wu Yuxiong - born natural python Machine Learning: Introduction to Machine Learning

Apart from some insignificant cases, it is difficult to obtain directly from the raw data itself required information. For example, for spam
Pieces of detection, detecting whether there is a word not much effect, however, when a few specific words appear simultaneously, and then supplemented 
To examine the message length and other factors, people can more accurately determine whether the message is spam. Simply put, the machine
Learning disorder is to convert data into useful information.
Machine learning across multiple disciplines of computer science, engineering and statistics, etc., require multidisciplinary expertise. You later
Be able to understand, it can also be used as a practical tool used in many fields from politics to geology, to solve many of these problems.
You could almost say, machine learning for any need to explain and manipulate data fields have the benefit.
Development of computer software can identify birds, ornithologists can retire. Because ornithologists to study birds expert,
So we say to create an expert system.
Table l- 1 is used to distinguish our four different attribute values need to use different bird, we chose weight, wingspan, with or without
Webbed feet and back color as evaluation criteria. In reality, you might want to measure more value. The usual practice is to measure all
Measured properties, and then pick out the important part. These four measured values ​​referred to below characteristic properties may also be referred, it may also be referred to as features. Table Shu - Shu in each row is a related feature of the example.

The main task of machine learning is classified. Ultimately, we decided to use a machine learning algorithms to classify, you first need to do is to train the algorithm, that is, learning how to classify.
We usually have a lot of classification algorithm input data as a training set of algorithms. Training data set is used to train a machine learning algorithm
Sample set, Table l- 1 is a training set comprising six training samples, each training sample has four features, a target variable, as shown 
 l- 2. Target variable is the result of machine learning algorithms to predict, in the classification algorithm type of the target variable is usually nominal type,
In regression algorithm usually it is continuous. Training set must be determined to know the value of the target variable, so that the machine learning algorithm may
To find the relationship between the characteristics and target variable. As previously described, where the target species is variable, it may be reduced to a nominal value type. We usually classification problems of the target variable called category and classification assumes there is only a limited number of
category.

To test the effect of machine learning algorithms typically use two independent sample sets: training data and test data. When the machine
Learning program starts running, using the training set as input algorithm, the input test sample after training is completed. Input test
Does not provide target variable test samples when the sample is determined by the program samples belong to which category. Comparison test target sample forecast
The difference between the variable value and the actual sample type, can be drawn on the actual accuracy of the algorithm.
Assume that this bird classification procedures, tested and meet the accuracy requirements, we can see whether the machine has already started learned as 
How to distinguish between different birds of it? This work is called knowledge representation, some algorithms can produce easily understandable knowledge table
Shows, certain algorithms and knowledge representations may only be understood by the computer. Knowledge representation rule set can be used, it can also be
In the form of probability distributions, settings can be an instance of the training sample set. In some cases, people may not want to build
Established an expert system, but merely interested in obtaining information on machine learning algorithms. In this case, the manner in which knowledge is represented significant
Very important ^
Another task is to return the machine learning, it is mainly used to predict numeric data. Most people probably have seen the return of
Examples - song data fitting bismuth: a best fit through the data points given curve. Classification and Regression belong supervised learning, said the reason
It is supervised learning, because these algorithms must know to predict what that classified information of the target variable.
Corresponding to the supervised learning unsupervised learning, then there is no data type information, do not give definite target. In unsupervised
Study, the data set into a plurality of classes by a process similar objects is called clustering; statistical value data will be described Looking 
The process is called density estimation. In addition, unsupervised learning can also reduce the dimension data feature, so that we can use a two-dimensional
Or three-dimensional graphics data display information more intuitively. Table 1- 2 lists the main tasks of machine learning, and resolve the problem
algorithm.

Select the appropriate algorithm
选择实际可用的算法,必须考虑下面两个问题:一 、使用机器学习 
算法的目的,想要算法完成何种任务,比如是预测明天下雨的概率还是对投票者按照兴趣分组。二是要理解和分析收集到的数据是什么。首先考虑使用机器学习算法的目的。如果想要预测目标变量的值,则可以选择监督学习算法,
否则可以选择无监督学习算法。确定选择监督学习算法之后,需要进一步确定目标变量类型,如 
果目标变量是离散型,如是/否、1/2/3、― 冗或者红/黄/黑等,则可以选择分类器算法;如果目 
标变量是连续型的数值,如0.0~ 100.00、-999~999或者+00~-00等 ,则需要选择回归算法。
如果不想预测目标变量的值,则可以选择无监督学习算法。进一步分析是否需要将数据划分 
为离散的组。如果这是唯一的需求,则使用聚类算法;如果还需要估计数据与每个分组的相似程 
度 ,则需要使用密度估计算法。次需要考虑的是数据问题。我们应该充分了解数据,对实际数据了解得越充分,越容易创 
建符合实际需求的应用程序。主要应该了解数据的以下特性:特征值是离散型变量还是连续型变量 ,特征值中是否存在缺失的值,何种原因造成缺失值,数据中是否存在异常值,某个特征发生 
的频 率如何(是否罕见得如同海底捞针),等等。充分了解上面提到的这些数据特性可以缩短选 
择机器学习算法的时间。我们只能在一定程度上缩小算法的选择范围,一般并不存在最好的算法或者可以给出最好结 
果的算法,同时还要尝试不同算法的执行效果。对于所选的每种算法,都可以使用其他的机器学 
习技术来改进其性能。在处理输入数据之后,两个算法的相对性能也可能会发生变化。
开发机器学习应用程序的步骤
使用机器学习算法开发应用程序,通常遵循以下的步骤。
(1 )收集数据。我们可以使用很多方法收集样本数据,如 :制作网络爬虫从网站上抽取数据、&38反馈或者八?1中得到信息、设备发送过来的实测数据(风速、血糖等)。提取数据的方法非 
常多,为了节省时间与精力,可以使用公开可用的数据源。
(2 )准备输入数据。得到数据之后,还必须确保数据格式符合要求,还需要为机器学习算法准备特定的数据格式,如某些算法要求特征值使用特定的格式,
一些算法要求目标变量和特征值是字符串类型,而另一些算法则可能要求是整数类型。
(3)分析输入数据。此步骤主要是人工分析以前得到的数据。为了确保前两步有效,最简单 
的方法是用文本编辑器打开数据文件,査看得到的数据是否为空值。此外,还可以进一步浏览数 
据 ,分析是否可以识别出模式;数据中是否存在明显的异常值,如某些数据点与数据集中的其他 
值存在明显的差异。通过一维、二维或三维图形展示数据也是不错的方法,然而大多数时候我们 
得到数据的特征值都不会低于三个,无法一次图形化展示所有特征。这一步的主要作用是确保数据集中没有垃圾数据。如果是在产品化系统中使用机器学习算法
并且算法可以处理系统产生的数据格式,或者我们信任数据来源,可以直接跳过第3步
需要人工干预,如果在自动化系统中还需要人工干预,显然就降低了系统的价值。
(4)训练算法。机器学习算法从这一步才真正开始学习。根据算法的不同,第4步和第5步是 
机器学习算法的核心。我们将前两步得到的格式化数据输入到算法,从中抽取知识或信息。这里 
得到的知识需要存储为计算机可以处理的格式,方便后续步骤使用。
如果使用无监督学习算法,由于不存在目标变量值,故而也不需要训练算法,所有与算法相 
关的内容都集中在第5步。
⑶测试算法。这一步将实际使用第4步机器学习得到的知识信息。为了评估算法,必须测试算 
法工作的效果。对于监督学习,必须已知用于评估算法的目标变量值;对于无监督学习,也必须用 
其他的评测手段来检验算法的成功率。无论哪种情形,如果不满意算法的输出结果,则可以回到第 
4步 ,改正并加以测试。问题常常会跟数据的收集和准备有关,这时你就必须跳回第1步重新开始。
( 6 ) 使用算法。将机器学习算法转换为应用程序,执行实际任务,以检验上述步骤是否可以
在实际环境中正常工作。此时如果碰到新的数据问题,同样需要重复执行上述的步骤。

 

Guess you like

Origin www.cnblogs.com/tszr/p/12038636.html