Skip to content

Commit

Permalink
Move imports fix some stuff and add to CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Semmler committed Sep 23, 2023
1 parent 9dfc3fd commit 512a256
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ randomness.
`compute_beta_shapley_semivalues`, `compute_shapley_semivalues` and
`compute_generic_semivalues`.
[PR #428](https://github.com/aai-institute/pyDVL/pull/428)
- Added classwise Shapley as proposed by (Schoch et al. 2021)
[https://arxiv.org/abs/2211.06800]
[PR #338](https://github.com/aai-institute/pyDVL/pull/338)

### Changed

Expand Down
13 changes: 2 additions & 11 deletions src/pydvl/utils/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
"""
from __future__ import annotations

import logging
import os
import random
import time
from itertools import chain, combinations
from typing import (
Collection,
Expand All @@ -17,8 +13,6 @@
Optional,
Tuple,
TypeVar,
Union,
cast,
overload,
)

Expand All @@ -39,10 +33,6 @@
"top_k_value_accuracy",
]


logger = logging.getLogger(__name__)


T = TypeVar("T", bound=np.generic)


Expand Down Expand Up @@ -184,7 +174,8 @@ def random_powerset_label_min(

if min_elements_per_label < 0:
raise ValueError(
f"Parameter min_elements={min_elements_per_label} needs to be bigger or equal to 0."
f"Parameter min_elements={min_elements_per_label} needs to be bigger or "
f"equal to 0."
)

rng = np.random.default_rng(seed)
Expand Down
10 changes: 6 additions & 4 deletions src/pydvl/value/shapley/classwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,19 @@
from numpy.typing import NDArray
from tqdm import tqdm

from pydvl.parallel import (
ParallelConfig,
effective_n_jobs,
init_executor,
init_parallel_backend,
)
from pydvl.utils import (
Dataset,
ParallelConfig,
Scorer,
Seed,
SupervisedModel,
Utility,
effective_n_jobs,
ensure_seed_sequence,
init_executor,
init_parallel_backend,
random_powerset_label_min,
)
from pydvl.value.result import ValuationResult
Expand Down

0 comments on commit 512a256

Please sign in to comment.