Maintainer | hahn@geoinfo.tuwien.ac.at |
---|---|
Stability | beta |
Safe Haskell | None |
Language | Haskell2010 |
This module implements the necessary functions to model a concept influenced by several contexts. The concept is represented by several exemplars. For each influencing context the exemplars have different observation frequency. The connection from exemplars and context is modeled by the data type Experience. Each Experience can be made several times where the amount is hold by a Multiset.
- data Experience c e = Exp c e
- type Concept c e = MultiSet (Experience c e)
- type Probability = Float
- class (Ord c, Ord e, Show c, Show e) => ConceptContextModel c e where
- createConceptForContext :: (Show c, Ord c, Show e, Ord e) => Context c -> [e] -> [Int] -> Concept (Context c) e
- amountExperiences :: Concept (Context c) e -> Int
- unionsConceptsForDiffContexts :: (Ord e, Ord c) => [Concept (Context c) e] -> Concept (Context c) e
- filterConceptWithContext :: (Enumerable c, Enumerable (Context c), Ord e, Eq c, Ord c) => Context c -> Concept (Context c) e -> Concept (Context c) e
- typicalityForExemplarsInContext :: (Ord c, Ord e, Enum e, Bounded e, Enumerable c, Enumerable (Context c)) => Context c -> e -> Concept (Context c) e -> [(e, Probability)]
- typicalExemplarInContext :: (Ord c, Ord e, Enum e, Bounded e, Enumerable c, Enumerable (Context c)) => Context c -> e -> Concept (Context c) e -> (e, Probability)
- printConcept :: (Show e, Show c) => Concept c e -> IO ()
Documentation
data Experience c e Source
Each experience is formed by a exemplar of type e and a context c this exemplar was observed at.
Exp c e | constructor; establishes an experience from a context and an exemplar |
(Eq c, Eq e) => Eq (Experience c e) Source | |
(Ord c, Ord e) => Ord (Experience c e) Source | |
(Show c, Show e) => Show (Experience c e) Source |
type Concept c e = MultiSet (Experience c e) Source
All experiences are hold in a multiset
type Probability = Float Source
type synonym for better readability
class (Ord c, Ord e, Show c, Show e) => ConceptContextModel c e where Source
the class defines the necessary functions needed for the context algebra
Nothing
createConceptForContext Source
:: (Show c, Ord c, Show e, Ord e) | |
=> Context c | context in which the experiences were made |
-> [e] | exemplars which are observed |
-> [Int] | amount of observations for one exemplar in this context |
-> Concept (Context c) e | resulting concept with the given experiences |
combines the observation amount of exemplars for one context
calculates the amount of experiences that are present for the concept
unionsConceptsForDiffContexts Source
:: (Ord e, Ord c) | |
=> [Concept (Context c) e] | list of conceptualizations holding experiences for different contexts |
-> Concept (Context c) e | union of the experiences holding now all experiences for all contexts |
unions the experiences stored for one concept for different contexts
filterConceptWithContext Source
:: (Enumerable c, Enumerable (Context c), Ord e, Eq c, Ord c) | |
=> Context c | context used to filter the experiences |
-> Concept (Context c) e | experiences to filter |
-> Concept (Context c) e | filtered experiences, more finer experiences are returned |
filters a concept for a context, gets a concept for a finer context, the context c has to be more finer than the context that are included in the concept
typicalityForExemplarsInContext Source
:: (Ord c, Ord e, Enum e, Bounded e, Enumerable c, Enumerable (Context c)) | |
=> Context c | context the distribution is made for |
-> e | exemplar type, used as type parameter |
-> Concept (Context c) e | concept with the experiences |
-> [(e, Probability)] | returned distribution |
returns the typicality distribution for each exemplar in the context c, the type e is only used as type parameter
typicalExemplarInContext Source
:: (Ord c, Ord e, Enum e, Bounded e, Enumerable c, Enumerable (Context c)) | |
=> Context c | context the distribution is made for |
-> e | exemplar type, used as type parameter |
-> Concept (Context c) e | concept with the experiences |
-> (e, Probability) | tupel with the highest probability value |
returns the typical exemplar of a concept for the context
converts the experiences of the concept to a IO()