I am using Python code generated from an ML software with mlflow to read a data frame, perform some table operations and output a data frame. I am able to run the code successfully and save the new data frame as an artifact. However, I am unable to log the model using log_model because it is not an LR or classifier model where we train and fit. I want to log a model for this so that it can be served with new data and deployed with a rest API
df = pd.read_csv(r"/home/xxxx.csv")
with mlflow.start_run():
def getPrediction(row):
perform_some_python_operations
return [Status_prediction, Status_0_probability, Status_1_probability]
columnValues = []
for column in columns:
columnValues.append([])
for index, row in df.iterrows():
results = getPrediction(row)
for n in range(len(results)):
columnValues[n].append(results[n])
for n in range(len(columns)):
df[columns[n]] = columnValues[n]
df.to_csv('dataset_statistics.csv')
mlflow.log_artifact('dataset_statistics.csv')