Table: | For specifying the file format |
Table: | For specifying the dataset context or training result from which to export |
Table: | For specifying the index |
MIL_CONST_TEXT_PTR FileName, | //in |
MIL_INT64 FileFormat, | //in |
MIL_ID DatasetContextOrResultClassId, | //in |
MIL_INT64 Index, | //in |
MIL_INT64 ExportType, | //in |
MIL_INT64 ControlFlag | //in |
This function exports data from a dataset context or training result buffer to a file. Datasets are exported to CSV files. Training result reports are exported to TXT files. Trees are exported to DOT files. To import data, use MclassImport().
Specifies the name and path of the file in which to export. The function handles (internally) the opening and closing of the file. If you specify a file that already exists, it will be overwritten.
The specified file name must use the CSV or DOT file extension. CSV and DOT files represent common formats that hold comma separated values and tree graph descriptions, respectively. You should use a CSV file when exporting from a dataset context. When exporting trees from a classification result buffer that holds the training results of tree ensemble, use a DOT file. A TXT file extension must be used when exporting a training report of a CNN result or a tree ensemble result.
Set this parameter to one of the following values.
For specifying the file name and path
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_INTERACTIVE |
[This is
only applicable to Windows]
Opens a dialog box from which to interactively specify the file's drive, directory, and name. |
||||||||||||||||||||||||||||||||||||||
MIL_TEXT("FileName") 1 |
Specifies the file's drive, directory, and name (for example, "E:\Manual\MySweetSweetDataset.csv"). To specify a file on a remote computer (under Distributed MIL), prefix the file name string with "remote:///" (for example, "remote:///E:\Manual\MyEvenSweeterDataset.dot"). (summarize)Specifies the file's drive, directory, and name (for example, "E:\Manual\MySweetSweetDataset.csv"). (more details...) |
1 If you are passing the value in a variable, don't enclose it in MIL_TEXT().
Specifies the format of the file in which to export. Set this parameter to one of the following values.
For specifying the file format
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_FORMAT_CSV |
Specifies a CSV file format. This value is supported when exporting from a dataset context. (summarize)Specifies a CSV file format. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_FORMAT_DOT |
Specifies a DOT file format. This value is supported when exporting a tree, from a tree ensemble training result buffer. (summarize)Specifies a DOT file format. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_FORMAT_TXT |
Specifies a TXT file format. This value is supported when exporting from a CNN or tree ensemble training result. (summarize)Specifies a TXT file format. (more details...) |
Specifies the identifier of the dataset context or a training result from which to export. Set this parameter to one of the following values.
For specifying the dataset context or training result
from which to export
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
ContextDatasetId |
Specifies the identifier of a features or images dataset context. This context is allocated using MclassAlloc() with M_DATASET_FEATURES or M_DATASET_IMAGES. (summarize)Specifies the identifier of a features or images dataset context. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultBufTrainId |
Specifies the identifier of a CNN or tree ensemble result buffer used for training. This buffer is allocated using MclassAllocResult() with M_TRAIN_CNN_RESULT or M_TRAIN_TREE_ENSEMBLE_RESULT. (summarize)Specifies the identifier of a CNN or tree ensemble result buffer used for training. (more details...) |
Specifies the trees (one or all) to export from a tree ensemble result buffer used for training. If you are not exporting from this result buffer (as specified using the DatasetContextOrResultClassId parameter), you must set the Index parameter to M_DEFAULT.
For specifying the index
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the index is set at 0. |
||||||||||||||||||||||||||||||||||||||
Value >= 0 |
Specifies the index of the tree to export. |
Specifies the type of export operation to perform. Available operations depend on the context or result from which you are exporting.
If you are exporting from a dataset context, you can set the ExportType parameter to one of the following values. In this case, the FileName parameter must be set to a CSV file, the FileFormat parameter must be set to M_FORMAT_CSV, the DatasetContextOrResultClassId parameter must be set to the identifier of a dataset context, and the Index parameter must be set to M_DEFAULT.
For specifying the type of export operation to
perform with a dataset context
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_AUTHORS |
Specifies to export the authors to a CSV file. |
||||||||||||||||||||||||||||||||||||||
M_CLASS_DEFINITIONS |
Specifies to export the class definitions to a CSV file. |
||||||||||||||||||||||||||||||||||||||
M_ENTRIES |
Specifies to export the entries to a CSV file. |
If you are exporting from a CNN or tree ensemble training result, you can set the ExportType parameter to the following values.
When exporting from a CNN training result, the FileName parameter must be set to a CSV file, the FileFormat parameter must be set to M_FORMAT_CSV, the DatasetContextOrResultClassId parameter must be set to the identifier of a CNN training result buffer, and the Index parameter must be set to M_DEFAULT.
When exporting from a tree ensemble training result, the FileName parameter must be set to either a DOT or TXT file. The FileFormat parameter must be set accordingly based on FileName parameter. To export tree(s), use M_FORMAT_DOT with M_TRAIN_TREE. To export a training report, use M_FORMAT_TXT with M_TRAIN_REPORT.
For specifying the type of export operation to
perform with a training result
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_TRAIN_REPORT |
Specifies to export a train report to a TXT file. If you are exporting from a CNN training result, the TXT file contains the CNN training results of each epoch. If you are exporting from a tree ensemble training result, the TXT file contains results from the training. For example, the TXT file contains results such as feature importance, train accuracy, and number of trained trees. (summarize)Specifies to export a train report to a TXT file. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_TRAIN_TREE |
Specifies to export the resulting trained trees to a DOT file. Note that this type of export is only available when exporting from a tree ensemble training result. (summarize)Specifies to export the resulting trained trees to a DOT file. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; milclass.lib. |
DLL | Requires mil.dll; milclass.dll. |