Creating new features through python API in visual analysis
I am trying to build models through Dataiku's Python API. I want to deploy the model as an API endpoint. I want to add some additional feature creation steps in the visual analysis to pass raw data to the endpoint, as given below in the Dataiku Documentation.
I want to know if it's possible to create preprocessing steps through the Python API. If it is possible, please guide me to the relevant information.
Note that if the visual analysis used to create the prediction model, or a clustering model for that matter, includes data preparation steps (in the Script tab), these steps will be included in the endpoint that is part of the API service deployed to the API node. As a result, records sent as API calls will first be preprocessed according to the steps in the Prepare script of the visual analysis before being passed to the model for scoring.
I really appreciate any help you can provide.
Operating system used: Windows 10
Best Answer
-
Answer from Dataiku Support :
step_type = 'FillEmptyWithValue'
step_params = {'columns': ['column'], 'appliesTo': 'SINGLE_COLUMN', 'value': 'N/A'}
step = {"metaType": "PROCESSOR","type": step_type,"params": step_params}
analysis = p.get_analysis("ANALYSIS_ID")
analysis_definition = analysis.get_definition()
analysis_definition.get_raw_script_steps().append(step)
analysis_definition.save()
Note that you can call list_analyses() to list the visual analyses and get_raw_script_steps() on the analysis definition to see how existing processor steps are defined.
Answers
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,161 Neuron
Thanks for posting the solution back to the Community.