This function summarizes class results for a series of classifier output files and returns a summary data list.
ifcb_summarize_class_counts(
classpath_generic,
hdr_folder,
year_range,
use_python = FALSE
)
A list containing the following elements:
Classes used in the TreeBagger classifier.
Counts of each class considering each target placed in the winning class.
Counts of each class considering only classifications above the optimal threshold for maximum accuracy.
Volume analyzed for each file.
Dates associated with each file.
List of files processed.
The generic classpath provided as input.
Counts of each class considering only classifications above the adhoc threshold.
The adhoc threshold used for classification.
Character string specifying the location of the classifier output files. The path should include 'xxxx' in place of the 4-digit year (e.g., 'classxxxx_v1/').
Character string specifying the directory where the data (hdr files) are located. This can be a URL for web services or a full path for local files.
Numeric vector specifying the range of years (e.g., 2013:2014) to process.
Logical. If TRUE
, attempts to read the .mat
file using a Python-based method. Default is FALSE
.
If use_python = TRUE
, the function tries to read the .mat
file using ifcb_read_mat()
, which relies on SciPy
.
This approach may be faster than the default approach using R.matlab::readMat()
, especially for large .mat
files.
To enable this functionality, ensure Python is properly configured with the required dependencies.
You can initialize the Python environment and install necessary packages using ifcb_py_install()
.
If use_python = FALSE
or if SciPy
is not available, the function falls back to using R.matlab::readMat()
.
if (FALSE) {
ifcb_summarize_class_counts('path/to/class/classxxxx_v1/',
'path/to/data/', 2014)
}
Run the code above in your browser using DataLab