Exemplo n.º 1
0
def predict_home_price():
    total_sqft = float(request.form['total_sqft'])
    location = request.form['location']
    bhk = int(request.form['bhk'])
    bath = int(request.form['bath'])

    response = jsonify({
        'estimated_price': util.get_estimated_price(location,total_sqft,bhk,bath)
    })
    response.headers.add('Access-Control-Allow-Origin', '*')

    return response
Exemplo n.º 2
0
def predict_loan_acceptance():

    applicantincome = float(request.form['ApplicantIncome'])
    coapplicantincome = float(request.form['CoapplicantIncome'])
    loanamount = int(request.form['LoanAmount'])
    loan_amount_term = int(request.form['Loan_Amount_Term'])
    married_yes = int(request.form['married_yes'])
    property_area = int(request.form['location'])

    response = jsonify({
        'estimated_price':
        util.get_estimated_price(applicantincome, coapplicantincome,
                                 loanamount, loan_amount_term, married_yes,
                                 property_area)
    })
    response.headers.add('Access-Control-Allow-Origin', '*')

    return response