add input_example
All checks were successful
s444417-training/pipeline/head This commit looks good
s444417-evaluation/pipeline/head This commit looks good

This commit is contained in:
s444417 2022-05-14 14:14:24 +02:00
parent 5fb0ce644b
commit 0a74516ff9
3 changed files with 17 additions and 6 deletions

View File

@ -10,7 +10,7 @@ import mlflow.keras
from urllib.parse import urlparse
mlflow.set_tracking_uri("http://172.17.0.1:5000")
# mlflow.set_tracking_uri("http://172.17.0.1:5000")
mlflow.set_experiment('s444417')
# train params
@ -48,7 +48,7 @@ def train():
house_price_features = house_price_train.copy()
# pop column
house_price_labels = house_price_features.pop('TARGET(PRICE_IN_LACS)')
# process data
normalize = layers.Normalization()
normalize.adapt(house_price_features)
@ -112,10 +112,12 @@ def train():
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]
# expected value is 49.7
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, input_example=np.array(sampleInp))
else:
mlflow.keras.log_model(linear_model, "model", signature=signature)
mlflow.keras.log_model(linear_model, "model", signature=signature, input_example=np.array(sampleInp))
if __name__ == '__main__':
train()

View File

@ -1,2 +1,2 @@
predictions: [188.40611, 79.26458, 79.07924, 79.702156, 249.17542, -1.7695923, 54.21414, 78.15069, 114.4659, 248.62257]
expected: [ 74. 140. 35. 42. 260. 15. 25. 190. 40. 200.]
predictions: [70.94439, 65.28393, -20.83638, 653.3567, 156.35808, 120.63458, 80.068924, 165.0669, 42.61284, -10.327789]
expected: [ 37.5 48. 15. 300. 55.3 56. 43. 58. 25. 70. ]

9
sampleinp.txt Normal file
View File

@ -0,0 +1,9 @@
UNDER_CONSTRUCTION 0.000000
RERA 0.000000
BHK_NO. 2.000000
SQUARE_FT 904.129525
READY_TO_MOVE 1.000000
RESALE 1.000000
LONGITUDE 20.098413
LATITUDE 79.107860
Name: 0, dtype: float64