Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Added on May 27, 2024 11:51AM
Likes: 0
Replies: 1
Hello community,
I am facing an issue when using Dataiku's Snowpark API to make predictions from a multi-class classification model.
The model is trained with Dataiku and a Snowflake table via Visual ML.
The predictions only return one class, while the same table loaded as a pandas DataFrame returns correct predictions with multiple classes.
Even when the Snowflake table is transformed into a pandas DataFrame and then predicted, the predictions are still incorrect with only one class.
Steps to Reproduce:
Code to read data using snowpark api
input_dataset = dataiku.Dataset("inference_data") dku_snowpark = DkuSnowpark() snowpark_session = dku_snowpark.create_session( connection_name="SNOWFLAKE_CONNECTION", project_key=dataiku.default_project_key() ) dataset_dataframe = dku_snowpark.get_dataframe(dataset=input_dataset, session=snowpark_session)
Code to read data as a pandas df:
input_dataset = dataiku.Dataset("inference_data") dataset_dataframe = input_dataset.get_dataframe()
Code to run predictions:
client = dataikuapi.APINodeClient(apinode_endpoint, "Model_AutoMl") prediction = client.predict_records("Clustering_Model", dataset_dataframe)['results']
This is the data and results when using snowpark api
This is the data and result when using pandas dataframe
Any insights or solutions to resolve this inconsistency would be greatly appreciated. Please let me know if additional information is required.
Thank you for your support.
Operating system used: Mac OS