    

 ## On this page

  

 

 # CreateCustomModel Class Reference

 Last update: 16.07.2025 

This class creates a custom model definable in python. It is able to register an instance derived of [CreateCustomModelInterface](struct_create_custom_model_interface.xhtml "This class is exported as an director class through SWIG allowing the python context to define deriva..."). This registered instance may then be accessed just like any other model. It may also be serialized and de-serialized. [More...](class_create_custom_model.xhtml#details)

## <a name="pub-methods"></a>Public Member Functions

virtual string [\_\_str\_\_](class_create_custom_model.xhtml#a3031d648b73235d11d64df95db3d84ce) () Output function used in python context. Use this function to print instances of this class in python. [More...](#a3031d648b73235d11d64df95db3d84ce)  
 <a id="aedfb47575823522e6a6d22ce6c12e826"></a>virtual [addProperty](class_property_user_base.xhtml#aedfb47575823522e6a6d22ce6c12e826) ([PropertyBase](struct_property_base.xhtml) p) Properties that help the [ScalarMOP](struct_scalar_m_o_p.xhtml "This is only a sketch of the possible ScalarMOPApproximate API Implementation shall be refined if mor...") scheduling the Models to be built The properties class needs to be implemented for the specific model type.   
 [ModelBase](class_model_base.xhtml) \* [compute](class_create_custom_model.xhtml#adab3d3e83d7c6ba1916a079748b0f152) (::data\_handler::DataHandlerBase datahandler, [TrainingPlanBase](struct_training_plan_base.xhtml) training\_plan, quality\_measure::QualityMeasureBase quality\_measure, [CancelBase](struct_cancel_base.xhtml) \*cancel=nullptr) override Builds the model from the given samples and returns the model. [More...](#adab3d3e83d7c6ba1916a079748b0f152)  
 <a id="afe8658f8e270c0d0f3ce9f6453564f75"></a> [CreateCustomModel](class_create_custom_model.xhtml#afe8658f8e270c0d0f3ce9f6453564f75) () Creates an default initialized instance of this class.   
 <a id="a3822d2c5ef526b6238e4a127476d6a61"></a> [CreateCustomModel](class_create_custom_model.xhtml#a3822d2c5ef526b6238e4a127476d6a61) ([CreateCustomModel](class_create_custom_model.xhtml)) Copies an instance of this class.   
 virtual bool [equals](class_create_custom_model.xhtml#ad90ea62af69f033af4b88810fc877308) ([CreateModelBase](struct_create_model_base.xhtml) other) override Checking if the given configurations are equal this this instance. [More...](#ad90ea62af69f033af4b88810fc877308)  
 <a id="a0e1dd7df82728594fc128ed1c797b0c0"></a>virtual [PropertyList](class_property_list.xhtml) [getProperties](class_property_user_base.xhtml#a0e1dd7df82728594fc128ed1c797b0c0) () Returns the properties stored by this user.   
 bool [hasRegisteredCreateModel](class_create_custom_model.xhtml#a903a80535e8969883f2b43ec01b30b27) () Returns true iff this instance has a Python object connected to it via the registerCreateModel function. [More...](#a903a80535e8969883f2b43ec01b30b27)  
 virtual bool [isValid](class_create_custom_model.xhtml#a1a42d0ff7ef3b9c17965ecc14310ed5d) (::data\_handler::DataHandlerBase datahandler, [TrainingPlanBase](struct_training_plan_base.xhtml) training\_plan) override Destroys an instance of this class. [More...](#a1a42d0ff7ef3b9c17965ecc14310ed5d)  
 virtual [loadJson](class_create_custom_model.xhtml#ae5700ae63985e3e6b30cb716ddb5fdd0) ([JsonValue](class_json_value.xhtml) root) override Function to load the Serializables data from a [JsonValue](class_json_value.xhtml "Simple wrapper class to jsoncpp that make working with SWIG more convenient. "). [More...](#ae5700ae63985e3e6b30cb716ddb5fdd0)  
 <a id="a610dc87da6e12b63d83ce67b0ac1e27b"></a>[CreateCustomModel](class_create_custom_model.xhtml) [operator=](class_create_custom_model.xhtml#a610dc87da6e12b63d83ce67b0ac1e27b) ([CreateCustomModel](class_create_custom_model.xhtml)) Copies an instance of this class.   
 virtual [JsonValue](class_json_value.xhtml) [saveJson](class_create_custom_model.xhtml#ab4587af0230811304c91f1c0aaa1c9ce) () override Function to save the Serializables data as a [JsonValue](class_json_value.xhtml "Simple wrapper class to jsoncpp that make working with SWIG more convenient. "). [More...](#ab4587af0230811304c91f1c0aaa1c9ce)  
 virtual [transferProperties](class_property_user_base.xhtml#ab9507274f126b856fb69cd621f0f9fb4) ([PropertyList](class_property_list.xhtml) property\_list) Convenience function to transfer a complete [PropertyList](class_property_list.xhtml "Container class for handling properties Uses templates to easily find and cast configurations of diff...") into the model. [More...](#ab9507274f126b856fb69cd621f0f9fb4)  
 ## <a name="pub-attribs"></a>Public Attributes

apply SWIGTYPE \* **DISOWN** <a id="ad97b05b88ce9080f35b157cfacc8eb69"></a>string **id** <a id="details" name="details"></a>## Detailed Description

This class creates a custom model definable in python. It is able to register an instance derived of [CreateCustomModelInterface](struct_create_custom_model_interface.xhtml "This class is exported as an director class through SWIG allowing the python context to define deriva..."). This registered instance may then be accessed just like any other model. It may also be serialized and de-serialized.



## Member Function Documentation

<a id="a3031d648b73235d11d64df95db3d84ce"></a>## [◆ ](#a3031d648b73235d11d64df95db3d84ce)\_\_str\_\_()

 virtual string \_\_str\_\_  ( )   virtual 

Output function used in python context. Use this function to print instances of this class in python.

Returnsstring containing the object Reimplemented from [CreateModelBase](struct_create_model_base.xhtml#a3031d648b73235d11d64df95db3d84ce).





<a id="adab3d3e83d7c6ba1916a079748b0f152"></a>## [◆ ](#adab3d3e83d7c6ba1916a079748b0f152)compute()

 [ModelBase](class_model_base.xhtml)\* compute  ( ::data\_handler::DataHandlerBase  *datahandler*,    [TrainingPlanBase](struct_training_plan_base.xhtml)  *training\_plan*,    quality\_measure::QualityMeasureBase  *quality\_measure*,    [CancelBase](struct_cancel_base.xhtml) \*  *cancel* = `nullptr`   )   overridevirtual 

Builds the model from the given samples and returns the model.

Parameters datahandlerThe datahandler that contains the samples training\_planThe training plan that specifies how the model will be trained quality\_measureThe quality measure that allows to compute a models approximation quality cancelA cancellation object to cancel the training ReturnsThe trained model iff not cancelled Implements [CreateModelBase](struct_create_model_base.xhtml#a5e64887b96b93ac8aa95cca396d78f0a).





<a id="ad90ea62af69f033af4b88810fc877308"></a>## [◆ ](#ad90ea62af69f033af4b88810fc877308)equals()

 virtual bool equals  ( [CreateModelBase](struct_create_model_base.xhtml)  *other*)   overridevirtual 

Checking if the given configurations are equal this this instance.

Parameters otherThe other Config Returnstrue iff the same type and the same config entries Implements [CreateModelBase](struct_create_model_base.xhtml#a4a1cc8519f2bdb1f9952ceaa3391cbca).





<a id="a903a80535e8969883f2b43ec01b30b27"></a>## [◆ ](#a903a80535e8969883f2b43ec01b30b27)hasRegisteredCreateModel()

 bool hasRegisteredCreateModel  ( ) 

Returns true iff this instance has a Python object connected to it via the registerCreateModel function.

Returnstrue/false 



<a id="a1a42d0ff7ef3b9c17965ecc14310ed5d"></a>## [◆ ](#a1a42d0ff7ef3b9c17965ecc14310ed5d)isValid()

 virtual bool isValid  ( ::data\_handler::DataHandlerBase  *datahandler*,    [TrainingPlanBase](struct_training_plan_base.xhtml)  *training\_plan*   )   overridevirtual 

Destroys an instance of this class.

This function checks if the model can validly be trained from the given samples

Parameters datahandlerThe samples the model shall be trained with. training\_planThe training\_plan ReturnsTrue iff th emodel can be trained with the configuration data, the properties and samples Implements [CreateModelBase](struct_create_model_base.xhtml#a1202ca4468e899d1e6d321ebf59e67a1).





<a id="ae5700ae63985e3e6b30cb716ddb5fdd0"></a>## [◆ ](#ae5700ae63985e3e6b30cb716ddb5fdd0)loadJson()

 virtual loadJson  ( [JsonValue](class_json_value.xhtml)  *root*)   overridevirtual 

Function to load the Serializables data from a [JsonValue](class_json_value.xhtml "Simple wrapper class to jsoncpp that make working with SWIG more convenient. ").

Parameters rootThe data of the serializable as [JsonValue](class_json_value.xhtml "Simple wrapper class to jsoncpp that make working with SWIG more convenient. ") 



<a id="ab4587af0230811304c91f1c0aaa1c9ce"></a>## [◆ ](#ab4587af0230811304c91f1c0aaa1c9ce)saveJson()

 virtual [JsonValue](class_json_value.xhtml) saveJson  ( )   overridevirtual 

Function to save the Serializables data as a [JsonValue](class_json_value.xhtml "Simple wrapper class to jsoncpp that make working with SWIG more convenient. ").

ReturnsThe data of the serializable as [JsonValue](class_json_value.xhtml "Simple wrapper class to jsoncpp that make working with SWIG more convenient. ") 



<a id="ab9507274f126b856fb69cd621f0f9fb4"></a>## [◆ ](#ab9507274f126b856fb69cd621f0f9fb4)transferProperties()

 virtual transferProperties  ( [PropertyList](class_property_list.xhtml)  *property\_list*)   virtualinherited 

Convenience function to transfer a complete [PropertyList](class_property_list.xhtml "Container class for handling properties Uses templates to easily find and cast configurations of diff...") into the model.

Parameters property\_listThe properties to transfer into this model 



## Member Data Documentation

<a id="aa936348f586ed71a2a8585a4b16b20fc"></a>## [◆ ](#aa936348f586ed71a2a8585a4b16b20fc)DISOWN

 apply SWIGTYPE \* DISOWN

**Initial value:**{[CreateCustomModelInterface](struct_create_custom_model_interface.xhtml "This class is exported as an director class through SWIG allowing the python context to define deriva...") * create_model}





 registerCreateModel([CreateCustomModelInterface](struct_create_custom_model_interface.xhtml "This class is exported as an director class through SWIG allowing the python context to define deriva...") *create_model)