資源簡介
代碼下載鏈接
最小二乘支持向量詳解
目錄數(shù)據(jù)導(dǎo)入包導(dǎo)入數(shù)據(jù)定義核函數(shù)初始化實例最小二乘法求 參數(shù)對def leastSquares() 方法求參數(shù) alphas,b 的解釋說明方程求解hstack() 堆棧數(shù)組水平順序(列)vstack():堆棧數(shù)組垂直順序(行)預(yù)測主函數(shù)
數(shù)據(jù)
導(dǎo)入包
from numpy import *
導(dǎo)入數(shù)據(jù)
def loadDataSet(filename):
'''導(dǎo)入數(shù)據(jù)
input: filename:文件名
output:dataMat(list)樣本特征
labelMat(list)樣本標(biāo)簽
'''
代碼片段和文件信息
評論
共有 條評論