def about(): val = int(request.args["pr"]) Dependents = int(request.args["dependence"]) tenure = float(request.args["tenure"]) OnlineSecurity = int(request.args["OnlineSecurity"]) TechSupport = int(request.args["TechSupport"]) Contract = int(request.args["Contract"]) PaperlessBilling = int(request.args["PaperlessBilling"]) MonthlyCharges = float(request.args["MonthlyCharges"]) TotalCharges = float(request.args["TotalCharges"]) #data0=([Dependents,tenure,OnlineSecurity,TechSupport,Contract,PaperlessBilling,MonthlyCharges,TotalCharges]) data0 = ({ 'Dependents': [Dependents], 'tenure': [tenure], 'OnlineSecurity': [OnlineSecurity], 'TechSupport': [TechSupport], 'Contract': [Contract], 'PaperlessBilling': [PaperlessBilling], 'MonthlyCharges': [MonthlyCharges], 'TotalCharges': [TotalCharges] }) data = pd.DataFrame(data0) return str(algorithm.predData(algorithm.perprocess(df), data, val))
def pred(): pr = int(request.args["pr"]) return "Accuracy " + algorithm.predict( algorithm.perprocess(df), pr ) + "<a href=adddata>" + "<br>" + "<br>" + "<br>" + "<br>" + "<input type=button value='go to predict'/adddata/'></a>"
def prep(): return algorithm.perprocess(df).to_html()