コード例 #1
0
 private Hierarchy(HierarchyTree tree, string name, string id)
 {
     this.species  = name;
     this.id       = id;
     this.data     = tree.data is null ? null : Iris.Convert(tree.data, name, id);
     this.children = (new List <HierarchyTree>(tree.children))
                     .Select((item, i) => new Hierarchy(item, name, id + i.ToString()));
 }
コード例 #2
0
        public static List <Vector <double> > GetFromFile()
        {
            var contents = File.ReadAllText(@"Controllers\iris.csv").Split('\n');
            var csv      = contents.ToList().ConvertAll(item => item.Split(','));

            List <Vector <double> > toCluster = new List <Vector <double> >();

            foreach (var record in csv)
            {
                toCluster.Add(new Iris(Iris.parse(record[0]), Iris.parse(record[1]),
                                       Iris.parse(record[2]), Iris.parse(record[3]), record[4], "").Convert());
            }
            return(toCluster);
        }