fix trainScript line tabs
Some checks failed
s444417-training/pipeline/head This commit looks good
s444417-evaluation/pipeline/head There was a failure building this commit

This commit is contained in:
s444417 2022-05-20 18:16:52 +02:00
parent f4457b83c6
commit ce9ca84ddf

View File

@ -108,16 +108,16 @@ def train():
mlflow.log_param('learning_rate', learning_rate) mlflow.log_param('learning_rate', learning_rate)
mlflow.log_metric('final_loss', min(hist["val_loss"])) mlflow.log_metric('final_loss', min(hist["val_loss"]))
signature = mlflow.models.signature.infer_signature(house_price_features, linear_model.predict(house_price_features)) signature = mlflow.models.signature.infer_signature(house_price_features, linear_model.predict(house_price_features))
tracking_url_type_store = urlparse(mlflow.get_tracking_uri()).scheme tracking_url_type_store = urlparse(mlflow.get_tracking_uri()).scheme
sampleInp = [0.0, 0.0, 2.0, 904.129525, 1.000000, 1.000000, 20.098413, 79.107860] sampleInp = [0.0, 0.0, 2.0, 904.129525, 1.000000, 1.000000, 20.098413, 79.107860]
# expected value is 49.7 # expected value is 49.7
if tracking_url_type_store != "file": if tracking_url_type_store != "file":
mlflow.keras.log_model(linear_model, "linear-model", registered_model_name="HousePriceLinear", signature=signature) mlflow.keras.log_model(linear_model, "linear-model", registered_model_name="HousePriceLinear", signature=signature)
else: else:
mlflow.keras.log_model(linear_model, "model", signature=signature, input_example=np.array(sampleInp)) mlflow.keras.log_model(linear_model, "model", signature=signature, input_example=np.array(sampleInp))
if __name__ == '__main__': if __name__ == '__main__':
train() train()