| Customize Help
| Save Settings

MclassExport



Function Map
Synopsis
Export data from a dataset context or training result buffer to a file.
Syntax
void MclassExport(
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
)
Description

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().

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
FileName

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.

function map For specifying the file name and path
Click to summarizeValue Description
Click to summarize M_INTERACTIVE
[This is only applicable to Windows]

Opens a dialog box from which to interactively specify the file's drive, directory, and name.

Click to summarize 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)

1 If you are passing the value in a variable, don't enclose it in MIL_TEXT().

FileFormat

Specifies the format of the file in which to export. Set this parameter to one of the following values.

function map For specifying the file format
Click to summarizeValue Description
Click to summarize M_FORMAT_CSV

Specifies a CSV file format. This value is supported when exporting from a dataset context.

(summarize)
Click to summarize M_FORMAT_DOT

Specifies a DOT file format. This value is supported when exporting a tree, from a tree ensemble training result buffer.

(summarize)
Click to summarize M_FORMAT_TXT

Specifies a TXT file format. This value is supported when exporting from a CNN or tree ensemble training result.

(summarize)
DatasetContextOrResultClassId

Specifies the identifier of the dataset context or a training result from which to export. Set this parameter to one of the following values.

function map For specifying the dataset context or training result from which to export
Click to summarizeValue Description
Click to summarize 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)
Click to summarize 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)
Index

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.

function map For specifying the index
Click to summarizeValue Description
Click to summarize M_DEFAULT

Specifies the index is set at 0.

Click to summarize Value >= 0

Specifies the index of the tree to export.

ExportType

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.

function map For specifying the type of export operation to perform with a dataset context
Click to summarizeValue Description
Click to summarize M_AUTHORS

Specifies to export the authors to a CSV file.

Click to summarize M_CLASS_DEFINITIONS

Specifies to export the class definitions to a CSV file.

Click to summarize 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.

function map For specifying the type of export operation to perform with a training result
Click to summarizeValue Description
Click to summarize 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)
Click to summarize 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)
ControlFlag

Reserved for future expansion and must be set to M_DEFAULT.

Compilation information
Header Include mil.h.
Library Use mil.lib; milclass.lib.
DLL Requires mil.dll; milclass.dll.
INTERACTIVE FORMAT CSV FORMAT DOT FORMAT TXT DEFAULT AUTHORS CLASS DEFINITIONS ENTRIES TRAIN REPORT TRAIN TREE