diff --git a/lab8/trainScript.py b/lab8/trainScript.py index 51dbb21..b7d86f2 100644 --- a/lab8/trainScript.py +++ b/lab8/trainScript.py @@ -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() \ No newline at end of file diff --git a/result.txt b/result.txt index c4c57b5..fde68ab 100644 --- a/result.txt +++ b/result.txt @@ -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.] \ No newline at end of file +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. ] \ No newline at end of file diff --git a/sampleinp.txt b/sampleinp.txt new file mode 100644 index 0000000..655fe30 --- /dev/null +++ b/sampleinp.txt @@ -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 \ No newline at end of file