Skip to content

Commit

Permalink
Merge pull request #32 from gmrukwa/fixup-gap-computation
Browse files Browse the repository at this point in the history
Release v2.3.12
  • Loading branch information
gmrukwa committed Jan 9, 2020
2 parents 92b8427 + d73b474 commit 7664288
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
env:
MAJOR: ${{ 2 }}
MINOR: ${{ 3 }}
FIXUP: ${{ 11 }}
FIXUP: ${{ 12 }}
PACKAGE_INIT_FILE: ${{ 'divik/__init__.py' }}
DOCKER_REPO: ${{ 'gmrukwa/divik' }}
IS_ALPHA: ${{ github.event_name == 'pull_request' }}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ docker pull gmrukwa/divik
To install specific version, you can specify it in the command, e.g.:

```bash
docker pull gmrukwa/divik:2.3.11
docker pull gmrukwa/divik:2.3.12
```

## Python package
Expand All @@ -59,7 +59,7 @@ pip install divik
or any stable tagged version, e.g.:

```bash
pip install divik==2.3.11
pip install divik==2.3.12
```

# References
Expand Down
2 changes: 1 addition & 1 deletion divik/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '2.3.11'
__version__ = '2.3.12'

from ._seeding import seeded
from ._utils import DivikResult
Expand Down
7 changes: 3 additions & 4 deletions divik/_score/_gap.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ def _dispersion(data: Data, kmeans: KMeans) -> float:
if kmeans.normalize_rows:
data = normalize_rows(data)
clusters = pd.DataFrame(data).groupby(kmeans.labels_)
return float(np.sum([
np.sum(dist.cdist(kmeans.cluster_centers_[np.newaxis, label],
cluster_members.values, kmeans.distance))
for label, cluster_members in clusters
return float(np.mean([
np.mean(dist.pdist(cluster_members.values, kmeans.distance))
for _, cluster_members in clusters
]))


Expand Down
1 change: 0 additions & 1 deletion divik/_score/_sampled_gap.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def sampled_gap(data: Data, kmeans: KMeans,
return_deviation: bool = False,
max_iter: int = 10) -> float:
# TODO: Docs
# TODO: Tests
data_ = StratifiedSampler(n_rows=sample_size, n_samples=n_trials
).fit(data, kmeans.labels_)
reference_ = UniformSampler(n_rows=sample_size, n_samples=n_trials
Expand Down
4 changes: 2 additions & 2 deletions docs/instructions/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To install latest stable version use::

To install specific version, you can specify it in the command, e.g.::

docker pull gmrukwa/divik:2.3.11
docker pull gmrukwa/divik:2.3.12

Python package
--------------
Expand All @@ -31,4 +31,4 @@ package::

or any stable tagged version, e.g.::

pip install divik==2.3.11
pip install divik==2.3.12

0 comments on commit 7664288

Please sign in to comment.