我在accord.net
是新的,我想一步從這個page下面的代碼適用走進Visual Studio C#
樣品Accord.NET樸素貝葉斯
部分的代碼的簡單應用「標準分類問題」已被應用沒有問題,但是當我嘗試運行時應用段「樸素貝葉斯」的代碼我得到了一個異常與該說明
unhandled exception of type System.AggregateException occurred in mscorlib.dll
沒有進一步desciption。
這發生在以下命令
var nb = learner.Learn(inputs, outputs)
我的代碼是我的程序以下
DataTable table = new celReader("examples.xls").GetWorksheet("Classification - Yin Yang");
// Convert the DataTable to input and output vectors
double[][] inputs = table.ToArray<double>("X", "Y");
int[] outputs = table.Columns["G"].ToArray<int>();
// Plot the data
ScatterplotBox.Show("Yin-Yang", inputs, outputs).Hold();
var learner = new NaiveBayesLearning<NormalDistribution>();
// Estimate the Naive Bayes
var nb = learner.Learn(inputs, outputs); // this is where exception is thrown
// Classify the samples using the model
int[] answers = nb.Decide(inputs);
// Plot the results
ScatterplotBox.Show("Expected results", inputs, outputs);
ScatterplotBox.Show("Naive Bayes results", inputs, answers).Hold();
堆棧跟蹤
你能後的異常堆棧跟蹤?檢查了哪些行中斷? – tchrikch
@tchrikch已更新 –