Commit a83fd5db authored by Christian Marius Lillelund's avatar Christian Marius Lillelund
Browse files

changed alarm surv prob to the inverse

parent adf81c60
Pipeline #103698 passed with stage
in 4 minutes and 20 seconds
......@@ -141,11 +141,11 @@ def predict_alarm(incoming_data: InputData):
surv_func = alarm_model.predict_survival_function(df_for_alarm)
event_times = list(range(1, 13))
surv_probs = np.array([float(x) for x in surv_func[0].y][:360])
surv_probs = np.array([1 - float(x) for x in surv_func[0].y][:360])
surv_probs = np.mean(surv_probs.reshape(-1, 30), axis=1)
surv_probs = list(map((lambda x: float(round(100*Decimal(x), 1))), surv_probs))
prob_after_one_year = 100 - surv_probs[-1]
prob_after_one_year = surv_probs[-1]
alarm_arguments = generate_alarm_arguments(df, ats_resolution, prob_after_one_year)
return {
......@@ -267,7 +267,7 @@ def generate_alarm_arguments(df: pd.DataFrame,
arguments.append(loan_period_argument)
arguments.append("får efter et år en nødalarm")
arguments.append(f"med {round(prob_after_one_year, 1)}% sandsynlighed")
arguments.append(f"med {prob_after_one_year}% sandsynlighed")
return arguments
def load_settings(file_name):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment