Example #1
0
        public Prediction(float[] probArray)
        {
            for (int i = 0; i < probArray.Length; i++)
            {
                if (probArray[i] > 0.001)
                {
                    addDog(new Dog(BreedList.Return_Breed(i), probArray[i]));
                }
            }

            dogList.Sort(dCompare);
        }
Example #2
0
        public void populateList(float[] probArray, List <Dog> dogList)
        {
            for (int i = 0; i < probArray.Length; i++)
            {
                if (probArray[i] > 0.001)
                {
                    dogList.Add(new Dog(BreedList.Return_Breed(i), probArray[i]));
                }
            }

            dogList.Sort(dCompare);
        }
Example #3
0
        public void Read()
        {
            int      i = 0;
            double   d = 0;
            DateTime date;
            string   path = AppDomain.CurrentDomain.BaseDirectory + "Dogs.csv";

            if (File.Exists(path))
            {
                using (StreamReader reader = new StreamReader(path))
                {
                    string line;
                    while ((line = reader.ReadLine()) != null)
                    {
                        string[] parts = line.Split(',');

                        if (i == 0)
                        {
                            first = Convert.ToDateTime(parts[0]);
                        }

                        date = Convert.ToDateTime(parts[0]);
                        d    = Convert.ToDouble(parts[2].TrimEnd('%'));
                        plots.Add(new Plot(d, date));

                        InsertIntoColumnsList(BreedList.Return_Breed(parts[1]).breed_name);

                        i++;
                    }
                    reader.Close();
                }
            }
            else
            {
                var x = File.Create(path);
                x.Close();
            }
        }