ecsminerwf
ECSMinerWF
Bases: ECSMiner
Implementation of the ECSMinerWF (ECSMiner without feedback) algorithm for novelty detection. [1]
[1] de Faria, Elaine Ribeiro, André Carlos Ponce de Leon Ferreira Carvalho, and Joao Gama. "MINAS: multiclass learning algorithm for novelty detection in data streams." Data mining and knowledge discovery 30 (2016): 640-680.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
K |
int
|
Number of pseudopoints per classifier. In other words, it is the number of K cluster for the clustering algorithm. |
50
|
min_examples_cluster |
int
|
Minimum number of examples to declare a novel class |
50
|
ensemble_size |
int
|
Number of classifiers to use to create the ensemble |
6
|
verbose |
int
|
Controls the level of verbosity, the higher, the more messages are displayed. Can be '1', '2', or '3'. |
0
|
random_state |
int
|
Seed for the random number generation. Makes the algorithm deterministic if a number is provided. |
None
|
init_algorithm |
string
|
String containing the clustering algorithm to use to initialize the clusters, supports 'kmeans' and 'mcikmeans' |
'mcikmeans'
|
Attributes:
Name | Type | Description |
---|---|---|
novel_models |
list of ClusterModel
|
List containing the models representing novel classes, added during the online phase. |
Source code in streamndr/model/ecsminerwf.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|
predict_many(X, y=None)
Represents the online phase. Receives multiple samples, for each sample predict its label and adds it to the cluster if it is a known class. Otherwise, if it's unknown, it is added to the short term memory and novelty detection is performed once the trigger has been reached (min_examples_cluster).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
DataFrame or ndarray
|
Samples |
required |
y |
list of int
|
True y values of the samples. |
None
|
Returns:
Type | Description |
---|---|
ndarray
|
Array of length len(X) containing the predicted labels, predicts -1 if the corresponding sample is labeled as unknown |
Raises:
Type | Description |
---|---|
Exception
|
If the model has not been trained first with learn_many() (offline phase) |
Source code in streamndr/model/ecsminerwf.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|