Closed usamabinrauf closed 5 months ago
table_name
can still be used in the next code snippet without being declared again.df
in df_test = model.transform(df)
is actually referring to the type of input (DataFrame) applied to the transform
method of the MLFlowTransformer
and not to the object df_test
directly.So, running the code snippets as they are in the exercise should produce the desired output without errors.
Lab: 08d-data-science-batch
Task: Apply the model to generate predictions
Step: 01
Description of issues:
table_name
is not initialized in the code snippet which causes error on running the code cell. Moreover,df
is passed as a parameter in the line of codedf_test = model.transform(df)
instead ofdf_test
.Solution:
table_name
usingtable_name = "diabetes_test"
and add it before the line of codedf_test = spark.read.format("delta").load(f"Tables/{table_name}")
.df_test = model.transform(df)
withdf_test = model.transform(df_test)
.