Custom Modeling in Visual ML

The visual machine learning (ML) tool (or interface) of Dataiku DSS lets you apply several built-in machine learning algorithms (from libraries like Scikit-Learn, TensorFlow, and XGBoost) as well as custom algorithms to your data. This lesson will show how to access and implement custom models in the visual ML tool of Dataiku DSS.

Custom Modeling in the Visual ML Tool

Dataiku DSS allows you to import custom algorithms into the visual ML tool, thereby giving you complete control over the ML algorithm’s design while still leveraging the visual ML tool’s capabilities of feature preprocessing, model interpretability, etc.

From the Design tab of the visual ML interface, you can access custom models by clicking the Algorithms panel.

../../../_images/custom_modeling_concept_algorithms_list.png

From the Algorithms panel, you can create custom models by:

  • importing custom algorithms defined in your project library or the global Python library of the Dataiku DSS instance;

  • importing custom algorithms from the Python libraries included in the code environment used by the visual ML tool; and

  • using a prediction algorithm that is part of a plugin.

When you click the Algorithms panel in the visual ML tool, the list of algorithms begins with the built-in algorithms. At the bottom of the list is an option for adding a custom model.

../../../_images/custom_modeling_concept_add_custom_model.png

By clicking this option, Dataiku DSS opens up a code window where the model object can be instantiated.

../../../_images/custom_modeling_constraints.png

Note

We do not recommend that you define your ML algorithm in this code window; rather, you should define custom algorithms in libraries.

Custom Algorithms From Libraries

When defining and importing algorithms for use in the visual ML tool, note that:

  • The algorithms must be scikit learn compatible, having both a fit() and a predict() method.

  • Classifiers must also have a classes_ attribute and can implement a predict_proba() method in addition to the fit() and predict() methods.

  • Algorithms can be defined in the project’s Python library or the global Python library of the data directory and imported into the visual ML tool.

  • Algorithms can also be imported from any library that is included in the code environment used by the visual ML tool.

Tip

Dataiku DSS assists you with instantiating model objects in the code window by providing Code Samples that you can use within the code window. The code samples button is located at the top right corner of the code window.

Custom Algorithms From a Plugin

A custom model can also be created from a plugin’s prediction algorithm component.

In this approach, the plugin first needs to be installed on the Dataiku DSS instance. The algorithm then becomes accessible from the Algorithms section of the Visual ML tool’s Design tab. For example, the Linear Discriminant Analysis and the LightGBM Classification algorithms in the following figure are plugin components.

../../../_images/custom_modeling_concept_plugin_components.png

Note

You need to specify the proper code environment when using custom models in the visual ML tool. This code environment must include the required Python libraries for your machine learning algorithm.

You can specify the code environment by clicking the Runtime environment panel of the design tab.

Model Training Metrics

When training a custom model, the model training dashboard may not always track the model’s metrics during training. This can happen if hyperparameter optimization is not enabled.

../../../_images/custom_modeling_concept_training_metrics.png

What’s Next?

Continue learning about custom models in the visual ML tool by working through the hands-on lesson on Custom Modeling.