def GenerateModel(dictionary, id): demand = ProcessData.ProcessData(dictionary) Prediction.GenerateModel(dictionary, demand) latestPrediction = Prediction.GetPrediction(dictionary, demand) loadDict[id] = latestPrediction with open("savedPredictions.txt", "a+") as outfile: json.dump({"id": id, "predictions": latestPrediction}, outfile) outfile.write("\n") print("latestPrediction type: ", type(latestPrediction), "\n latestPrediction: ", latestPrediction) return "Model Generation completed."
def GetPrediction(dictionary): return Prediction.GetPrediction(dictionary)
def TestML(): try: assert (Prediction.GetPrediction("Bef Orchard Blvd-ML-1", 30.0, 10, 0)) except: print("Test Machine Learning fail")