Exemplo n.º 1
0
        double GetAccuracyWithNewTestingOutputData(int numberOfCustomers)
        {
            DataPopulator.DataPopulator dp = new DataPopulator.DataPopulator();
            List <Person>   personList     = dp.GeneratePeopleData(numberOfCustomers);
            List <Customer> customerList   = new List <Customer>();

            foreach (Person person in personList)
            {
                Customer customer = new Customer(person.Age, person.AnnualIncome, person.WorkStatus, person.Destination);

                customerList.Add(customer);
            }
            double[][] outputTestingDataList = GetOutputArray(customerList);
            double[][] inputTestingDataList  = GetInputArray(customerList);

            int customerCount = customerList.Count();

            double[][] actualData = new double[customerCount][];
            for (int i = 0; i < customerCount; i++)
            {
                for (int j = 0; j < numberOfInputNodes; j++)
                {
                    net.PerceptionLayer[j].Output = inputTestingDataList[i][j];
                }
                net.Pulse();
                actualData[i] = new double[numberOfOutputNodes];
                for (int k = 0; k < numberOfOutputNodes; k++)
                {
                    actualData[i][k] = net.OutputLayer[k].Output;
                }
            }


            double accuracy = GetAccuracy(outputTestingDataList, actualData);

            return(accuracy);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            DataPopulator dp = new DataPopulator();

            dp.Run();
        }