DiSMEC++
|
Functions | |
void | save_sparse_predictions (const path &target, const PredictionMatrix &values, const IndexMatrix &indices) |
Saves sparse predictions as a text file. More... | |
void | save_sparse_predictions (std::ostream &target, const PredictionMatrix &values, const IndexMatrix &indices) |
Saves sparse predictions as a text file. More... | |
std::pair< IndexMatrix, PredictionMatrix > | read_sparse_prediction (std::istream &source) |
Reads sparse predictions as saved by save_sparse_predictions() . More... | |
std::pair< IndexMatrix, PredictionMatrix > | read_sparse_prediction (const path &source) |
Reads sparse predictions as saved by save_sparse_predictions() . More... | |
void | save_dense_predictions_as_txt (const path &target, const PredictionMatrix &values) |
Saves predictions as a dense txt matrix. More... | |
void | save_dense_predictions_as_txt (std::ostream &target, const PredictionMatrix &values) |
Saves predictions as a dense txt matrix. More... | |
void | save_dense_predictions_as_npy (const path &target, const PredictionMatrix &values) |
Saves predictions as a dense npy file. More... | |
void | save_dense_predictions_as_npy (std::ostream &target, const PredictionMatrix &values) |
Saves predictions as a dense npy file. More... | |
std::pair<IndexMatrix, PredictionMatrix> dismec::io::prediction::read_sparse_prediction | ( | const path & | source | ) |
Reads sparse predictions as saved by save_sparse_predictions()
.
source | The stream from which the data is read. The first line is expected the header that contains the number of instances and predictions, followed by the prediction of one instance each line. |
std::pair<IndexMatrix, PredictionMatrix> dismec::io::prediction::read_sparse_prediction | ( | std::istream & | source | ) |
Reads sparse predictions as saved by save_sparse_predictions()
.
source | The stream from which the data is read. The first line is expected the header that contains the number of instances and predictions, followed by the prediction of one instance each line. |
Referenced by PYBIND11_MODULE(), and TEST_CASE().
void dismec::io::prediction::save_dense_predictions_as_npy | ( | const path & | target, |
const PredictionMatrix & | values | ||
) |
Saves predictions as a dense npy file.
target | Path to the file which will be created or overwritten, or output stream. |
values | Matrix with the results. Each row corresponds to an instance and each column to a label. |
void dismec::io::prediction::save_dense_predictions_as_npy | ( | std::ostream & | target, |
const PredictionMatrix & | values | ||
) |
Saves predictions as a dense npy file.
target | Path to the file which will be created or overwritten, or output stream. |
values | Matrix with the results. Each row corresponds to an instance and each column to a label. |
void dismec::io::prediction::save_dense_predictions_as_txt | ( | const path & | target, |
const PredictionMatrix & | values | ||
) |
Saves predictions as a dense txt matrix.
target | Path to the file which will be created or overwritten, or output stream. |
values | Matrix with the results. Each row corresponds to an instance and each column to a label. |
Referenced by TEST_CASE().
void dismec::io::prediction::save_dense_predictions_as_txt | ( | std::ostream & | target, |
const PredictionMatrix & | values | ||
) |
Saves predictions as a dense txt matrix.
target | Path to the file which will be created or overwritten, or output stream. |
values | Matrix with the results. Each row corresponds to an instance and each column to a label. |
void dismec::io::prediction::save_sparse_predictions | ( | const path & | target, |
const PredictionMatrix & | values, | ||
const IndexMatrix & | indices | ||
) |
Saves sparse predictions as a text file.
The sparse predictions are expected to be available as two separate arrays indices
and values
. Each is an N x K
array, where N
is the number of prediction points and K
denotes the number of entries for each instance. The values are then interpreted as follows: For instance i
, the predictions are given for the labels indices[i, j]
, with corresponding scores values[i, k]
.
target | Path to the file which will be created or overwritten, or output stream. |
values | The scores for the labels corresponding to indices . |
indices | The indices corresponding to the values. |
std::invalid_argument | if the shape of values does not match indices . |
Referenced by main(), and TEST_CASE().
void dismec::io::prediction::save_sparse_predictions | ( | std::ostream & | target, |
const PredictionMatrix & | values, | ||
const IndexMatrix & | indices | ||
) |
Saves sparse predictions as a text file.
The sparse predictions are expected to be available as two separate arrays indices
and values
. Each is an N x K
array, where N
is the number of prediction points and K
denotes the number of entries for each instance. The values are then interpreted as follows: For instance i
, the predictions are given for the labels indices[i, j]
, with corresponding scores values[i, k]
.
target | Path to the file which will be created or overwritten, or output stream. |
values | The scores for the labels corresponding to indices . |
indices | The indices corresponding to the values. |
std::invalid_argument | if the shape of values does not match indices . |