User defined model
As it’s described in the definition of functions, the user-defined models can be accepted as an input to be trained and evaluated in a package functions. The format of these functions must be in accordance with the following description:
Parameters
# |
Input Name |
Input Description |
|---|---|---|
1
|
X_training
|
type: dataframe
details: the dataframe of features in the training set which is
used to train the models.
|
2
|
X_validation
|
type: dataframe
details: the dataframe of features in the validation set which is
used to evaluate models’ performance.
|
3
|
Y_training
|
type: array
details: The values of the target variable in the training set.
|
Returns
# |
Output Name |
Output Description |
|---|---|---|
1
|
train_predictions
|
type: list
details: The predicted values of target variable in the training
part
|
2
|
validation_predictions
|
type: list
details: The predicted values of target variable in the validation
part
|
3
|
trained_model
|
type: object
details: The trained model on the the training part
|
The custom model function must be defined in this format:
def custom_model_name(X_training, X_validation, Y_training):
# import required packages
# define your model
# train the model on X_training and Y_training
# predict values on X_training
# predict values on X_validation
return(train_predictions, validation_predictions, trained_model)