oadds package¶
Submodules¶
oadds.oadds module¶
Main module.
-
class
oadds.oadds.
Cluster
[source]¶ Bases:
object
Cluster class. Contains the list of the micro-cluster and the number of micro-clusters.
-
class
oadds.oadds.
MicroCluster
(currenttimestamp, lamb, clusterNumber)[source]¶ Bases:
object
Micro-Cluster class
Parameters: - currenttimestamp – the timestamp in which the cluster is created.
- lamb – the lamb parameter used as decay factor.
- clusterNumber – the number of the micro-cluster.
-
insertSample
(sample, timestamp=0)[source]¶ Adds a sample to a micro-cluster. Updates the variables of the micro-cluster with
updateRealTimeWeight()
andupdateRealTimeLSandSS()
Parameters: - sample – the sample object
- timestamp – deprecated, not needed anymore. Will be removed in the next versions.
-
noNewSamples
()[source]¶ Updates the Weighted Linear Sum (WLS), the Weighted Squared Sum (WSS) and the weight of the micro-cluster when no new samples are merged.
-
class
oadds.oadds.
OADDS
(lamb=0.1, epsilon='dynamic', minPts=1, beta=0.4, mu='auto', numberInitialSamples=None, startingBuffer=None, tp=60, k_std=3)[source]¶ Bases:
object
OADDS class.
Parameters: - lamb – the lambda parameter - fading factor
- epsilon – the epsilon parameter
- beta – the beta parameter
- mu – the mu parameter
- numberInitialSamples – samples to use as initial buffer
- startgingBuffer – initial buffer on which apply DBScan or use it as unique class.
- tp – frequency at which to apply the pruning strategy and remove old micro-clusters.
-
initWithoutDBScan
()[source]¶ Produces a micro-cluster merging all the samples passed into the initial buffer
If epsilon is auto computes epsilon as the maxium radius obtained from these initial samples.
-
resetLearningImpl
()[source]¶ Initializes two empty Cluster as a p-micro-cluter list and o-micro-cluster list.
If mu is auto computes the value
-
runInitialization
()[source]¶ Initializes the variables of the main algorithm with the methods
resetLearningImpl()
andinitWithoutDBScan()
-
runOnNewSample
(sample)[source]¶ Performs the basic DenStream procedure for merging new samples.
- Try to merge the sample to the closest core-micro-cluster (or)
- Try to merge the sample to the closest outlier-micro-cluster (or)
- Generate new outlier-micro-cluster by the sample
Parameters: sample – the new available sample in the stream Returns: False
if the sample is merged to an existing core-micro-cluster otherwiseTrue
meaning “anomalous” sample.
-
class
oadds.oadds.
Sample
(value, timestamp: int)[source]¶ Bases:
object
Each record of the stream has to be declared as a Sample class.
Parameters: - value – the values of the current sample.
- timestamp – the timestamp of current sample.
Module contents¶
Top-level package for oadds.