从这一节开始学习机器学习技法课程中的SVM, 这一节主要介绍标准形式的SVM: Linear SVM 引入SVM 首先回顾Percentron Learning Algrithm(感知器算法PLA)是如何分类的,如下图,找到一条线,将两类训练数据点分开即可: PLA的最后的直线可能有很多条,那到底哪条好呢?好坏的标准则是其泛化性能,即在测试数据集上的正确率,如下,下面三条直线都能正确的分开训练数据,那到底哪个好呢?SVM就是解决这个问题的. SVM求解 直觉告诉我们最右的要好一些,因为测试数据的…
机器学习十大算法之KNN算法 前段时间一直在搞tkinter,机器学习荒废了一阵子.如今想重新写一个,发现遇到不少问题,不过最终还是解决了.希望与大家共同进步. 闲话少说,进入正题. KNN算法也称最近邻居算法,是一种分类算法. 算法的基本思想:假设已存在一个数据集,数据集有多个数值属性和一个标签属性,输入一个新数据,求新数据的标签. 步骤如下: 先将新数据拷贝n份,形成一个新的数据集: 逐行计算新数据集与原数据集的距离: 按距离长度排序后,统计前K个数据里,那个标签出现的次数最多,新数据就标记…
原文地址:https://www.jianshu.com/p/1db700f866ee 问题描述 程序实现 # kNN_RBFN.py # coding:utf-8 import numpy as np import matplotlib.pyplot as plt def ReadData(dataFile): with open(dataFile, 'r') as f: lines = f.readlines() data_list = [] for line in lines: line…
原文地址:http://www.jianshu.com/p/9bf9e2add795 AdaBoost 问题描述 程序实现 # coding:utf-8 import math import numpy as np import matplotlib.pyplot as plt def ReadData(dataFile): with open(dataFile, 'r') as f: lines = f.readlines() data_list = [] for line in lines:…
原文地址:https://www.jianshu.com/p/6bf801bdc644 特征变换 问题描述 程序实现 # coding: utf-8 import numpy as np from cvxopt import matrix, solvers from sklearn import svm def gen_data(): X = [[1, 0], [0, 1], [0, -1], [-1, 0], [0, 2], [0, -2], [-2, 0]] X = np.array(X)…
原文地址:https://www.jianshu.com/p/7ff6fd6fc99f 问题描述 程序实现 13-15 # coding:utf-8 # decision_tree.py import numpy as np def ReadData(dataFile): with open(dataFile, 'r') as f: lines = f.readlines() data_list = [] for line in lines: line = line.strip().split(…
Roadmap RBF Network Hypothesis RBF Network Learning k-Means Algorithm k-Means and RBF Network in Action Summary…
Roadmap Motivation of Boosting Diversity by Re-weighting Adaptive Boosting Algorithm Adaptive Boosting in Action Summary…
Roadmap Linear Network Hypothesis Basic Matrix Factorization Stochastic Gradient Descent Summary of Extraction Models Summary…
Roadmap Feature Exploitation Techniques Error Optimization Techniques Overfitting Elimination Techniques Machine Learning in Practice Summary…