public void run(bool full) { this.actual = new WeatherActual(INPUT_SIZE, OUTPUT_SIZE); //loads data from database this.actual.load(); // Console.WriteLine("Samples read: " + this.actual.size()); if (full) { createNetwork(); generateTrainingSets(); trainNetworkBackprop(); saveNeuralNetwork("Kathmandu"); } else { loadNeuralNetwork("Kathmandu"); } //call the process here to trigger data to visualiztion //display(); }
public void trainStation(string station) { this.actual = new WeatherActual(INPUT_SIZE, OUTPUT_SIZE); this.actual.load(station); createNetwork(); generateTrainingSets(); trainNetworkBackprop(); saveNeuralNetwork(station); }
public List<WeatherSamples> prediction(DateTime date,string station, double airPollutionLevel) { this.actual = new WeatherActual(INPUT_SIZE, OUTPUT_SIZE); loadNeuralNetwork(station); List<WeatherSamples> list = new List<WeatherSamples>(); List<double[]> predictHistory = new List<double[]>(); double[] present = new double[INPUT_SIZE * 4]; double[] predict = new double[OUTPUT_SIZE * 3]; this.actual.getInputDataToPredict(date, present); var tempDate = date; for (int i = 0; i < 30; i++) { predict = this.network.ComputeOutputs(present); predictHistory.Add(predict); this.actual.getInputDataToPredictSeries(date, present,predictHistory,airPollutionLevel); list.Add(new WeatherSamples {date=tempDate,minTemp=predict[0],maxTemp=predict[1],rainfall=predict[2],airPollutionLevel=airPollutionLevel,station=station }); tempDate=tempDate.AddDays(+1); } return list; }