Documentation Index
Fetch the complete documentation index at: https://mintlify.com/usnistgov/NFIQ2/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The NFIQ2::ModelInfo class contains information about a random forest parameter model used by the NFIQ2 Algorithm. This class provides metadata about the model including its name, version, trainer, and file path.
Class Definition
namespace NFIQ2 {
class ModelInfo {
// Public interface
};
}
Constructors
Default Constructor
Default constructor.
File-based Constructor
ModelInfo(const std::string &modelInfoFilePath);
Constructor that loads model information from a file.
Path to model information file.
Methods
getModelName
std::string getModelName() const;
Obtain the model name.
getModelTrainer
std::string getModelTrainer() const;
Obtain the entity that trained the random forest model.
getModelDescription
std::string getModelDescription() const;
Obtain additional description information for model.
getModelVersion
std::string getModelVersion() const;
Obtain the version number of the model.
getModelPath
std::string getModelPath() const;
Obtain the file path of the model.
getModelHash
std::string getModelHash() const;
Obtain the md5 checksum of the model.
Constants
The class provides the following static constants for model information keys:
ModelInfoKeyName
static const char ModelInfoKeyName[];
Name key identifier.
ModelInfoKeyTrainer
static const char ModelInfoKeyTrainer[];
Trainer key identifier.
ModelInfoKeyDescription
static const char ModelInfoKeyDescription[];
Description key identifier.
ModelInfoKeyVersion
static const char ModelInfoKeyVersion[];
Version key identifier.
ModelInfoKeyPath
static const char ModelInfoKeyPath[];
Path key identifier.
ModelInfoKeyHash
static const char ModelInfoKeyHash[];
Hash key identifier.
Usage Example
#include <nfiq2_modelinfo.hpp>
#include <nfiq2_algorithm.hpp>
// Load model information from file
NFIQ2::ModelInfo modelInfo("/path/to/model_info.txt");
// Display model information
std::cout << "Model Name: " << modelInfo.getModelName() << std::endl;
std::cout << "Version: " << modelInfo.getModelVersion() << std::endl;
std::cout << "Trainer: " << modelInfo.getModelTrainer() << std::endl;
std::cout << "Description: " << modelInfo.getModelDescription() << std::endl;
std::cout << "Path: " << modelInfo.getModelPath() << std::endl;
std::cout << "Hash: " << modelInfo.getModelHash() << std::endl;
// Use ModelInfo to initialize Algorithm
NFIQ2::Algorithm algorithm(modelInfo);
The model information file typically contains key-value pairs for:
- Name: Identifier for the model
- Trainer: Organization or entity that trained the model
- Description: Additional details about the model’s purpose or training data
- Version: Version number of the model
- Path: Location of the random forest parameter file
- Hash: MD5 checksum for verifying model file integrity
The ModelInfo class is commonly used in conjunction with the Algorithm constructor to specify which random forest model to use for quality scoring.
See Also
- Algorithm - Uses ModelInfo for initialization