Esempio n. 1
0
        private void Populate(List <TrainingSetRecord> datalist)
        {
            for (int i = 0; i < datalist.Count; i++)
            {
                RowVector row = new RowVector((double)DataCell[0].Values.Where(v => v.Value == datalist[i].Tempo.ToString()).FirstOrDefault().Key
                                              , (double)DataCell[1].Values.Where(v => v.Value == datalist[i].Danceability.ToString()).FirstOrDefault().Key
                                              , (double)DataCell[2].Values.Where(v => v.Value == datalist[i].Energy.ToString()).FirstOrDefault().Key
                                              , (double)DataCell[3].Values.Where(v => v.Value == datalist[i].Key.ToString()).FirstOrDefault().Key);

                Dataset.AddRow(row);

                Target.AddRow(new RowVector(datalist[i].Grouping.ToList()[0].Favourite.Value ? 1f : 0f));
            }
        }