Update app.py
Browse files
app.py
CHANGED
@@ -29,7 +29,7 @@ def salarybracket(age, workclass, education, education_num, marital_status, occu
|
|
29 |
gender_value = next((v for k, v in mapping['gender'].items() if k == gender), None)
|
30 |
native_country_value = next((v for k, v in mapping['native_country'].items() if k == native_country), None)
|
31 |
|
32 |
-
inputs = np.array([[age, workclass_value, education_value, education_num, marital_status_value, occupation_value, relationship_value, race_value, gender_value, capital_gain, capital_loss, hours_per_week, native_country_value]])
|
33 |
prediction = model.predict(inputs)
|
34 |
prediction_value = prediction[0][0] # Assuming the prediction is a scalar
|
35 |
result = "Income_bracket lesser than or equal to 50K ⬇️" if prediction_value <= 0.5 else "Income_bracket greater than 50K ⬆️"
|
|
|
29 |
gender_value = next((v for k, v in mapping['gender'].items() if k == gender), None)
|
30 |
native_country_value = next((v for k, v in mapping['native_country'].items() if k == native_country), None)
|
31 |
|
32 |
+
inputs = np.array([[float(age), float(workclass_value), float(education_value), float(education_num), float(marital_status_value), float(occupation_value), float(relationship_value), float(race_value), float(gender_value), float(capital_gain), float(capital_loss), float(hours_per_week), float(native_country_value)]])
|
33 |
prediction = model.predict(inputs)
|
34 |
prediction_value = prediction[0][0] # Assuming the prediction is a scalar
|
35 |
result = "Income_bracket lesser than or equal to 50K ⬇️" if prediction_value <= 0.5 else "Income_bracket greater than 50K ⬆️"
|