gradient_boosting_model_write

Writes a gradient boosting model to an ASCII file for later retrieval using imsls_f_gradient_boosting_model_read.

Synopsis

#include <imsls.h>

void imsls_f_gradient_boosting_model_write (Imsls_f_gradient_boosting_model *gb_model, char *filename, …, 0)

The type double function is imsls_d_gradient_boosting_model_write.

Required Arguments

Imsls_f_gradient_boosting_model *gb_model (Input)
A trained gradient boosting model.

char *filename (Input)
The name of an ASCII file to be created. A full or relative path can be given. If this file exists, its content is replaced with the gradient boosting model gb_model. If it does not exist, it is created. If the optional argument IMSLS_FILE is used, filename is ignored.

Synopsis with Optional Arguments

#include <imsls.h>

void imsls_f_gradient_boosting_model_write (Imsls_f_gradient_boosting_model *gb_model, char *filename,

IMSLS_PRINT,

IMSLS_FILE, FILE *file,

0)

Optional Arguments

IMSLS_PRINT

Prints status of file opening, reading and closing.

Default: No printing.

IMSLS_FILE, FILE *file (Input/Output)

A FILE pointer to a file opened for writing. This file is written but not closed. If this option is provided, filename is ignored. This option allows users to write additional data and multiple models to the same file. To ensure the file is opened and closed with the same C run-time library used by the product, open and close this file using imsls_fopen and imsls_fclose.

Description

This function stores an Imsls_f_gradient_boosting_model data structure containing a trained gradient boosting model into an ASCII file. If the optional argument IMSLS_FILE is provided, imsls_f_gradient_boosting_model_write writes the file and returns without closing the file. If this argument is not provided, imsls_f_gradient_boosting_model_write creates a file using the path and name provided in filename, writes the data structure to that file and then closes the file before returning.

Examples

See Example 1 of imsls_f_gradient_boosting_predict.

Fatal Errors

IMSLS_FILE_OPEN_FAILURE

Unable to open # file for writing model.