public void Process()
{
// read the iris data from the resources
Assembly assembly = Assembly.GetExecutingAssembly();
var res = assembly.GetManifestResourceStream("AIFH_Vol1.Resources.abalone.csv");
// did we fail to read the resouce
if (res == null)
{
Console.WriteLine("Can't read iris data from embedded resources.");
return;
}
// load the data
var istream = new StreamReader(res);
DataSet ds = DataSet.Load(istream);
istream.Close();
// The following ranges are setup for the Abalone data set. If you wish to normalize other files you will
// need to modify the below function calls other files.
ds.EncodeOneOfN(0, 0, 1);
istream.Close();
var trainingData = ds.ExtractSupervised(0, 10, 10, 1);
var reg = new MultipleLinearRegression(10);
var train = new TrainLeastSquares(reg, trainingData);
train.Iteration();
Query(reg, trainingData);
Console.WriteLine("Error: " + train.Error);
}