Skip to content

Commit 9c0198a

Browse files
committed
WIF - Classifiers - Documentation enhancement
1 parent e67b876 commit 9c0198a

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

include/wif/classifiers/classifier.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,18 @@ class Classifier {
4040

4141
/**
4242
* @brief Perform classification of one flow
43+
* Only flowFeatures fields set by setFeatureSourceIDs() are processed
4344
*
4445
* @param flowFeatures flow features to classify
45-
* @return double classification result
46+
* @return ClfResult classification result
4647
*/
4748
virtual ClfResult classify(const FlowFeatures& flowFeatures) = 0;
4849

4950
/**
5051
* @brief Perform classification of burst of flows
5152
*
5253
* @param burstOfFlowFeatures burst of flow features to classify
53-
* @return std::vector<double> classification results
54+
* @return std::vector<ClfResult> classification results
5455
*/
5556
virtual std::vector<ClfResult> classify(const std::vector<FlowFeatures>& burstOfFlowFeatures)
5657
= 0;

include/wif/classifiers/ipPrefixClassifier.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ class IpPrefixClassifier : public Classifier {
4848

4949
/**
5050
* @brief Classify single flowFeature object
51-
* ClfResult contains non-zero double value if flowFeatures contained a field with IP from
52-
* blocklist, otherwise the double value is set to zero
51+
* Source fields of flowFeatures objects must hold a value of type WIF::IpAddress
52+
*
53+
* ClfResult contains a single non-zero double value if flowFeatures contained a field with IP
54+
* from blocklist, otherwise the double value is set to zero
5355
*
5456
* @param flowFeatures flow features to classify
5557
* @return ClfResult result of the classification

include/wif/classifiers/regexClassifier.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,22 @@ class RegexClassifier : public Classifier {
3636

3737
/**
3838
* @brief Classify single flowFeature object
39+
* Source fields of flowFeatures objects must hold a value of type std::string
40+
* If more source fields is set, the sub-results are combined together by a Combinator obtained
41+
* in the constructor
42+
*
43+
* ClfResult contains a single double value obtained from the combinator
3944
*
4045
* @param flowFeatures
41-
* @return double
46+
* @return ClfResult
4247
*/
4348
ClfResult classify(const FlowFeatures& flowFeatures) override;
4449

4550
/**
4651
* @brief Classify a burst of flow features
4752
*
4853
* @param burstOfFlowsFeatures
49-
* @return std::vector<double>
54+
* @return std::vector<ClfResult>
5055
*/
5156
std::vector<ClfResult> classify(const std::vector<FlowFeatures>& burstOfFlowsFeatures) override;
5257

include/wif/classifiers/scikitMlClassifier.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,22 @@ class ScikitMlClassifier : public Classifier {
5050

5151
/**
5252
* @brief Classify single flowFeature object
53+
* Source fields of flowFeatures objects must hold a value of type double
54+
* Fields are passed to the ML model in the order of passed source feature IDs
55+
*
56+
* ClfResult contains std::vector<double> representing output of predict_proba() call
57+
* with probabilities of each class
5358
*
5459
* @param flowFeatures
55-
* @return double
60+
* @return ClfResult
5661
*/
5762
ClfResult classify(const FlowFeatures& flowFeatures) override;
5863

5964
/**
6065
* @brief Classify a burst of flow features
6166
*
6267
* @param burstOfFlowsFeatures
63-
* @return std::vector<double>
68+
* @return std::vector<ClfResult>
6469
*/
6570
std::vector<ClfResult> classify(const std::vector<FlowFeatures>& burstOfFlowsFeatures) override;
6671

0 commit comments

Comments
 (0)