tmplot 0.1.1__tar.gz → 0.1.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tmplot
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Visualization of Topic Modeling Results
5
5
  Author-email: Maksim Terpilovskii <maximtrp@gmail.com>
6
6
  License: MIT License
@@ -50,7 +50,6 @@ Requires-Dist: ipywidgets
50
50
  Requires-Dist: tqdm
51
51
  Provides-Extra: test
52
52
  Requires-Dist: pytest; extra == "test"
53
- Requires-Dist: codecov; extra == "test"
54
53
  Requires-Dist: coverage; extra == "test"
55
54
  Provides-Extra: models
56
55
  Requires-Dist: tomotopy>=0.8.0; extra == "models"
@@ -59,7 +58,8 @@ Requires-Dist: bitermplus; extra == "models"
59
58
 
60
59
  # tmplot
61
60
 
62
- [![Codecov](https://img.shields.io/codecov/c/gh/maximtrp/tmplot?token=APKBRPDKXS&label=coverage)](https://codecov.io/gh/maximtrp/tmplot)
61
+ [![Codacy coverage](https://img.shields.io/codacy/coverage/5939b1cf99bc4f9d91de11c0d3ff9e50)](https://app.codacy.com/gh/maximtrp/tmplot/coverage)
62
+ [![Codacy grade](https://img.shields.io/codacy/grade/5939b1cf99bc4f9d91de11c0d3ff9e50)](https://app.codacy.com/gh/maximtrp/tmplot)
63
63
  [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/maximtrp/tmplot/python-package.yml?label=tests)](https://github.com/maximtrp/tmplot/actions/workflows/python-package.yml)
64
64
  [![Documentation Status](https://readthedocs.org/projects/tmplot/badge/?version=latest)](https://tmplot.readthedocs.io/en/latest/?badge=latest)
65
65
  [![Downloads](https://static.pepy.tech/badge/tmplot)](https://pepy.tech/project/tmplot)
@@ -1,6 +1,7 @@
1
1
  # tmplot
2
2
 
3
- [![Codecov](https://img.shields.io/codecov/c/gh/maximtrp/tmplot?token=APKBRPDKXS&label=coverage)](https://codecov.io/gh/maximtrp/tmplot)
3
+ [![Codacy coverage](https://img.shields.io/codacy/coverage/5939b1cf99bc4f9d91de11c0d3ff9e50)](https://app.codacy.com/gh/maximtrp/tmplot/coverage)
4
+ [![Codacy grade](https://img.shields.io/codacy/grade/5939b1cf99bc4f9d91de11c0d3ff9e50)](https://app.codacy.com/gh/maximtrp/tmplot)
4
5
  [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/maximtrp/tmplot/python-package.yml?label=tests)](https://github.com/maximtrp/tmplot/actions/workflows/python-package.yml)
5
6
  [![Documentation Status](https://readthedocs.org/projects/tmplot/badge/?version=latest)](https://tmplot.readthedocs.io/en/latest/?badge=latest)
6
7
  [![Downloads](https://static.pepy.tech/badge/tmplot)](https://pepy.tech/project/tmplot)
@@ -42,7 +42,7 @@ dependencies = [
42
42
  ]
43
43
 
44
44
  [project.optional-dependencies]
45
- test = ["pytest", "codecov", "coverage"]
45
+ test = ["pytest", "coverage"]
46
46
  models = ["tomotopy>=0.8.0", "gensim", "bitermplus"]
47
47
 
48
48
  [tool.setuptools.dynamic]
@@ -5,4 +5,4 @@ from ._stability import * # noqa: F401, F403
5
5
  from ._vis import * # noqa: F401, F403
6
6
  from ._metrics import * # noqa: F401, F403
7
7
 
8
- __version__ = '0.1.1'
8
+ __version__ = '0.1.2'
@@ -10,6 +10,7 @@ from typing import Union, Optional, Sequence, List
10
10
  from functools import partial
11
11
  from math import log
12
12
  from numpy import ndarray, zeros, argsort, array, arange, vstack
13
+ from numpy import log as nplog
13
14
  from pandas import concat, Series, DataFrame
14
15
 
15
16
  tomotopy_installed = find_spec('tomotopy')
@@ -367,7 +368,7 @@ def calc_terms_probs_ratio(
367
368
  pandas.DataFrame
368
369
  Words conditional and marginal probabilities.
369
370
  """
370
- p_cond_name = 'Conditional term probability, p(w|t)'
371
+ p_cond_name = 'Conditional term probability, p(w | t)'
371
372
  p_cond = phi.iloc[:, topic]\
372
373
  .rename(p_cond_name)\
373
374
  if isinstance(phi, DataFrame)\
@@ -424,7 +425,8 @@ def get_relevant_terms(
424
425
  phi_topic = phi.iloc[:, topic]\
425
426
  if isinstance(phi, DataFrame)\
426
427
  else phi[:, topic]
427
- # relevance = lambda * p(w | t) + (1 - lambda) * p(w | t)/p(w)
428
- relevance = lambda_ * phi_topic\
429
- + (1 - lambda_) * phi_topic / phi.sum(axis=1)
428
+
429
+ # relevance = lambda * log(p(w | t)) + (1 - lambda) * log(p(w | t) / p(w))
430
+ relevance = lambda_ * nplog(phi_topic)\
431
+ + (1 - lambda_) * nplog(phi_topic / phi.sum(axis=1))
430
432
  return relevance.sort_values(ascending=False)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tmplot
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Visualization of Topic Modeling Results
5
5
  Author-email: Maksim Terpilovskii <maximtrp@gmail.com>
6
6
  License: MIT License
@@ -50,7 +50,6 @@ Requires-Dist: ipywidgets
50
50
  Requires-Dist: tqdm
51
51
  Provides-Extra: test
52
52
  Requires-Dist: pytest; extra == "test"
53
- Requires-Dist: codecov; extra == "test"
54
53
  Requires-Dist: coverage; extra == "test"
55
54
  Provides-Extra: models
56
55
  Requires-Dist: tomotopy>=0.8.0; extra == "models"
@@ -59,7 +58,8 @@ Requires-Dist: bitermplus; extra == "models"
59
58
 
60
59
  # tmplot
61
60
 
62
- [![Codecov](https://img.shields.io/codecov/c/gh/maximtrp/tmplot?token=APKBRPDKXS&label=coverage)](https://codecov.io/gh/maximtrp/tmplot)
61
+ [![Codacy coverage](https://img.shields.io/codacy/coverage/5939b1cf99bc4f9d91de11c0d3ff9e50)](https://app.codacy.com/gh/maximtrp/tmplot/coverage)
62
+ [![Codacy grade](https://img.shields.io/codacy/grade/5939b1cf99bc4f9d91de11c0d3ff9e50)](https://app.codacy.com/gh/maximtrp/tmplot)
63
63
  [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/maximtrp/tmplot/python-package.yml?label=tests)](https://github.com/maximtrp/tmplot/actions/workflows/python-package.yml)
64
64
  [![Documentation Status](https://readthedocs.org/projects/tmplot/badge/?version=latest)](https://tmplot.readthedocs.io/en/latest/?badge=latest)
65
65
  [![Downloads](https://static.pepy.tech/badge/tmplot)](https://pepy.tech/project/tmplot)
@@ -14,5 +14,4 @@ bitermplus
14
14
 
15
15
  [test]
16
16
  pytest
17
- codecov
18
17
  coverage
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes