> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CreateCustomModelInterface Struct Reference

Part of [MOP models](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__models)

This class is exported as an director class through SWIG allowing the python context to define derivations from it. A user is then able to implement her own classes satisfying this interface and then being used with the [MOP](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_m_o_p.md) framework.

## Public Member Functions

| Type | Name |
| - | - |
|  virtual string | [\_\_class\_name\_internal\_\_](#a31de2088e35819f6e03dc305bcc22294) () Internal helper function to use with de-/serialization. |
| virtual bool | [compute](#a8c21bb60a1ae5e9c3e6ee1c7cfb6c86d) (::data\_handler::DataHandlerBase datahandler, [TrainingPlanBase](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/struct_training_plan_base.md) training\_plan, quality\_measure::QualityMeasureBase quality\_measure, [CustomModel](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_custom_model.md) model) Trains the model in the goal language and returns a handle to the newly trained model that is used to access the model in the PluginModelManager. |
| virtual string | [displayName](#a2d5202c0fb80141117dfbfbb41a46a77) () Returns the name to be displayen in all GUI situations Fallback is class name. |
| [PropertyList](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_property_list.md) | [getProperties](#a1111f254a4d5749fb9e1d62a0bf976f0) () This function makes the properties set on the C++ [CustomModel](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_custom_model.md) class accessible to the Python context. |
| virtual bool | [isValid](#a1637eb7dcd73ee7adfe215c49b330f44) (::data\_handler::DataHandlerBase datahandler, [TrainingPlanBase](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/struct_training_plan_base.md) training\_plan) This function is used to check whether the model may be trained or not A python CreateModel... class shall implement this function to let the [MOP](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_m_o_p.md) check if the datahandler and training plan are suitable to actually train the model. |
| virtual string | [licenseLevel](#a5a4c33e8a236524ef9d522558e547b27) () Returns a user definable license level for this [CustomModel](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_custom_model.md) "Pro", "Premium" (default), "Enterprise". |
| virtual bool | [loadJson](#a64a299a9067f1d5c4d8eeb74b39e9f94) ([JsonValue](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_json_value.md) root) This function is used to read the CreateCustomModels configuration state from the the given string. How this is done needs to be implemented in Python. |
| virtual bool | [saveJson](#ab8451e71159211ca3e07325fd1f0eeb8) ([JsonValue](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_json_value.md) root) This function returns the state as a Json from the Python of the [CustomModelInterface](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/struct_custom_model_interface.md) to be included in the [CustomModel](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_custom_model.md). It needs to be overloaded in Python. |

## Public Attributes

| Type | Name |
| - | - |
|  string | **nodeName** |
|  string | [workingDir](#acca011e8d3d2df2bd81e25557245281b) Access the working directory and the node name from python. |

## Detailed Description

This class is exported as an director class through SWIG allowing the python context to define derivations from it. A user is then able to implement her own classes satisfying this interface and then being used with the [MOP](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_m_o_p.md) framework.

## Member Function Documentation

### compute()

```cpp theme={null}
virtual bool compute(
    ::data_handler::DataHandlerBase datahandler,
    TrainingPlanBase training_plan,
    quality_measure::QualityMeasureBase quality_measure,
    CustomModel model
)
```

`virtual`

Trains the model in the goal language and returns a handle to the newly trained model that is used to access the model in the PluginModelManager.

**Parameters**

| Name | Description |
| - | - |
| datahandler | The data to train the model with |
| training\_plan | The training plan to use when training the model |
| quality\_measure | The quality measure to evaluate the models prognosis quality with |
| model | The custom model that handles/stores the newly created custom model |

**Returns**

true is the [CustomModel](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_custom_model.md) could be created

### displayName()

```cpp theme={null}
virtual string displayName()
```

`virtual`

Returns the name to be displayen in all GUI situations Fallback is class name.

**Returns**

the display name

### getProperties()

```cpp theme={null}
PropertyList getProperties()
```

This function makes the properties set on the C++ [CustomModel](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_custom_model.md) class accessible to the Python context.

**Returns**

A property list

### isValid()

```cpp theme={null}
virtual bool isValid(
    ::data_handler::DataHandlerBase datahandler,
    TrainingPlanBase training_plan
)
```

`virtual`

This function is used to check whether the model may be trained or not A python CreateModel... class shall implement this function to let the [MOP](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_m_o_p.md) check if the datahandler and training plan are suitable to actually train the model.

**Parameters**

| Name | Description |
| - | - |
| datahandler | The datahandler containing the data for the training |
| training\_plan | The training\_plan describing how to train the model |

**Returns**

true iff the models training is likely to succeed

### licenseLevel()

```cpp theme={null}
virtual string licenseLevel()
```

`virtual`

Returns a user definable license level for this [CustomModel](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_custom_model.md) "Pro", "Premium" (default), "Enterprise".

**Returns**

one of these values ("Premium" by default)

### loadJson()

```cpp theme={null}
virtual bool loadJson(JsonValue root)
```

`virtual`

This function is used to read the CreateCustomModels configuration state from the the given string. How this is done needs to be implemented in Python.

**Parameters**

| Name | Description |
| - | - |
| state | The Json string as produced by the saveJson function |

**Returns**

True iff loading the state was successful

### saveJson()

```cpp theme={null}
virtual bool saveJson(JsonValue root)
```

`virtual`

This function returns the state as a Json from the Python of the [CustomModelInterface](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/struct_custom_model_interface.md) to be included in the [CustomModel](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_custom_model.md). It needs to be overloaded in Python.

**Returns**

The serialization of the python instance
