.net随笔-vb.net Accord.Net机器学习之SVM分类
生活随笔
收集整理的這篇文章主要介紹了
.net随笔-vb.net Accord.Net机器学习之SVM分类
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
線性核分類
Imports Accord.ControlsImports Accord.IOImports Accord.MathImports Accord.Statistics.Distributions.UnivariateImports Accord.MachineLearning.VectorMachines.LearningImports Accord.StatisticsImports SystemPublic Class Form1'SVM線性分類'使用Accord.IO里的的excel讀取類Dim table As DataTable = New ExcelReader("E:\pro\books\AI_.net\src\AI_learn\learnai-1\data\examples.xls").GetWorksheet("Classification - Yin Yang")Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.ClickNaiveBayes()End SubPrivate Sub NaiveBayes()'讀取樣本' 轉(zhuǎn)換datatable為輸入輸出數(shù)組Dim sample As Double()() = table.ToJagged(Of Double)("X", "Y")Dim outs As Integer() = table.Columns("G").ToArray(Of Integer)()Dim trainer As New LinearCoordinateDescent()Dim svm = trainer.Learn(sample, outs)Dim predictResult As Boolean() = svm.Decide(sample)Dim zeroOneAnswers As Integer() = predictResult.ToZeroOne()ScatterplotBox.Show("實(shí)際結(jié)果", sample, outs)ScatterplotBox.Show("SVM預(yù)測(cè)結(jié)果", sample, zeroOneAnswers).Hold()End SubEnd Class效果如下
非線性高斯核分類
總結(jié)
以上是生活随笔為你收集整理的.net随笔-vb.net Accord.Net机器学习之SVM分类的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: .net随笔-vb.net Accord
- 下一篇: linux认令牌操作错误,验证令牌操作错