sliceline 0.2.14__py3-none-any.whl → 0.2.15__py3-none-any.whl
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.
- sliceline/slicefinder.py +17 -4
- {sliceline-0.2.14.dist-info → sliceline-0.2.15.dist-info}/METADATA +2 -2
- sliceline-0.2.15.dist-info/RECORD +7 -0
- sliceline-0.2.14.dist-info/RECORD +0 -7
- {sliceline-0.2.14.dist-info → sliceline-0.2.15.dist-info}/LICENSE +0 -0
- {sliceline-0.2.14.dist-info → sliceline-0.2.15.dist-info}/WHEEL +0 -0
sliceline/slicefinder.py
CHANGED
|
@@ -378,7 +378,11 @@ class Slicefinder(BaseEstimator, TransformerMixin):
|
|
|
378
378
|
slice_candidates = x_encoded @ slices.T == level
|
|
379
379
|
slice_sizes = slice_candidates.sum(axis=0).A[0]
|
|
380
380
|
slice_errors = errors @ slice_candidates
|
|
381
|
-
|
|
381
|
+
# Here we can't use the .A shorthand because it is not
|
|
382
|
+
# implemented in all scipy versions for coo_matrix objects
|
|
383
|
+
max_slice_errors = (
|
|
384
|
+
slice_candidates.T.multiply(errors).max(axis=1).toarray()
|
|
385
|
+
)
|
|
382
386
|
|
|
383
387
|
# score of relative error and relative size
|
|
384
388
|
slice_scores = self._score(
|
|
@@ -397,7 +401,11 @@ class Slicefinder(BaseEstimator, TransformerMixin):
|
|
|
397
401
|
"""Initialise 1-slices, i.e. slices with one predicate."""
|
|
398
402
|
slice_sizes = x_encoded.sum(axis=0).A[0]
|
|
399
403
|
slice_errors = errors @ x_encoded
|
|
400
|
-
|
|
404
|
+
# Here we can't use the .A shorthand because it is not
|
|
405
|
+
# implemented in all scipy versions for coo_matrix objects
|
|
406
|
+
max_slice_errors = (
|
|
407
|
+
x_encoded.T.multiply(errors).max(axis=1).toarray()[:, 0]
|
|
408
|
+
)
|
|
401
409
|
|
|
402
410
|
# working set of active slices (#attr x #slices) and top-k
|
|
403
411
|
valid_slices_mask = (slice_sizes >= self.min_sup) & (slice_errors > 0)
|
|
@@ -440,7 +448,9 @@ class Slicefinder(BaseEstimator, TransformerMixin):
|
|
|
440
448
|
) -> np.ndarray:
|
|
441
449
|
"""Join compatible slices according to `level`."""
|
|
442
450
|
slices_int = slices.astype(int)
|
|
443
|
-
|
|
451
|
+
# Here we can't use the .A shorthand because it is not
|
|
452
|
+
# implemented in all scipy versions for coo_matrix objects
|
|
453
|
+
join = (slices_int @ slices_int.T).toarray() == level - 2
|
|
444
454
|
return np.triu(join, 1) * join
|
|
445
455
|
|
|
446
456
|
@staticmethod
|
|
@@ -503,7 +513,10 @@ class Slicefinder(BaseEstimator, TransformerMixin):
|
|
|
503
513
|
sub_pair_candidates = pair_candidates[:, start:end]
|
|
504
514
|
# sub_p should not contain multiple True on the same line
|
|
505
515
|
i = sub_pair_candidates.argmax(axis=1).T + np.any(
|
|
506
|
-
|
|
516
|
+
# Here we can't use the .A shorthand because it is not
|
|
517
|
+
# implemented in all scipy versions for coo_matrix objects
|
|
518
|
+
sub_pair_candidates.toarray(),
|
|
519
|
+
axis=1,
|
|
507
520
|
)
|
|
508
521
|
ids = ids + i.A * np.prod(dom[(j + 1) : dom.shape[0]])
|
|
509
522
|
return ids
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sliceline
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.15
|
|
4
4
|
Summary: ✂️ Fast slice finding for Machine Learning model debugging.
|
|
5
5
|
Home-page: https://github.com/DataDome/sliceline
|
|
6
6
|
License: BSD-3-Clause
|
|
@@ -61,7 +61,7 @@ for a more thorough tutorial:
|
|
|
61
61
|
🛠 Installation
|
|
62
62
|
---------------
|
|
63
63
|
|
|
64
|
-
Sliceline is intended to work with **Python 3.
|
|
64
|
+
Sliceline is intended to work with **Python 3.9 or above**. Installation
|
|
65
65
|
can be done with ``pip``:
|
|
66
66
|
|
|
67
67
|
.. code:: sh
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
sliceline/__init__.py,sha256=jEIUmQtv4W_eZuH63KQ8tAFoRZxyN3O8bRZ__FlMJr0,65
|
|
2
|
+
sliceline/slicefinder.py,sha256=eC_WiVVxoUh1idFfqG23J1VRYbpWNn8brULzLXcrT-A,26388
|
|
3
|
+
sliceline/validation.py,sha256=-RkCpRdANNeaJyrdj7zFn4xs1X1xIXitKwRoL_B5EAk,30794
|
|
4
|
+
sliceline-0.2.15.dist-info/LICENSE,sha256=AbeN2ySrCt8VUJukqcQIYutROwZh3W2u0UU1d7EnbZs,1531
|
|
5
|
+
sliceline-0.2.15.dist-info/METADATA,sha256=G5uG6UOyzFg-jkuzzx-zQhdNX9-GLkhx158V6Sg1lSA,3715
|
|
6
|
+
sliceline-0.2.15.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
7
|
+
sliceline-0.2.15.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
sliceline/__init__.py,sha256=jEIUmQtv4W_eZuH63KQ8tAFoRZxyN3O8bRZ__FlMJr0,65
|
|
2
|
-
sliceline/slicefinder.py,sha256=1uEuR9ehu0Zu1hi8aYp7ZhdpeDQrZ1BVTN4duPibPjk,25755
|
|
3
|
-
sliceline/validation.py,sha256=-RkCpRdANNeaJyrdj7zFn4xs1X1xIXitKwRoL_B5EAk,30794
|
|
4
|
-
sliceline-0.2.14.dist-info/LICENSE,sha256=AbeN2ySrCt8VUJukqcQIYutROwZh3W2u0UU1d7EnbZs,1531
|
|
5
|
-
sliceline-0.2.14.dist-info/METADATA,sha256=dJXRmNFhQRyyWwfSpbkFJwyYjFBjHcgDidvnXnxkLKc,3715
|
|
6
|
-
sliceline-0.2.14.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
7
|
-
sliceline-0.2.14.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|