add input_example
This commit is contained in:
parent
5fb0ce644b
commit
0a74516ff9
@ -10,7 +10,7 @@ import mlflow.keras
|
|||||||
from urllib.parse import urlparse
|
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')
|
mlflow.set_experiment('s444417')
|
||||||
|
|
||||||
# train params
|
# train params
|
||||||
@ -48,7 +48,7 @@ def train():
|
|||||||
house_price_features = house_price_train.copy()
|
house_price_features = house_price_train.copy()
|
||||||
# pop column
|
# pop column
|
||||||
house_price_labels = house_price_features.pop('TARGET(PRICE_IN_LACS)')
|
house_price_labels = house_price_features.pop('TARGET(PRICE_IN_LACS)')
|
||||||
|
|
||||||
# process data
|
# process data
|
||||||
normalize = layers.Normalization()
|
normalize = layers.Normalization()
|
||||||
normalize.adapt(house_price_features)
|
normalize.adapt(house_price_features)
|
||||||
@ -112,10 +112,12 @@ def train():
|
|||||||
|
|
||||||
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]
|
||||||
|
# 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, input_example=np.array(sampleInp))
|
||||||
else:
|
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__':
|
if __name__ == '__main__':
|
||||||
train()
|
train()
|
@ -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]
|
predictions: [70.94439, 65.28393, -20.83638, 653.3567, 156.35808, 120.63458, 80.068924, 165.0669, 42.61284, -10.327789]
|
||||||
expected: [ 74. 140. 35. 42. 260. 15. 25. 190. 40. 200.]
|
expected: [ 37.5 48. 15. 300. 55.3 56. 43. 58. 25. 70. ]
|
9
sampleinp.txt
Normal file
9
sampleinp.txt
Normal 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
|
Loading…
Reference in New Issue
Block a user