@@ -1,3 +1,7 @@
|
||||
model_executor:
|
||||
module: model_executor
|
||||
class: ModelExecutor
|
||||
|
||||
states_listenor:
|
||||
module: states_listenor
|
||||
class: StatesListenor
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
<Text>
|
||||
<PrimaryText>{metric.actuator}</PrimaryText>
|
||||
<SecondaryText>Accuracy = {metric.accuracy}</SecondaryText>
|
||||
<SecondaryText>Precision = {metric.precision}</SecondaryText>
|
||||
</Text>
|
||||
</Item>
|
||||
{/each}
|
||||
|
||||
@@ -220,13 +220,8 @@ def train_all_classifiers(
|
||||
metrics_json["AUC"] = auc_
|
||||
metrics_json["best_thresh"] = thresholds[ix]
|
||||
metrics_json["best_optimizer"] = optimizer[ix]
|
||||
if precision_best > 0.7:
|
||||
metrics_json["model_enabled"] = True
|
||||
else:
|
||||
logging.info(
|
||||
f"Model disabled for {actuator}. Precision {precision_best} below 0.7."
|
||||
)
|
||||
metrics_json["model_enabled"] = False
|
||||
metrics_json["model_enabled"] = False
|
||||
|
||||
metrics_matrix.append(metrics_json)
|
||||
|
||||
# Save model to disk
|
||||
@@ -235,6 +230,8 @@ def train_all_classifiers(
|
||||
|
||||
# Save model to disk
|
||||
if optimizer[ix] > best_model:
|
||||
if precision_best > 0.7:
|
||||
metrics_json["model_enabled"] = True
|
||||
best_model = optimizer[ix]
|
||||
filename = open(f"{model_directory}/best_model.pkl", "wb")
|
||||
pickle.dump(model, filename)
|
||||
|
||||
@@ -38,7 +38,7 @@ f = Fernet(b"w2PWqacy0_e4XZ2Zb8BU6GauyRgiZXw12wbmi0A6CjQ=")
|
||||
password = f.decrypt(
|
||||
b"gAAAAABi_2EebCwQSA3Lbk3MPCXvH3I6G-w8Ijt0oYiqfmUdzdrMjVRQuTqbpqK-DQCsyVliUWFsvd1NulF-WBsLKOpwmiCp-w=="
|
||||
).decode("utf-8")
|
||||
extdb_password = db_options["db_password"]
|
||||
extdb_password = password
|
||||
extdb_database = "thesillyhomedb"
|
||||
extdb_username = "thesillyhome_general"
|
||||
extdb_host = "thesillyhomedb-instance-1.cdioawtidgpj.eu-west-2.rds.amazonaws.com"
|
||||
|
||||
Reference in New Issue
Block a user