Пример #1
0
 def threeHourDemoPredict(self):
     print("PREDICT")
     usage = smartOff.predictOnNext3Hours(self.model, "1515578400",
                                          self.maxUsage)
     pyplot.plot(usage, label="10th Jan 2018 5 AM to 8 AM")
     pyplot.legend()
     graphFile = 'images/' + ''.join(
         random.choice('abcdefghighklmnopqrst') for _ in range(5)) + '.png'
     pyplot.savefig(graphFile)
     pyplot.clf()
     img_root = Toplevel()
     img_gui = ShowImage(img_root, graphFile)
     img_root.mainloop()
Пример #2
0
 def threeHourDemoPredict(self):
     timeGM = time.localtime()
     ts = calendar.timegm(timeGM)
     print("PREDICTING FOR", ts)
     usage = smartOff.predictOnNext3Hours(self.model, str(ts),
                                          self.maxUsage)
     pyplot.plot(usage, label="6th July 2017 1 PM to 4 PM")
     pyplot.legend()
     graphFile = 'images/' + ''.join(
         random.choice('abcdefghighklmnopqrst') for _ in range(5)) + '.png'
     pyplot.savefig(graphFile)
     pyplot.clf()
     img_root = Toplevel()
     img_gui = ShowImage(img_root, graphFile)
     img_root.mainloop()
Пример #3
0
 def threeHourPredict(self):
     timeGM = time.localtime()
     ts = time.time()  #calendar.timegm(timeGM)
     print("PREDICTING FOR", ts)
     usage = smartOff.predictOnNext3Hours(self.model, str(ts),
                                          self.maxUsage)
     labelG = str(timeGM.tm_mon) + '/' + str(timeGM.tm_mday) + '/' + str(
         timeGM.tm_year)
     labelG = labelG + " From " + str(timeGM.tm_hour) + ":" + str(
         timeGM.tm_min) + " to "
     labelG = labelG + " To " + str(timeGM.tm_hour + 3) + ":" + str(
         timeGM.tm_min)
     pyplot.plot(usage, label=labelG)
     pyplot.legend()
     graphFile = 'images/' + ''.join(
         random.choice('abcdefghighklmnopqrst') for _ in range(5)) + '.png'
     pyplot.savefig(graphFile)
     pyplot.clf()
     img_root = Toplevel()
     img_gui = ShowImage(img_root, graphFile)
     img_root.mainloop()