实验数据
设计思路
实现代码(部分代码)
/**
js代码实现SVM算法
*/
//ML之SVM:基于Js代码利用SVM算法的实现根据Kaggle数据集预测泰坦尼克号生存人员
//1、打印数据概要:简单的看一下样本数据
console.log('train Number = ' + trainData_titanic.length + ' test Number = ' + testData_titanic.length);
console.log(trainData_titanic[11]);
console.log(trainData_titanic[10]);
console.log(trainData_titanic[100]);
……
var trainTitanic = function() {
loadTitanicData();
var isFinished = svm.train(50);
console.log("isFinished = " + isFinished);
var result = verifyTitanic();
console.log("verify result = " + result);
var result = testTitanic();
console.log("test result = " + result);
}