iita-python 1.4.2__tar.gz → 1.4.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {iita_python-1.4.2 → iita_python-1.4.4}/.gitignore +2 -1
- {iita_python-1.4.2/iita_python.egg-info → iita_python-1.4.4}/PKG-INFO +1 -1
- {iita_python-1.4.2 → iita_python-1.4.4}/iita_python/_version.py +3 -3
- {iita_python-1.4.2 → iita_python-1.4.4}/iita_python/fit_metrics.py +6 -4
- {iita_python-1.4.2 → iita_python-1.4.4}/iita_python/quasiorder.py +13 -2
- {iita_python-1.4.2 → iita_python-1.4.4/iita_python.egg-info}/PKG-INFO +1 -1
- {iita_python-1.4.2 → iita_python-1.4.4}/iita_python.egg-info/SOURCES.txt +2 -0
- iita_python-1.4.4/iita_python.egg-info/scm_file_list.json +16 -0
- iita_python-1.4.4/iita_python.egg-info/scm_version.json +8 -0
- {iita_python-1.4.2 → iita_python-1.4.4}/.github/workflows/release.yaml +0 -0
- {iita_python-1.4.2 → iita_python-1.4.4}/README.md +0 -0
- {iita_python-1.4.2 → iita_python-1.4.4}/iita_python/__init__.py +0 -0
- {iita_python-1.4.2 → iita_python-1.4.4}/iita_python/additional_ce.py +0 -0
- {iita_python-1.4.2 → iita_python-1.4.4}/iita_python/dataset.py +0 -0
- {iita_python-1.4.2 → iita_python-1.4.4}/iita_python/utils.py +0 -0
- {iita_python-1.4.2 → iita_python-1.4.4}/iita_python.egg-info/dependency_links.txt +0 -0
- {iita_python-1.4.2 → iita_python-1.4.4}/iita_python.egg-info/requires.txt +0 -0
- {iita_python-1.4.2 → iita_python-1.4.4}/iita_python.egg-info/top_level.txt +0 -0
- {iita_python-1.4.2 → iita_python-1.4.4}/pyproject.toml +0 -0
- {iita_python-1.4.2 → iita_python-1.4.4}/setuf.cfg +0 -0
- {iita_python-1.4.2 → iita_python-1.4.4}/setup.cfg +0 -0
- {iita_python-1.4.2 → iita_python-1.4.4}/setup.py +0 -0
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '1.4.
|
|
22
|
-
__version_tuple__ = version_tuple = (1, 4,
|
|
21
|
+
__version__ = version = '1.4.4'
|
|
22
|
+
__version_tuple__ = version_tuple = (1, 4, 4)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g2692f8c6e'
|
|
@@ -30,8 +30,8 @@ def orig_iita_fit(data: Dataset, qo: QuasiOrder):
|
|
|
30
30
|
|
|
31
31
|
ce = data.ce.to_numpy().flatten()
|
|
32
32
|
expected_ce = expected_ce.flatten()
|
|
33
|
-
|
|
34
|
-
return (
|
|
33
|
+
mean_squared_error = ((ce - expected_ce) ** 2).sum() / (data.items**2 - data.items)
|
|
34
|
+
return (mean_squared_error, error)
|
|
35
35
|
|
|
36
36
|
def corr_iita_fit(data: Dataset, qo: QuasiOrder):
|
|
37
37
|
"""
|
|
@@ -61,7 +61,8 @@ def corr_iita_fit(data: Dataset, qo: QuasiOrder):
|
|
|
61
61
|
|
|
62
62
|
ce = data.ce.to_numpy().flatten()
|
|
63
63
|
expected_ce = expected_ce.flatten()
|
|
64
|
-
|
|
64
|
+
mean_squared_error = ((ce - expected_ce) ** 2).sum() / (data.items**2 - data.items)
|
|
65
|
+
return (mean_squared_error, error)
|
|
65
66
|
|
|
66
67
|
def mini_iita_fit(data: Dataset, qo: QuasiOrder):
|
|
67
68
|
"""
|
|
@@ -100,4 +101,5 @@ def mini_iita_fit(data: Dataset, qo: QuasiOrder):
|
|
|
100
101
|
|
|
101
102
|
ce = data.ce.to_numpy().flatten()
|
|
102
103
|
expected_ce = expected_ce.flatten()
|
|
103
|
-
|
|
104
|
+
mean_squared_error = ((ce - expected_ce) ** 2).sum() / (data.items**2 - data.items)
|
|
105
|
+
return (mean_squared_error, error)
|
|
@@ -3,8 +3,12 @@ import numpy.typing as npt
|
|
|
3
3
|
import pandas as pd
|
|
4
4
|
|
|
5
5
|
class QuasiOrder:
|
|
6
|
-
|
|
6
|
+
knowledge_space = None
|
|
7
|
+
full_matrix: np.ndarray
|
|
8
|
+
|
|
9
|
+
def __init__(self, matrix: np.ndarray, knowledge_space: np.ndarray|None = None):
|
|
7
10
|
self.full_matrix = matrix
|
|
11
|
+
self.knowledge_space = knowledge_space if knowledge_space is not None else self.get_knowledge_space()
|
|
8
12
|
|
|
9
13
|
def get_edge_list(self, buff=0):
|
|
10
14
|
"""
|
|
@@ -22,13 +26,16 @@ class QuasiOrder:
|
|
|
22
26
|
|
|
23
27
|
return edge_list
|
|
24
28
|
|
|
25
|
-
def get_knowledge_space(self):
|
|
29
|
+
def get_knowledge_space(self, override: bool = False) -> npt.NDArray[np.int_]:
|
|
26
30
|
"""
|
|
27
31
|
Returns the knowledge space described by the quasiorder as a numpy matrix\n
|
|
28
32
|
In the output matrix, the rows represent the elements of the knowledge space,
|
|
29
33
|
and the columns represent the items. An entry is 1 if the item is in the knowledge state, and 0 otherwise.
|
|
30
34
|
"""
|
|
31
35
|
|
|
36
|
+
if (self.knowledge_space is not None and not override):
|
|
37
|
+
return self.knowledge_space
|
|
38
|
+
|
|
32
39
|
n = self.full_matrix.shape[0]
|
|
33
40
|
|
|
34
41
|
bits = 1 << np.arange(n, dtype=object)
|
|
@@ -50,6 +57,10 @@ class QuasiOrder:
|
|
|
50
57
|
|
|
51
58
|
masks = np.array(sorted(knowledge_space_set), dtype=object)
|
|
52
59
|
knowledge_space_matrix = ((masks[:, None] & bits) != 0).astype(np.int_)
|
|
60
|
+
|
|
61
|
+
if (self.knowledge_space is None or override):
|
|
62
|
+
self.knowledge_space = knowledge_space_matrix
|
|
63
|
+
|
|
53
64
|
return knowledge_space_matrix
|
|
54
65
|
|
|
55
66
|
def ind_gen(counterexamples: pd.DataFrame) -> list[QuasiOrder]:
|
|
@@ -15,4 +15,6 @@ iita_python.egg-info/PKG-INFO
|
|
|
15
15
|
iita_python.egg-info/SOURCES.txt
|
|
16
16
|
iita_python.egg-info/dependency_links.txt
|
|
17
17
|
iita_python.egg-info/requires.txt
|
|
18
|
+
iita_python.egg-info/scm_file_list.json
|
|
19
|
+
iita_python.egg-info/scm_version.json
|
|
18
20
|
iita_python.egg-info/top_level.txt
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files": [
|
|
3
|
+
".github/workflows/release.yaml",
|
|
4
|
+
".gitignore",
|
|
5
|
+
"README.md",
|
|
6
|
+
"iita_python/__init__.py",
|
|
7
|
+
"iita_python/additional_ce.py",
|
|
8
|
+
"iita_python/dataset.py",
|
|
9
|
+
"iita_python/fit_metrics.py",
|
|
10
|
+
"iita_python/quasiorder.py",
|
|
11
|
+
"iita_python/utils.py",
|
|
12
|
+
"pyproject.toml",
|
|
13
|
+
"setuf.cfg",
|
|
14
|
+
"setup.py"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|