Skip to content

Commit

Permalink
Fixed Error in analysis Namespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikNordmeyer committed Sep 11, 2024
1 parent 8d96096 commit 4d0318a
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 45 deletions.
2 changes: 1 addition & 1 deletion src/main/clojure/conexp/analysis.clj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
[random-contexts :refer :all]
[simplicial-complexes :refer :all]
[triadic-exploration :refer :all]
[matrix-factorizations]]
[matrix-factorizations :refer :all]]
[conexp.math
[algebra :refer :all]
[markov :refer :all]
Expand Down
4 changes: 2 additions & 2 deletions src/main/clojure/conexp/fca/matrix_factorizations.clj
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
(defprotocol context-factorization-record
(object-factor-context [this] "Returns the formal context representing the object-factor relation.")
(factor-attribute-context [this] "Returns the formal context representing the factor-attribute relation.")
(context [this] "Returns the boolean matrix product of the above contexts."))
(product-context [this] "Returns the boolean matrix product of the above contexts."))

(defrecord context-factorization [obj-fac-ctx fac-attr-ctx]
context-factorization-record
(object-factor-context [this] obj-fac-ctx)
(factor-attribute-context [this] fac-attr-ctx)
(context [this] (factor-context-product obj-fac-ctx fac-attr-ctx))
(product-context [this] (factor-context-product obj-fac-ctx fac-attr-ctx))
)


Expand Down
84 changes: 42 additions & 42 deletions src/test/clojure/conexp/fca/matrix_factorization_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
(def fac2 (hyper water 0.5))
(def fac3 (hyper wood 0.3))

(is (= (overcoverage forum (context fac1)) 0))
(is (= (undercoverage forum (context fac1)) 0))
(is (= (overcoverage forum (product-context fac1)) 0))
(is (= (undercoverage forum (product-context fac1)) 0))

(is (= (overcoverage water (context fac2)) 0))
(is (= (undercoverage water (context fac2)) 0))
(is (= (overcoverage water (product-context fac2)) 0))
(is (= (undercoverage water (product-context fac2)) 0))

(is (= (overcoverage wood (context fac3)) 0))
(is (= (undercoverage wood (context fac3)) 0))
(is (= (overcoverage wood (product-context fac3)) 0))
(is (= (undercoverage wood (product-context fac3)) 0))

)

Expand All @@ -45,14 +45,14 @@
(def fac2 (topFiberM water 5 0.7 5))
(def fac3 (topFiberM wood 3 0.5 5))

(is (= (overcoverage forum (context fac1)) 0))
(is (= (undercoverage forum (context fac1)) 21))
(is (= (overcoverage forum (product-context fac1)) 0))
(is (= (undercoverage forum (product-context fac1)) 21))

(is (= (overcoverage water (context fac2)) 0))
(is (= (undercoverage water (context fac2)) 10))
(is (= (overcoverage water (product-context fac2)) 0))
(is (= (undercoverage water (product-context fac2)) 10))

(is (= (overcoverage wood (context fac3)) 5))
(is (= (undercoverage wood (context fac3)) 192))
(is (= (overcoverage wood (product-context fac3)) 5))
(is (= (undercoverage wood (product-context fac3)) 192))

)

Expand All @@ -63,14 +63,14 @@
(def fac2 (PaNDa water 5))
(def fac3 (PaNDa wood 8))

(is (= (overcoverage forum (context fac1)) 4))
(is (= (undercoverage forum (context fac1)) 11))
(is (= (overcoverage forum (product-context fac1)) 4))
(is (= (undercoverage forum (product-context fac1)) 11))

(is (= (overcoverage water (context fac2)) 4))
(is (= (undercoverage water (context fac2)) 2))
(is (= (overcoverage water (product-context fac2)) 4))
(is (= (undercoverage water (product-context fac2)) 2))

(is (= (overcoverage wood (context fac3)) 31))
(is (= (undercoverage wood (context fac3)) 79))
(is (= (overcoverage wood (product-context fac3)) 31))
(is (= (undercoverage wood (product-context fac3)) 79))

)

Expand All @@ -81,14 +81,14 @@
(def fac2 (tiling water 8))
(def fac3 (tiling wood 15))

(is (= (overcoverage forum (context fac1)) 0))
(is (= (undercoverage forum (context fac1)) 6))
(is (= (overcoverage forum (product-context fac1)) 0))
(is (= (undercoverage forum (product-context fac1)) 6))

(is (= (overcoverage water (context fac2)) 0))
(is (= (undercoverage water (context fac2)) 0))
(is (= (overcoverage water (product-context fac2)) 0))
(is (= (undercoverage water (product-context fac2)) 0))

(is (= (overcoverage wood (context fac3)) 0))
(is (= (undercoverage wood (context fac3)) 51))
(is (= (overcoverage wood (product-context fac3)) 0))
(is (= (undercoverage wood (product-context fac3)) 51))

)

Expand All @@ -99,14 +99,14 @@
(def fac2 (grecond water))
(def fac3 (grecond wood))

(is (= (overcoverage forum (context fac1)) 0))
(is (= (undercoverage forum (context fac1)) 0))
(is (= (overcoverage forum (product-context fac1)) 0))
(is (= (undercoverage forum (product-context fac1)) 0))

(is (= (overcoverage water (context fac2)) 0))
(is (= (undercoverage water (context fac2)) 0))
(is (= (overcoverage water (product-context fac2)) 0))
(is (= (undercoverage water (product-context fac2)) 0))

(is (= (overcoverage wood (context fac3)) 0))
(is (= (undercoverage wood (context fac3)) 0))
(is (= (overcoverage wood (product-context fac3)) 0))
(is (= (undercoverage wood (product-context fac3)) 0))

)

Expand All @@ -117,14 +117,14 @@
(def fac2 (GreEss water 0))
(def fac3 (GreEss wood 20))

(is (= (overcoverage forum (context fac1)) 0))
(is (<= (undercoverage forum (context fac1)) 5))
(is (= (overcoverage forum (product-context fac1)) 0))
(is (<= (undercoverage forum (product-context fac1)) 5))

(is (= (overcoverage water (context fac2)) 0))
(is (<= (undercoverage water (context fac2)) 0))
(is (= (overcoverage water (product-context fac2)) 0))
(is (<= (undercoverage water (product-context fac2)) 0))

(is (= (overcoverage wood (context fac3)) 0))
(is (<= (undercoverage wood (context fac3)) 20))
(is (= (overcoverage wood (product-context fac3)) 0))
(is (<= (undercoverage wood (product-context fac3)) 20))

)

Expand All @@ -135,13 +135,13 @@
(def fac2 (ASSO water 5 0.7 1 1))
(def fac3 (ASSO wood 3 0.7 1 1))

(is (= (overcoverage forum (context fac1)) 4))
(is (<= (undercoverage forum (context fac1)) 8))
(is (= (overcoverage forum (product-context fac1)) 4))
(is (<= (undercoverage forum (product-context fac1)) 8))

(is (= (overcoverage water (context fac2)) 4))
(is (<= (undercoverage water (context fac2)) 1))
(is (= (overcoverage water (product-context fac2)) 4))
(is (<= (undercoverage water (product-context fac2)) 1))

(is (= (overcoverage wood (context fac3)) 24))
(is (<= (undercoverage wood (context fac3)) 128))
(is (= (overcoverage wood (product-context fac3)) 24))
(is (<= (undercoverage wood (product-context fac3)) 128))

)

0 comments on commit 4d0318a

Please sign in to comment.