score

class score

Abstract type representing the ensamble of usefull information to store during the couple evaluation.

In particular the class includes:

  • The Matthews Correlation Coefficient values of each couple (mcc)

  • The first gene index of the couple (gene_a)

  • The second gene index of the couple (gene_b)

  • The total accuracy of the couple (tot)

  • The accuracy score for each class (class_score)

Public Functions

score()

Default constructor.

score(const int32_t &N, const int32_t &n_class)

Constructor with number of couples and number of classes.

This is the constructor used inside the DNetPRO algorithm in which the number of couples can be evaluated as

*number_of_combination = number_of_samples * (number_of_samples - 1) / 2
Parameters:
  • N – The number of available couples

  • n_class – The number of available classes in which the samples are divided

score(score &&s) noexcept = default

Copy constructor.

The operator doesn’t perform a deep copy of the object but it just move all the buffers from the input object to the current one. In this way we optimize the memory management.

Parameters:

s – Score object

score &operator=(score &&s) noexcept = default

Copy operator.

The operator doesn’t perform a deep copy of the object but it just move all the buffers from the input object to the current one. In this way we optimize the memory management.

Parameters:

s – Score object

score(const score&) = delete

Delete copy constructor.

Note

This is employed to avoid accidental expensive copies

score &operator=(const score&) = delete

Delete assignment operator.

Note

This is employed to avoid accidental expensive copies

~score() = default

Destructor set as default.

Public Members

std::unique_ptr<float[]> mcc

Matthews Correlation Correlation of the couples.

std::unique_ptr<int32_t[]> gene_a

First index of the couples.

std::unique_ptr<int32_t[]> gene_b

Second index of the couples.

std::unique_ptr<int32_t[]> tot

Total accuracy of the couples.

std::unique_ptr<int32_t[]> class_score

Accuracy score for each class.

std::unique_ptr<uint32_t[]> confusion

Confusion matrix.

int32_t N

The number of stored results.

int32_t n_class

The number of classes (fixed to 2)

Public Static Functions

static float matthews_corrcoef(const int32_t *row_sum, const int32_t *col_sum, const int32_t &K, const int32_t &trace, const int32_t &n)

Compute the Matthews correlation coefficient.

Parameters:
  • row_sum – Sum over rows of the confusion matrix.

  • col_sum – Sum over columns of the confusion matrix.

  • K – Number of classes.

  • trace – Trace of the confusion matrix.

  • n – Total number of samples.

Returns:

Matthews correlation coefficient.