Exemplo n.º 1
0
        private void CreateDatacell(IEnumerable <TrainingSetRecord> query)
        {
            Dataset = Matrix.Zeros(0, 0);
            Target  = Matrix.Zeros(0, 0);

            DataCell = new DataCell();

            DataCell.Add(new DataAttribute(0, "Tempo", query.Select(s => Convert.ToString(s.Tempo)).Distinct().OrderBy(s => s).ToArray()));
            DataCell.Add(new DataAttribute(1, "Danceability", query.Select(s => Convert.ToString(s.Danceability)).Distinct().OrderBy(s => s).ToArray()));
            DataCell.Add(new DataAttribute(2, "Energy", query.Select(s => Convert.ToString(s.Energy)).Distinct().OrderBy(s => s).ToArray()));
            DataCell.Add(new DataAttribute(3, "Key", query.Select(s => Convert.ToString(s.Key)).Distinct().OrderBy(s => s).ToArray()));
            DataCell.Add(new DataAttribute(4, "Favourite", "False", "True"));

            this.Populate(query.ToList());
        }