![]() |
KSquare Utilities
|
A confusion matrix object that is used to record the results from a CrossValidation. <see also cref="CrossValidation" More...
#include <ConfusionMatrix2.h>
Public Types | |
| typedef ConfusionMatrix2 * | ConfusionMatrix2Ptr |
Public Member Functions | |
| ConfusionMatrix2 (const MLClassList &_classes) | |
| ConfusionMatrix2 (const ConfusionMatrix2 &cm) | |
| ConfusionMatrix2 (const MLClassList &_classes, istream &f, kkint32 _bucketSize, kkint32 _numOfBuckets, kkint32 _numOfProbBuckets, kkint32 _probBucketSize, RunLog &_log) | |
| virtual | ~ConfusionMatrix2 () |
| double | Accuracy () |
| double | Accuracy (MLClassPtr mlClass) |
| VectorFloat | AccuracyByClass () const |
| float | AccuracyClassWeightedEqually () |
| float | AccuracyNorm () |
| KKStr | AccuracyStr () |
| void | AddIn (const ConfusionMatrix2 &cm, RunLog &log) |
| double | AvgPredProb () const |
| kkint32 | ClassCount () const |
| void | ComputeFundamentalStats (MLClassPtr ic, double &truePositives, double &trueNegatives, double &falsePositives, double &falseNegatives) const |
| double | Count (MLClassPtr mlClass) |
| double | CountsByKnownClass (kkint32 knownClassIdx) const |
| const VectorDouble & | CountsByKnownClass () const |
| void | FactorCounts (double factor) |
| float | FMeasure (MLClassPtr positiveClass, RunLog &log) const |
| void | Increment (MLClassPtr _knownClass, MLClassPtr _predClass, kkint32 _size, double _probability, RunLog &_log) |
| const MLClassList & | MLClasses () const |
| VectorDouble | PredictedCounts () const |
| double | PredictedCountsCM (kkint32 knownClassIdx, kkint32 predClassIdx) const |
| void | PrintAccuracyByProbByClassHTML (ostream &o) |
| void | PrintConfusionMatrix (ostream &_outFile) |
| void | PrintConfusionMatrixAvgPredProbHTML (ostream &o) |
| void | PrintConfusionMatrixHTML (const char *title, ostream &file) |
| void | PrintConfusionMatrixHTML (ostream &outFile) |
| void | PrintConfusionMatrixLatexTable (ostream &outFile) |
| void | PrintConfusionMatrixNarrow (ostream &outFile) |
| void | PrintConfusionMatrixTabDelimited (ostream &outFile) |
| void | PrintErrorByProb (ostream &outFile) |
| void | PrintErrorByProbByRows (ostream &outFile) |
| void | PrintErrorBySize (ostream &outFile) |
| void | PrintErrorBySizeByRows (ostream &outFile) |
| void | PrintErrorBySizeReduced (ostream &outFile) |
| void | PrintProbDistributionTitle (ostream &outFile) |
| void | PrintProbDistributionTotalCount (ostream &outFile) |
| void | PrintProbDistributionTotalError (ostream &outFile) |
| void | PrintTrueFalsePositivesTabDelimited (ostream &outFile) |
| double | TotalCount () |
| void | WriteSimpleConfusionMatrix (ostream &f) const |
| void | WriteXML (ostream &f) const |
Static Public Member Functions | |
| static ConfusionMatrix2Ptr | BuildFromIstreamXML (istream &f, RunLog &log) |
A confusion matrix object that is used to record the results from a CrossValidation. <see also cref="CrossValidation"
Definition at line 33 of file ConfusionMatrix2.h.
Definition at line 36 of file ConfusionMatrix2.h.
| ConfusionMatrix2::ConfusionMatrix2 | ( | const MLClassList & | _classes | ) |
Definition at line 58 of file ConfusionMatrix2.cpp.
References ConfusionMatrix2().
Referenced by ConfusionMatrix2(), KKMLL::ConfussionMatrix2List::DeriveAverageConfusionMatrix(), KKMLL::CrossValidationMxN::RunTrainAndTest(), and KKMLL::CrossValidationMxN::RunValidations().
| ConfusionMatrix2::ConfusionMatrix2 | ( | const ConfusionMatrix2 & | cm | ) |
Definition at line 85 of file ConfusionMatrix2.cpp.
References ConfusionMatrix2().
Referenced by ConfusionMatrix2().
| ConfusionMatrix2::ConfusionMatrix2 | ( | const MLClassList & | _classes, |
| istream & | f, | ||
| kkint32 | _bucketSize, | ||
| kkint32 | _numOfBuckets, | ||
| kkint32 | _numOfProbBuckets, | ||
| kkint32 | _probBucketSize, | ||
| RunLog & | _log | ||
| ) |
Will construct an instance of 'ConfusionMatrix2' from the contents of the provided 'istream' object.
| [in] | _classes | Will make local copy of this instance; this way we know the ordering which represents the numbering can not change behind our back. |
| [in] | f | File to write report to. |
| [in] | _bucketSize | Will keep statistics by size of particles. |
| [in] | _numOfBuckets | Number of Size buckets that will be maintained. |
| [in] | _numOfProbBuckets | Maximum number of probability buckets to keep track of, |
| [in] | _probBucketSize | Size of each probability bucket. |
| [in] | _log | Logger where messages are written to. |
Definition at line 24 of file ConfusionMatrix2.cpp.
References ConfusionMatrix2().
Referenced by BuildFromIstreamXML(), and ConfusionMatrix2().
|
virtual |
Definition at line 122 of file ConfusionMatrix2.cpp.
| double ConfusionMatrix2::Accuracy | ( | ) |
Definition at line 2485 of file ConfusionMatrix2.cpp.
Referenced by KKMLL::CrossValidationVoting::Accuracy(), and KKMLL::CrossValidation::Accuracy().
| double ConfusionMatrix2::Accuracy | ( | MLClassPtr | mlClass | ) |
Definition at line 2508 of file ConfusionMatrix2.cpp.
| VectorFloat ConfusionMatrix2::AccuracyByClass | ( | ) | const |
Definition at line 2527 of file ConfusionMatrix2.cpp.
| float ConfusionMatrix2::AccuracyClassWeightedEqually | ( | ) |
Definition at line 2548 of file ConfusionMatrix2.cpp.
Referenced by AccuracyNorm().
|
inline |
Definition at line 69 of file ConfusionMatrix2.h.
References AccuracyClassWeightedEqually().
Referenced by KKMLL::CrossValidation::AccuracyNorm().
| KKStr ConfusionMatrix2::AccuracyStr | ( | ) |
Definition at line 2443 of file ConfusionMatrix2.cpp.
References KKB::KKStr::Concat(), KKMLL::MLClass::Name(), KKB::KKStr::operator=(), and KKB::StrFormatDouble().
| void ConfusionMatrix2::AddIn | ( | const ConfusionMatrix2 & | cm, |
| RunLog & | log | ||
| ) |
Definition at line 2802 of file ConfusionMatrix2.cpp.
Referenced by KKMLL::ConfussionMatrix2List::DeriveAverageConfusionMatrix(), KKMLL::CrossValidationMxN::RunTrainAndTest(), and KKMLL::CrossValidationMxN::RunValidations().
| double ConfusionMatrix2::AvgPredProb | ( | ) | const |
Definition at line 2496 of file ConfusionMatrix2.cpp.
|
static |
Definition at line 3027 of file ConfusionMatrix2.cpp.
References ConfusionMatrix2().
|
inline |
Definition at line 83 of file ConfusionMatrix2.h.
| void ConfusionMatrix2::ComputeFundamentalStats | ( | MLClassPtr | ic, |
| double & | truePositives, | ||
| double & | trueNegatives, | ||
| double & | falsePositives, | ||
| double & | falseNegatives | ||
| ) | const |
Definition at line 1810 of file ConfusionMatrix2.cpp.
| double ConfusionMatrix2::Count | ( | MLClassPtr | mlClass | ) |
Definition at line 2571 of file ConfusionMatrix2.cpp.
| double ConfusionMatrix2::CountsByKnownClass | ( | kkint32 | knownClassIdx | ) | const |
Definition at line 347 of file ConfusionMatrix2.cpp.
| const VectorDouble & ConfusionMatrix2::CountsByKnownClass | ( | ) | const |
Definition at line 357 of file ConfusionMatrix2.cpp.
| void ConfusionMatrix2::FactorCounts | ( | double | factor | ) |
Will multiply all counts by 'factor' You would use this in conjunction with 'AddIn'.
Definition at line 2597 of file ConfusionMatrix2.cpp.
Referenced by KKMLL::ConfussionMatrix2List::DeriveAverageConfusionMatrix(), KKMLL::CrossValidationMxN::RunTrainAndTest(), and KKMLL::CrossValidationMxN::RunValidations().
| float ConfusionMatrix2::FMeasure | ( | MLClassPtr | positiveClass, |
| RunLog & | log | ||
| ) | const |
Definition at line 1846 of file ConfusionMatrix2.cpp.
References KKB::KKStr::Concat(), KKMLL::MLClass::Name(), and KKB::KKStr::operator=().
| void ConfusionMatrix2::Increment | ( | MLClassPtr | _knownClass, |
| MLClassPtr | _predClass, | ||
| kkint32 | _size, | ||
| double | _probability, | ||
| RunLog & | _log | ||
| ) |
|
inline |
Definition at line 106 of file ConfusionMatrix2.h.
Referenced by KKMLL::ClassificationBiasMatrix::ClassificationBiasMatrix(), and KKMLL::ConfussionMatrix2List::DeriveAverageConfusionMatrix().
| VectorDouble ConfusionMatrix2::PredictedCounts | ( | ) | const |
Definition at line 328 of file ConfusionMatrix2.cpp.
Definition at line 313 of file ConfusionMatrix2.cpp.
| void ConfusionMatrix2::PrintAccuracyByProbByClassHTML | ( | ostream & | o | ) |
Definition at line 1216 of file ConfusionMatrix2.cpp.
References KKB::KKStr::Concat(), KKB::KKStr::KKStr(), KKB::KKStr::operator+(), KKB::KKStr::operator=(), and KKB::StrFormatDouble().
| void ConfusionMatrix2::PrintConfusionMatrix | ( | ostream & | _outFile | ) |
Definition at line 919 of file ConfusionMatrix2.cpp.
References KKB::KKStr::Concat(), and KKB::KKStr::KKStr().
| void ConfusionMatrix2::PrintConfusionMatrixAvgPredProbHTML | ( | ostream & | o | ) |
Definition at line 1129 of file ConfusionMatrix2.cpp.
| void ConfusionMatrix2::PrintConfusionMatrixHTML | ( | const char * | title, |
| ostream & | file | ||
| ) |
Definition at line 2641 of file ConfusionMatrix2.cpp.
| void ConfusionMatrix2::PrintConfusionMatrixHTML | ( | ostream & | outFile | ) |
Definition at line 1025 of file ConfusionMatrix2.cpp.
References KKB::KKStr::Concat(), and KKB::KKStr::KKStr().
| void ConfusionMatrix2::PrintConfusionMatrixLatexTable | ( | ostream & | outFile | ) |
Definition at line 1464 of file ConfusionMatrix2.cpp.
References KKB::KKStr::Concat(), and KKB::KKStr::KKStr().
| void ConfusionMatrix2::PrintConfusionMatrixNarrow | ( | ostream & | outFile | ) |
Definition at line 1560 of file ConfusionMatrix2.cpp.
References KKB::KKStr::Concat(), KKB::KKStr::KKStr(), KKB::KKStr::LeftPad(), and KKB::operator<<().
| void ConfusionMatrix2::PrintConfusionMatrixTabDelimited | ( | ostream & | outFile | ) |
Definition at line 1328 of file ConfusionMatrix2.cpp.
References KKB::KKStr::Concat(), and KKB::KKStr::KKStr().
| void ConfusionMatrix2::PrintErrorByProb | ( | ostream & | outFile | ) |
Definition at line 1934 of file ConfusionMatrix2.cpp.
| void ConfusionMatrix2::PrintErrorByProbByRows | ( | ostream & | outFile | ) |
Definition at line 2083 of file ConfusionMatrix2.cpp.
| void ConfusionMatrix2::PrintErrorBySize | ( | ostream & | outFile | ) |
Definition at line 1894 of file ConfusionMatrix2.cpp.
| void ConfusionMatrix2::PrintErrorBySizeByRows | ( | ostream & | outFile | ) |
Definition at line 1986 of file ConfusionMatrix2.cpp.
| void ConfusionMatrix2::PrintErrorBySizeReduced | ( | ostream & | outFile | ) |
Definition at line 2335 of file ConfusionMatrix2.cpp.
| void ConfusionMatrix2::PrintProbDistributionTitle | ( | ostream & | outFile | ) |
Definition at line 2198 of file ConfusionMatrix2.cpp.
| void ConfusionMatrix2::PrintProbDistributionTotalCount | ( | ostream & | outFile | ) |
Definition at line 2216 of file ConfusionMatrix2.cpp.
| void ConfusionMatrix2::PrintProbDistributionTotalError | ( | ostream & | outFile | ) |
Definition at line 2263 of file ConfusionMatrix2.cpp.
| void ConfusionMatrix2::PrintTrueFalsePositivesTabDelimited | ( | ostream & | outFile | ) |
Definition at line 1682 of file ConfusionMatrix2.cpp.
References KKB::KKStr::Concat().
|
inline |
Definition at line 154 of file ConfusionMatrix2.h.
| void ConfusionMatrix2::WriteSimpleConfusionMatrix | ( | ostream & | f | ) | const |
Meant to work with 'ClassificationStatus.cs' of PicesCommander. This will write a simple confusion matrix table; one row for each class. 'ClassificationStatus.cs' will then use this data to adjust for bias in the learner.
Definition at line 3241 of file ConfusionMatrix2.cpp.
| void ConfusionMatrix2::WriteXML | ( | ostream & | f | ) | const |
Definition at line 2976 of file ConfusionMatrix2.cpp.