|
OpenNN
Open-source neural networks library
|
Computes diagnostic metrics for a trained network on testing data. More...
#include <testing_analysis.h>
Classes | |
| struct | BinaryClassificationRates |
| Sample indices grouped by binary-classification outcome. More... | |
| struct | GoodnessOfFitAnalysis |
| Per-output regression goodness-of-fit summary. More... | |
| struct | KolmogorovSmirnovResults |
| Output of perform_Kolmogorov_Smirnov_analysis(). More... | |
| struct | RocAnalysis |
| Output of perform_roc_analysis(). More... | |
Public Member Functions | |
| TestingAnalysis (NeuralNetwork *new_neural_network=nullptr, Dataset *new_dataset=nullptr) | |
| Constructs a testing analysis bound to a network and dataset. | |
| const NeuralNetwork * | get_neural_network () const |
| Returns the network being evaluated. | |
| const Dataset * | get_dataset () const |
| Returns the dataset providing testing samples. | |
| void | set_neural_network (NeuralNetwork *new_neural_network) |
| Replaces the network being evaluated. | |
| void | set_dataset (Dataset *new_dataset) |
| Replaces the dataset providing testing samples. | |
| void | set_batch_size (Index new_batch_size) |
| Sets the batch size used when running the network. | |
| Index | get_batch_size () const |
| Returns the batch size used when running the network. | |
| void | check () const |
| Validates that network and dataset are configured. | |
| MatrixR | calculate_error () const |
| Computes the per-output mean error on the testing samples. | |
| Tensor3 | calculate_error_data () const |
| Computes raw error data for every testing sample. | |
| MatrixR | calculate_percentage_error_data () const |
| Computes percentage errors for every testing sample. | |
| vector< Descriptives > | calculate_absolute_errors_descriptives () const |
| Computes descriptive statistics of absolute errors on the testing partition. | |
| vector< Descriptives > | calculate_absolute_errors_descriptives (const MatrixR &targets, const MatrixR &outputs) const |
| Computes descriptive statistics of absolute errors between the supplied tensors. | |
| vector< Descriptives > | calculate_percentage_errors_descriptives () const |
| Computes descriptive statistics of percentage errors on the testing partition. | |
| vector< Descriptives > | calculate_percentage_errors_descriptives (const MatrixR &targets, const MatrixR &outputs) const |
| Computes descriptive statistics of percentage errors between the supplied tensors. | |
| vector< vector< Descriptives > > | calculate_error_data_descriptives () const |
| Computes descriptive statistics for every error type on the testing partition. | |
| void | print_error_data_descriptives () const |
| Prints the result of calculate_error_data_descriptives() to standard output. | |
| vector< Histogram > | calculate_error_data_histograms (const Index bins_number=10) const |
| Builds histograms of the per-sample errors. | |
| Tensor< VectorI, 1 > | calculate_maximal_errors (const Index maximal_number=10) const |
| Returns the indices of the samples with the largest errors. | |
| MatrixR | calculate_errors () const |
| Computes per-output regression error metrics on the testing partition. | |
| VectorR | calculate_errors (const MatrixR &targets, const MatrixR &outputs) const |
| Computes regression error metrics between the supplied tensors. | |
| VectorR | calculate_errors (const string &samples_role) const |
| Computes regression error metrics on a specific samples subset. | |
| MatrixR | calculate_binary_classification_errors () const |
| Computes binary-classification error metrics on the testing partition. | |
| VectorR | calculate_binary_classification_errors (const string &samples_role) const |
| Computes binary-classification error metrics on a specific samples subset. | |
| MatrixR | calculate_multiple_classification_errors () const |
| Computes multi-class classification error metrics on the testing partition. | |
| VectorR | calculate_multiple_classification_errors (const string &samples_role) const |
| Computes multi-class classification error metrics on a specific samples subset. | |
| float | calculate_masked_accuracy (const Tensor3 &outputs, const MatrixR &mask) const |
| Computes accuracy ignoring positions flagged by a mask (e.g. padding tokens). | |
| float | calculate_determination (const VectorR &targets, const VectorR &outputs) const |
| Computes the coefficient of determination R^2. | |
| Tensor< Correlation, 1 > | linear_correlation (const MatrixR &targets, const MatrixR &outputs) const |
| Computes per-output linear correlation between targets and outputs. | |
| void | print_linear_correlations () const |
| Prints the linear correlations to standard output. | |
| Tensor< GoodnessOfFitAnalysis, 1 > | perform_goodness_of_fit_analysis () const |
| Runs goodness-of-fit analysis for every output. | |
| void | print_goodness_of_fit_analysis () const |
| Prints the result of perform_goodness_of_fit_analysis() to standard output. | |
| VectorR | calculate_binary_classification_tests (const float decision_threshold=0.50) const |
| Computes a battery of binary-classification metrics at a given threshold. | |
| void | print_binary_classification_tests () const |
| Prints the result of calculate_binary_classification_tests() to standard output. | |
| vector< MatrixI > | calculate_multilabel_confusion (const float decision_threshold) const |
| Computes one confusion matrix per label for a multilabel problem. | |
| MatrixI | calculate_confusion (const MatrixR &targets, const MatrixR &outputs, float decision_threshold=0.50) const |
| Computes a confusion matrix from the supplied targets and outputs. | |
| MatrixI | calculate_confusion (const float decision_threshold=0.50) const |
| Computes the confusion matrix on the testing partition. | |
| VectorI | calculate_positives_negatives_rate (const MatrixR &targets, const MatrixR &outputs) const |
| Counts samples that are positive vs. negative per class. | |
| RocAnalysis | perform_roc_analysis () const |
| Runs full ROC analysis on the testing partition. | |
| MatrixR | calculate_roc_curve (const MatrixR &targets, const MatrixR &outputs) const |
| Computes the ROC curve from the supplied targets and outputs. | |
| float | calculate_area_under_curve (const MatrixR &roc_curve) const |
| Computes the area under a ROC curve. | |
| float | calculate_area_under_curve_confidence_limit (const MatrixR &targets, const MatrixR &outputs) const |
| Computes the 95% confidence limit on the AUC. | |
| float | calculate_optimal_threshold (const MatrixR &roc_curve) const |
| Returns the threshold that maximizes Youden's J on a ROC curve. | |
| MatrixR | perform_cumulative_gain_analysis () const |
| Runs cumulative-gain analysis on the testing partition. | |
| MatrixR | calculate_cumulative_gain (const MatrixR &targets, const MatrixR &outputs) const |
| Computes the positive-class cumulative-gain curve. | |
| MatrixR | calculate_negative_cumulative_gain (const MatrixR &targets, const MatrixR &outputs) const |
| Computes the negative-class cumulative-gain curve. | |
| MatrixR | perform_lift_chart_analysis () const |
| Runs lift-chart analysis on the testing partition. | |
| MatrixR | calculate_lift_chart (const MatrixR &cumulative_gain) const |
| Computes the lift curve from a cumulative-gain curve. | |
| KolmogorovSmirnovResults | perform_Kolmogorov_Smirnov_analysis () const |
| Runs the Kolmogorov-Smirnov analysis on the testing partition. | |
| VectorR | calculate_maximum_gain (const MatrixR &positive_cumulative_gain, const MatrixR &negative_cumulative_gain) const |
| Computes the maximum vertical distance between two cumulative-gain curves. | |
| vector< Histogram > | calculate_output_histogram (const MatrixR &outputs, Index bins_number=10) const |
| Builds histograms of the network output values. | |
| BinaryClassificationRates | calculate_binary_classification_rates (const float decision_threshold=0.50) const |
| Splits the testing samples into TP/FP/FN/TN groups. | |
| vector< Index > | calculate_true_positive_samples (const MatrixR &targets, const MatrixR &outputs, const vector< Index > &indices, float decision_threshold) const |
| Returns the indices of the true-positive samples in the supplied subset. | |
| vector< Index > | calculate_false_positive_samples (const MatrixR &targets, const MatrixR &outputs, const vector< Index > &indices, float decision_threshold) const |
| Returns the indices of the false-positive samples in the supplied subset. | |
| vector< Index > | calculate_false_negative_samples (const MatrixR &targets, const MatrixR &outputs, const vector< Index > &indices, float decision_threshold) const |
| Returns the indices of the false-negative samples in the supplied subset. | |
| vector< Index > | calculate_true_negative_samples (const MatrixR &targets, const MatrixR &outputs, const vector< Index > &indices, float decision_threshold) const |
| Returns the indices of the true-negative samples in the supplied subset. | |
| VectorR | calculate_multiple_classification_precision () const |
| Computes the per-class precision in a multi-class problem. | |
| MatrixR | calculate_multiple_classification_tests () const |
| Computes a battery of multi-class classification metrics. | |
| Tensor< VectorI, 2 > | calculate_multiple_classification_rates () const |
| Splits multi-class testing samples by (true class, predicted class). | |
| Tensor< VectorI, 2 > | calculate_multiple_classification_rates (const MatrixR &targets, const MatrixR &outputs, const vector< Index > &indices) const |
| Splits multi-class samples by (true class, predicted class) on supplied data. | |
| Tensor< string, 2 > | calculate_well_classified_samples (const MatrixR &targets, const MatrixR &outputs, const vector< string > &labels_names) const |
| Returns the well-classified samples annotated with predicted/target labels. | |
| Tensor< string, 2 > | calculate_misclassified_samples (const MatrixR &targets, const MatrixR &outputs, const vector< string > &labels_names) const |
| Returns the misclassified samples annotated with predicted/target labels. | |
| void | save_confusion (const filesystem::path &file_name) const |
| Saves the testing-partition confusion matrix to a CSV file. | |
| void | save_multiple_classification_tests (const filesystem::path &file_name) const |
| Saves the multi-class classification tests to a CSV file. | |
| void | save_well_classified_samples (const MatrixR &targets, const MatrixR &outputs, const vector< string > &labels_names, const filesystem::path &file_name) const |
| Saves the well-classified samples to a CSV file. | |
| void | save_misclassified_samples (const MatrixR &targets, const MatrixR &outputs, const vector< string > &labels_names, const filesystem::path &file_name) const |
| Saves the misclassified samples to a CSV file. | |
| void | save_well_classified_samples_statistics (const MatrixR &targets, const MatrixR &outputs, const vector< string > &labels_names, const filesystem::path &file_name) const |
| Saves descriptive statistics of the well-classified samples to CSV. | |
| void | save_misclassified_samples_statistics (const MatrixR &targets, const MatrixR &outputs, const vector< string > &labels_names, const filesystem::path &file_name) const |
| Saves descriptive statistics of the misclassified samples to CSV. | |
| vector< VectorR > | calculate_error_autocorrelation (const Index maximum_lags_number=10) const |
| Computes the autocorrelation of the residuals at increasing lags. | |
| vector< VectorR > | calculate_inputs_errors_cross_correlation (const Index maximum_lags_number=10) const |
| Computes the cross-correlation between inputs and residuals at increasing lags. | |
| pair< float, float > | test_transformer () const |
| Runs perplexity-style evaluation on a transformer-like network. | |
| string | test_transformer (const vector< string > &context_string, bool imported_vocabulary) const |
| Runs free-form generation on a transformer-like network. | |
| void | from_JSON (const JsonDocument &document) |
| Restores the analysis state from a JSON document. | |
| void | to_JSON (JsonWriter &writer) const |
| Serializes the analysis state to JSON. | |
| void | save (const filesystem::path &file_name) const |
| Saves the analysis state to a JSON file on disk. | |
| void | load (const filesystem::path &file_name) |
| Loads the analysis state from a JSON file on disk. | |
Computes diagnostic metrics for a trained network on testing data.
Holds non-owning pointers to a NeuralNetwork and a Dataset and runs the network on the dataset's testing partition. Exposes:
| opennn::TestingAnalysis::TestingAnalysis | ( | NeuralNetwork * | new_neural_network = nullptr, |
| Dataset * | new_dataset = nullptr ) |
Constructs a testing analysis bound to a network and dataset.
| new_neural_network | Non-owning pointer to the trained network. |
| new_dataset | Non-owning pointer to the dataset providing testing samples. |
| vector< Descriptives > opennn::TestingAnalysis::calculate_absolute_errors_descriptives | ( | ) | const |
Computes descriptive statistics of absolute errors on the testing partition.
| vector< Descriptives > opennn::TestingAnalysis::calculate_absolute_errors_descriptives | ( | const MatrixR & | targets, |
| const MatrixR & | outputs ) const |
Computes descriptive statistics of absolute errors between the supplied tensors.
| targets | Target values. |
| outputs | Network outputs. |
| float opennn::TestingAnalysis::calculate_area_under_curve | ( | const MatrixR & | roc_curve | ) | const |
Computes the area under a ROC curve.
| roc_curve | Curve produced by calculate_roc_curve(). |
| float opennn::TestingAnalysis::calculate_area_under_curve_confidence_limit | ( | const MatrixR & | targets, |
| const MatrixR & | outputs ) const |
Computes the 95% confidence limit on the AUC.
| targets | Target values. |
| outputs | Network outputs. |
| MatrixR opennn::TestingAnalysis::calculate_binary_classification_errors | ( | ) | const |
Computes binary-classification error metrics on the testing partition.
| VectorR opennn::TestingAnalysis::calculate_binary_classification_errors | ( | const string & | samples_role | ) | const |
Computes binary-classification error metrics on a specific samples subset.
| samples_role | Sample-role filter. |
| BinaryClassificationRates opennn::TestingAnalysis::calculate_binary_classification_rates | ( | const float | decision_threshold = 0.50 | ) | const |
Splits the testing samples into TP/FP/FN/TN groups.
| decision_threshold | Probability threshold. |
| VectorR opennn::TestingAnalysis::calculate_binary_classification_tests | ( | const float | decision_threshold = 0.50 | ) | const |
Computes a battery of binary-classification metrics at a given threshold.
| decision_threshold | Probability threshold separating the positive and negative class. |
| MatrixI opennn::TestingAnalysis::calculate_confusion | ( | const float | decision_threshold = 0.50 | ) | const |
Computes the confusion matrix on the testing partition.
| decision_threshold | Probability threshold (binary case only). |
| MatrixI opennn::TestingAnalysis::calculate_confusion | ( | const MatrixR & | targets, |
| const MatrixR & | outputs, | ||
| float | decision_threshold = 0.50 ) const |
Computes a confusion matrix from the supplied targets and outputs.
| targets | Target values. |
| outputs | Network outputs. |
| decision_threshold | Probability threshold (binary case only). |
| MatrixR opennn::TestingAnalysis::calculate_cumulative_gain | ( | const MatrixR & | targets, |
| const MatrixR & | outputs ) const |
Computes the positive-class cumulative-gain curve.
| targets | Target values. |
| outputs | Network outputs. |
| float opennn::TestingAnalysis::calculate_determination | ( | const VectorR & | targets, |
| const VectorR & | outputs ) const |
Computes the coefficient of determination R^2.
| targets | Target values. |
| outputs | Network outputs. |
| MatrixR opennn::TestingAnalysis::calculate_error | ( | ) | const |
Computes the per-output mean error on the testing samples.
| vector< VectorR > opennn::TestingAnalysis::calculate_error_autocorrelation | ( | const Index | maximum_lags_number = 10 | ) | const |
Computes the autocorrelation of the residuals at increasing lags.
| maximum_lags_number | Maximum lag to compute. |
| Tensor3 opennn::TestingAnalysis::calculate_error_data | ( | ) | const |
Computes raw error data for every testing sample.
| vector< vector< Descriptives > > opennn::TestingAnalysis::calculate_error_data_descriptives | ( | ) | const |
Computes descriptive statistics for every error type on the testing partition.
| vector< Histogram > opennn::TestingAnalysis::calculate_error_data_histograms | ( | const Index | bins_number = 10 | ) | const |
Builds histograms of the per-sample errors.
| bins_number | Number of bins per histogram. |
| MatrixR opennn::TestingAnalysis::calculate_errors | ( | ) | const |
Computes per-output regression error metrics on the testing partition.
| VectorR opennn::TestingAnalysis::calculate_errors | ( | const MatrixR & | targets, |
| const MatrixR & | outputs ) const |
Computes regression error metrics between the supplied tensors.
| targets | Target values. |
| outputs | Network outputs. |
| VectorR opennn::TestingAnalysis::calculate_errors | ( | const string & | samples_role | ) | const |
Computes regression error metrics on a specific samples subset.
| samples_role | Sample-role filter ("Training", "Validation", "Testing"). |
| vector< Index > opennn::TestingAnalysis::calculate_false_negative_samples | ( | const MatrixR & | targets, |
| const MatrixR & | outputs, | ||
| const vector< Index > & | indices, | ||
| float | decision_threshold ) const |
Returns the indices of the false-negative samples in the supplied subset.
| targets | Target values. |
| outputs | Network outputs. |
| indices | Index subset to consider. |
| decision_threshold | Probability threshold. |
| vector< Index > opennn::TestingAnalysis::calculate_false_positive_samples | ( | const MatrixR & | targets, |
| const MatrixR & | outputs, | ||
| const vector< Index > & | indices, | ||
| float | decision_threshold ) const |
Returns the indices of the false-positive samples in the supplied subset.
| targets | Target values. |
| outputs | Network outputs. |
| indices | Index subset to consider. |
| decision_threshold | Probability threshold. |
| vector< VectorR > opennn::TestingAnalysis::calculate_inputs_errors_cross_correlation | ( | const Index | maximum_lags_number = 10 | ) | const |
Computes the cross-correlation between inputs and residuals at increasing lags.
| maximum_lags_number | Maximum lag to compute. |
Computes the lift curve from a cumulative-gain curve.
| cumulative_gain | Curve produced by calculate_cumulative_gain(). |
| float opennn::TestingAnalysis::calculate_masked_accuracy | ( | const Tensor3 & | outputs, |
| const MatrixR & | mask ) const |
Computes accuracy ignoring positions flagged by a mask (e.g. padding tokens).
| outputs | Network outputs as a rank-3 tensor (e.g. [batch, time, vocab]). |
| mask | Binary mask matching the [batch, time] dims; non-zero positions count. |
| Tensor< VectorI, 1 > opennn::TestingAnalysis::calculate_maximal_errors | ( | const Index | maximal_number = 10 | ) | const |
Returns the indices of the samples with the largest errors.
| maximal_number | Number of indices to return. |
| VectorR opennn::TestingAnalysis::calculate_maximum_gain | ( | const MatrixR & | positive_cumulative_gain, |
| const MatrixR & | negative_cumulative_gain ) const |
Computes the maximum vertical distance between two cumulative-gain curves.
| positive_cumulative_gain | Positive-class curve. |
| negative_cumulative_gain | Negative-class curve. |
| Tensor< string, 2 > opennn::TestingAnalysis::calculate_misclassified_samples | ( | const MatrixR & | targets, |
| const MatrixR & | outputs, | ||
| const vector< string > & | labels_names ) const |
Returns the misclassified samples annotated with predicted/target labels.
| targets | Target values. |
| outputs | Network outputs. |
| labels_names | Class names matching the target columns. |
| vector< MatrixI > opennn::TestingAnalysis::calculate_multilabel_confusion | ( | const float | decision_threshold | ) | const |
Computes one confusion matrix per label for a multilabel problem.
| decision_threshold | Probability threshold per label. |
| MatrixR opennn::TestingAnalysis::calculate_multiple_classification_errors | ( | ) | const |
Computes multi-class classification error metrics on the testing partition.
| VectorR opennn::TestingAnalysis::calculate_multiple_classification_errors | ( | const string & | samples_role | ) | const |
Computes multi-class classification error metrics on a specific samples subset.
| samples_role | Sample-role filter. |
| VectorR opennn::TestingAnalysis::calculate_multiple_classification_precision | ( | ) | const |
Computes the per-class precision in a multi-class problem.
| Tensor< VectorI, 2 > opennn::TestingAnalysis::calculate_multiple_classification_rates | ( | ) | const |
Splits multi-class testing samples by (true class, predicted class).
| Tensor< VectorI, 2 > opennn::TestingAnalysis::calculate_multiple_classification_rates | ( | const MatrixR & | targets, |
| const MatrixR & | outputs, | ||
| const vector< Index > & | indices ) const |
Splits multi-class samples by (true class, predicted class) on supplied data.
| targets | Target values. |
| outputs | Network outputs. |
| indices | Index subset to consider. |
| MatrixR opennn::TestingAnalysis::calculate_multiple_classification_tests | ( | ) | const |
Computes a battery of multi-class classification metrics.
| MatrixR opennn::TestingAnalysis::calculate_negative_cumulative_gain | ( | const MatrixR & | targets, |
| const MatrixR & | outputs ) const |
Computes the negative-class cumulative-gain curve.
| targets | Target values. |
| outputs | Network outputs. |
| float opennn::TestingAnalysis::calculate_optimal_threshold | ( | const MatrixR & | roc_curve | ) | const |
Returns the threshold that maximizes Youden's J on a ROC curve.
| roc_curve | Curve produced by calculate_roc_curve(). |
| vector< Histogram > opennn::TestingAnalysis::calculate_output_histogram | ( | const MatrixR & | outputs, |
| Index | bins_number = 10 ) const |
Builds histograms of the network output values.
| outputs | Network outputs. |
| bins_number | Number of bins per histogram. |
| MatrixR opennn::TestingAnalysis::calculate_percentage_error_data | ( | ) | const |
Computes percentage errors for every testing sample.
| vector< Descriptives > opennn::TestingAnalysis::calculate_percentage_errors_descriptives | ( | ) | const |
Computes descriptive statistics of percentage errors on the testing partition.
| vector< Descriptives > opennn::TestingAnalysis::calculate_percentage_errors_descriptives | ( | const MatrixR & | targets, |
| const MatrixR & | outputs ) const |
Computes descriptive statistics of percentage errors between the supplied tensors.
| targets | Target values. |
| outputs | Network outputs. |
| VectorI opennn::TestingAnalysis::calculate_positives_negatives_rate | ( | const MatrixR & | targets, |
| const MatrixR & | outputs ) const |
Counts samples that are positive vs. negative per class.
| targets | Target values. |
| outputs | Network outputs. |
| MatrixR opennn::TestingAnalysis::calculate_roc_curve | ( | const MatrixR & | targets, |
| const MatrixR & | outputs ) const |
Computes the ROC curve from the supplied targets and outputs.
| targets | Target values. |
| outputs | Network outputs. |
| vector< Index > opennn::TestingAnalysis::calculate_true_negative_samples | ( | const MatrixR & | targets, |
| const MatrixR & | outputs, | ||
| const vector< Index > & | indices, | ||
| float | decision_threshold ) const |
Returns the indices of the true-negative samples in the supplied subset.
| targets | Target values. |
| outputs | Network outputs. |
| indices | Index subset to consider. |
| decision_threshold | Probability threshold. |
| vector< Index > opennn::TestingAnalysis::calculate_true_positive_samples | ( | const MatrixR & | targets, |
| const MatrixR & | outputs, | ||
| const vector< Index > & | indices, | ||
| float | decision_threshold ) const |
Returns the indices of the true-positive samples in the supplied subset.
| targets | Target values. |
| outputs | Network outputs. |
| indices | Index subset to consider. |
| decision_threshold | Probability threshold. |
| Tensor< string, 2 > opennn::TestingAnalysis::calculate_well_classified_samples | ( | const MatrixR & | targets, |
| const MatrixR & | outputs, | ||
| const vector< string > & | labels_names ) const |
Returns the well-classified samples annotated with predicted/target labels.
| targets | Target values. |
| outputs | Network outputs. |
| labels_names | Class names matching the target columns. |
| void opennn::TestingAnalysis::check | ( | ) | const |
Validates that network and dataset are configured.
| runtime_error | if either is missing. |
| void opennn::TestingAnalysis::from_JSON | ( | const JsonDocument & | document | ) |
Restores the analysis state from a JSON document.
| document | Parsed JSON produced by to_JSON(). |
|
inline |
Returns the batch size used when running the network.
|
inline |
Returns the dataset providing testing samples.
|
inline |
Returns the network being evaluated.
| Tensor< Correlation, 1 > opennn::TestingAnalysis::linear_correlation | ( | const MatrixR & | targets, |
| const MatrixR & | outputs ) const |
Computes per-output linear correlation between targets and outputs.
| targets | Target values (samples x outputs). |
| outputs | Network outputs (samples x outputs). |
| void opennn::TestingAnalysis::load | ( | const filesystem::path & | file_name | ) |
Loads the analysis state from a JSON file on disk.
| file_name | Source path. |
| MatrixR opennn::TestingAnalysis::perform_cumulative_gain_analysis | ( | ) | const |
Runs cumulative-gain analysis on the testing partition.
| Tensor< GoodnessOfFitAnalysis, 1 > opennn::TestingAnalysis::perform_goodness_of_fit_analysis | ( | ) | const |
Runs goodness-of-fit analysis for every output.
| KolmogorovSmirnovResults opennn::TestingAnalysis::perform_Kolmogorov_Smirnov_analysis | ( | ) | const |
Runs the Kolmogorov-Smirnov analysis on the testing partition.
| MatrixR opennn::TestingAnalysis::perform_lift_chart_analysis | ( | ) | const |
Runs lift-chart analysis on the testing partition.
| RocAnalysis opennn::TestingAnalysis::perform_roc_analysis | ( | ) | const |
Runs full ROC analysis on the testing partition.
| void opennn::TestingAnalysis::print_binary_classification_tests | ( | ) | const |
Prints the result of calculate_binary_classification_tests() to standard output.
| void opennn::TestingAnalysis::print_error_data_descriptives | ( | ) | const |
Prints the result of calculate_error_data_descriptives() to standard output.
| void opennn::TestingAnalysis::print_goodness_of_fit_analysis | ( | ) | const |
Prints the result of perform_goodness_of_fit_analysis() to standard output.
| void opennn::TestingAnalysis::print_linear_correlations | ( | ) | const |
Prints the linear correlations to standard output.
| void opennn::TestingAnalysis::save | ( | const filesystem::path & | file_name | ) | const |
Saves the analysis state to a JSON file on disk.
| file_name | Destination path. |
| void opennn::TestingAnalysis::save_confusion | ( | const filesystem::path & | file_name | ) | const |
Saves the testing-partition confusion matrix to a CSV file.
| file_name | Destination path. |
| void opennn::TestingAnalysis::save_misclassified_samples | ( | const MatrixR & | targets, |
| const MatrixR & | outputs, | ||
| const vector< string > & | labels_names, | ||
| const filesystem::path & | file_name ) const |
Saves the misclassified samples to a CSV file.
| targets | Target values. |
| outputs | Network outputs. |
| labels_names | Class names matching the target columns. |
| file_name | Destination path. |
| void opennn::TestingAnalysis::save_misclassified_samples_statistics | ( | const MatrixR & | targets, |
| const MatrixR & | outputs, | ||
| const vector< string > & | labels_names, | ||
| const filesystem::path & | file_name ) const |
Saves descriptive statistics of the misclassified samples to CSV.
| targets | Target values. |
| outputs | Network outputs. |
| labels_names | Class names matching the target columns. |
| file_name | Destination path. |
| void opennn::TestingAnalysis::save_multiple_classification_tests | ( | const filesystem::path & | file_name | ) | const |
Saves the multi-class classification tests to a CSV file.
| file_name | Destination path. |
| void opennn::TestingAnalysis::save_well_classified_samples | ( | const MatrixR & | targets, |
| const MatrixR & | outputs, | ||
| const vector< string > & | labels_names, | ||
| const filesystem::path & | file_name ) const |
Saves the well-classified samples to a CSV file.
| targets | Target values. |
| outputs | Network outputs. |
| labels_names | Class names matching the target columns. |
| file_name | Destination path. |
| void opennn::TestingAnalysis::save_well_classified_samples_statistics | ( | const MatrixR & | targets, |
| const MatrixR & | outputs, | ||
| const vector< string > & | labels_names, | ||
| const filesystem::path & | file_name ) const |
Saves descriptive statistics of the well-classified samples to CSV.
| targets | Target values. |
| outputs | Network outputs. |
| labels_names | Class names matching the target columns. |
| file_name | Destination path. |
|
inline |
Sets the batch size used when running the network.
| new_batch_size | Number of samples per batch (0 = full pass). |
|
inline |
Replaces the dataset providing testing samples.
| new_dataset | Non-owning pointer to the new dataset. |
|
inline |
Replaces the network being evaluated.
| new_neural_network | Non-owning pointer to the new network. |
| pair< float, float > opennn::TestingAnalysis::test_transformer | ( | ) | const |
Runs perplexity-style evaluation on a transformer-like network.
| string opennn::TestingAnalysis::test_transformer | ( | const vector< string > & | context_string, |
| bool | imported_vocabulary ) const |
Runs free-form generation on a transformer-like network.
| context_string | Tokens prepended to the model as context. |
| imported_vocabulary | Whether to load the vocabulary from disk. |
| void opennn::TestingAnalysis::to_JSON | ( | JsonWriter & | writer | ) | const |
Serializes the analysis state to JSON.
| writer | JSON writer that receives the state tree. |