Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data ROCConfig
- rocThreshold :: ROCConfig -> Double
- rocMaxClusters :: ROCConfig -> Int
- defaultROCConfig :: ROCConfig
- data Prototype a
- newPrototype :: a -> Prototype a
- prototypeValue :: Prototype a -> a
- prototypeWeight :: Prototype a -> Double
- class ClusterSpace a where
- data ROCContext a
- emptyROCContext :: ROCConfig -> ROCContext a
- loadROCContext :: Foldable f => ROCConfig -> f (Prototype a) -> ROCContext a
- rocPrototypes :: ROCContext a -> [Prototype a]
- clusterize :: forall a f. (ClusterSpace a, Foldable f) => f a -> ROCContext a -> ROCContext a
- clusterizeAddMerge :: forall a. ClusterSpace a => a -> ROCContext a -> ROCContext a
- clusterizeSingle :: forall a. ClusterSpace a => a -> ROCContext a -> ROCContext a
- clusterizeMerge :: forall a. ClusterSpace a => ROCContext a -> ROCContext a
- clusterizeNewPrototype :: forall a. ClusterSpace a => a -> ROCContext a -> ROCContext a
- clusterizePostprocess :: forall a. ClusterSpace a => ROCContext a -> ROCContext a
Algorithm configuration
Configuration of ROC clusterization
rocThreshold :: ROCConfig -> Double Source #
If weight of prototype is less than the value, it is removed at final step.
rocMaxClusters :: ROCConfig -> Int Source #
Maximum count of clusters, could be less
defaultROCConfig :: ROCConfig Source #
Default configuration:
ROCConfig {
rocThreshold = 0
, rocMaxClusters = 10
}
Cluster definition
Cluster information
newPrototype :: a -> Prototype a Source #
Create prototype with given point as center and zero weight
prototypeValue :: Prototype a -> a Source #
prototypeWeight :: Prototype a -> Double Source #
API
class ClusterSpace a where Source #
Operations that value has to support to use in ROC clusterisation
Zero point in space
pointAdd :: a -> a -> a Source #
Addition of vectors in space
pointScale :: Double -> a -> a Source #
Scaling by a scalar
pointKernel :: a -> a -> Double Source #
Kernel function
pointDistanceSquared :: a -> a -> Double Source #
Square of distance between of points (defined via kernel) and exposed only for possible optimizations as for Gaussian kernel (2 - 2 * pointKernel x y)
data ROCContext a Source #
Internal context of algorithm
Functor ROCContext Source # | |
Generic (ROCContext a) Source # | |
type Rep (ROCContext a) Source # | |
emptyROCContext :: ROCConfig -> ROCContext a Source #
Create new context for clusterization from scratch
loadROCContext :: Foldable f => ROCConfig -> f (Prototype a) -> ROCContext a Source #
Load context from set of prototypes
rocPrototypes :: ROCContext a -> [Prototype a] Source #
Get collection of prototypes from ROC context
:: (ClusterSpace a, Foldable f) | |
=> f a | Set of data that need to be added to clusters |
-> ROCContext a | Context with current prototypes |
-> ROCContext a | Updated context |
Perform clusterization of next part of data
Fine grain API
:: ClusterSpace a | |
=> a | Single point |
-> ROCContext a | Context with current prototypes |
-> ROCContext a | Updated context |
Cluster a single value (step 2-6 in original paper). Moves existing clusters, creates new clusters and merges close clusters.
:: ClusterSpace a | |
=> a | Single point |
-> ROCContext a | Context with current prototypes |
-> ROCContext a | Updated context |
Cluster a single value (step 2 in original paper). This step updates only existing clusters.
:: ClusterSpace a | |
=> ROCContext a | Context with current prototypes |
-> ROCContext a | Updated context |
Merge the most closest clusters (step 4 in original paper).
clusterizeNewPrototype Source #
:: ClusterSpace a | |
=> a | Point |
-> ROCContext a | Context with current prototypes |
-> ROCContext a | Updated context |
Form a new prototype from single point (step 5 in original paper)
clusterizePostprocess Source #
:: ClusterSpace a | |
=> ROCContext a | Context with current prototypes |
-> ROCContext a | Updated context |
Remove clusters that have negligible weights (step 6 in original paper)