Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

convert python code to pseudocode online

from flask import render_template, request, Flask
import joblib

app = Flask(__name__)

model = joblib.load('dicisionTreeModel.pkl')


@app.route('/')
def index():
    return render_template('Main.html')


@app.route('/predict', methods=['GET','POST'])
def predict():
    if (request.method) =='POST':
        age = request.form.get('age')
        sysBloodPress = request.form.get('sysBloodPress')
        diaBloodPress = request.form.get('diaBloodPress')
        bloodGlucoseLevel = request.form.get('bloodGlucoseLevel')
        bodyTemp = request.form.get('bodyTemp')
        heartRate = request.form.get('heartRate')
        data = [age, sysBloodPress, diaBloodPress,
                bloodGlucoseLevel, bodyTemp, heartRate]
        patientPredict = model.predict([data])[0]
        if patientPredict < 1.5:
            return render_template('Main.html', predict=f'Your Risk Level is {patientPredict}, which is Low')
        elif patientPredict < 2.5:
            return render_template('Main.html', predict=f'Your Risk Level is {patientPredict}, which is Medium')
        else:
            return render_template('Main.html', predict=f'Your Risk Level is {patientPredict}, which is High')


if __name__ == "__main__":
    app.run(debug=True)
Comment

PREVIOUS NEXT
Code Example
Python :: write hexadecimal in python 
Python :: python looping through a list 
Python :: Remove an element from a Python list Using pop() method 
Python :: input() function in python 
Python :: python 3 
Python :: python copy vs deepcopy 
Python :: python singleton module 
Python :: convert images to jpeg 
Python :: pybase64 
Python :: return max(max(a,b),max(c,d)); 
Python :: is the multiply code in python 
Python :: python unbound variable 
Python :: second highest value in list python 
Python :: python using shutil method 
Python :: python string and integer concatenation 
Python :: github downloader 
Python :: python string 
Python :: # keys in python 
Python :: floor python 
Python :: List Join 2 Lists 
Python :: python3 
Python :: numpy.empty sorce code 
Python :: opencv find image contained within an image 
Python :: import numpy as np import matplotlib.pyplot as plt index = 0 missClassifiedIndexes = [] for label, predit in zip(y_test, predictions): if label != predict: missClassifiedIndexes.append(index) index = +1 
Python :: if statement collection python 
Python :: Python Program to Find sum Factorial of Number Using Recursion 
Python :: how write a date with th and nd in python 
Python :: showing typle results with for loop in py 
Python :: Make Latest pyhton as default in mac 
Python :: converting from series to dataframe with tabulate 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =