Esempio n. 1
0
        private List <List <ValuePeremen> > getLeanValueFromFile()
        {
            List <List <ValuePeremen> > list = new List <List <ValuePeremen> >();

            String[] lines = System.IO.File.ReadAllLines("test.csv");
            for (int i = 0; i < lines.Length; i++)
            {
                List <ValuePeremen> line    = new List <ValuePeremen>();
                List <String>       strline = new List <string>(lines[i].Split(','));
                strline.ForEach((x) =>
                {
                    ValuePeremen val = new ValuePeremen();
                    double r;
                    if (getDouble(x, out r) == false)
                    {
                        val.setKategor(true);
                        val.setValueKat(x);
                    }
                    else
                    {
                        val.setKategor(false);
                        val.setDouble(r);
                    }
                    line.Add(val);
                });
                list.Add(line);
            }
            return(list);
        }
Esempio n. 2
0
        private List <List <ValuePeremen> > getLeanValueFromFile()
        {
            List <List <ValuePeremen> > list = new List <List <ValuePeremen> >();

            String[] lines = System.IO.File.ReadAllLines("learn.csv");
            for (int i = 0; i < lines.Length; i++)
            {
                List <ValuePeremen> line    = new List <ValuePeremen>();
                String[]            nowline = lines[i].Split(',');
                nowline.ToList <String>().ForEach((x) =>
                {
                    double r;
                    ValuePeremen v = new ValuePeremen();
                    if (getDouble(x, out r))
                    {
                        v.setKategor(false);
                        v.setDouble(r);
                    }
                    else
                    {
                        v.setKategor(true);
                        v.setValueKat(x);
                    }
                    line.Add(v);
                });
                list.Add(line);
            }
            return(list);
        }
Esempio n. 3
0
        private List <List <ValuePeremen> > getLeanValueFromFile()
        {
            List <List <ValuePeremen> > list = new List <List <ValuePeremen> >();

            String[] lines = System.IO.File.ReadAllLines("test.csv");
            for (int i = 0; i < lines.Length; i++)
            {
                String tmp = "";
                List <ValuePeremen> line = new List <ValuePeremen>();
                for (int j = 0; j < lines[i].Length; j++)
                {
                    if (lines[i][j] != ',' && j != lines[i].Length - 1)
                    {
                        tmp += lines[i][j];
                    }
                    else
                    {
                        ValuePeremen v = new ValuePeremen();
                        double       r = getDouble(tmp);
                        if (r != -99999999)
                        {
                            v.setKategor(false);
                            v.setDouble(r);
                        }
                        else
                        {
                            v.setKategor(true);
                            v.setValueKat(tmp);
                        }
                        line.Add(v);
                        tmp = "";
                    }
                }
                list.Add(line);
            }
            return(list);
        }