CompStats 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.
Files changed (22) hide show
  1. {compstats-0.1.1 → compstats-0.1.2}/CompStats/__init__.py +1 -1
  2. {compstats-0.1.1 → compstats-0.1.2}/CompStats/bootstrap.py +8 -0
  3. {compstats-0.1.1 → compstats-0.1.2}/CompStats/tests/test_bootstrap.py +15 -2
  4. {compstats-0.1.1 → compstats-0.1.2}/CompStats.egg-info/PKG-INFO +1 -1
  5. {compstats-0.1.1 → compstats-0.1.2}/PKG-INFO +1 -1
  6. {compstats-0.1.1 → compstats-0.1.2}/CompStats/measurements.py +0 -0
  7. {compstats-0.1.1 → compstats-0.1.2}/CompStats/performance.py +0 -0
  8. {compstats-0.1.1 → compstats-0.1.2}/CompStats/tests/__init__.py +0 -0
  9. {compstats-0.1.1 → compstats-0.1.2}/CompStats/tests/data.csv +0 -0
  10. {compstats-0.1.1 → compstats-0.1.2}/CompStats/tests/test_measurements.py +0 -0
  11. {compstats-0.1.1 → compstats-0.1.2}/CompStats/tests/test_performance.py +0 -0
  12. {compstats-0.1.1 → compstats-0.1.2}/CompStats/utils.py +0 -0
  13. {compstats-0.1.1 → compstats-0.1.2}/CompStats.egg-info/SOURCES.txt +0 -0
  14. {compstats-0.1.1 → compstats-0.1.2}/CompStats.egg-info/dependency_links.txt +0 -0
  15. {compstats-0.1.1 → compstats-0.1.2}/CompStats.egg-info/requires.txt +0 -0
  16. {compstats-0.1.1 → compstats-0.1.2}/CompStats.egg-info/top_level.txt +0 -0
  17. {compstats-0.1.1 → compstats-0.1.2}/LICENSE +0 -0
  18. {compstats-0.1.1 → compstats-0.1.2}/MANIFEST.in +0 -0
  19. {compstats-0.1.1 → compstats-0.1.2}/README.rst +0 -0
  20. {compstats-0.1.1 → compstats-0.1.2}/pyproject.toml +0 -0
  21. {compstats-0.1.1 → compstats-0.1.2}/setup.cfg +0 -0
  22. {compstats-0.1.1 → compstats-0.1.2}/setup.py +0 -0
@@ -11,7 +11,7 @@
11
11
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
- __version__ = '0.1.1'
14
+ __version__ = '0.1.2'
15
15
  from CompStats.bootstrap import StatisticSamples
16
16
  from CompStats.measurements import CI, SE, difference_p_value
17
17
  from CompStats.performance import performance, difference, all_differences, plot_performance, plot_difference
@@ -164,6 +164,14 @@ class StatisticSamples:
164
164
  self.calls[name] = self.statistic_samples
165
165
  return self.statistic_samples
166
166
 
167
+ def melt(self, var_name='Algorithm', value_name='Score'):
168
+ """Represent into a long DataFrame"""
169
+ import pandas as pd
170
+
171
+ return pd.DataFrame(self.calls).melt(var_name=var_name,
172
+ value_name=value_name)
173
+
174
+
167
175
 
168
176
  # class CI(StatisticSamples):
169
177
  # """Compute the Confidence Interval of a statistic using bootstrap.
@@ -16,6 +16,7 @@ from CompStats.bootstrap import StatisticSamples
16
16
 
17
17
 
18
18
  def problem_algorithms():
19
+ """Problem and three predictions"""
19
20
  labels = [0, 0, 0, 0, 0,
20
21
  1, 1, 1, 1, 1]
21
22
  a = [0, 0, 0, 0, 0,
@@ -26,8 +27,8 @@ def problem_algorithms():
26
27
  1, 1, 0, 1, 0]
27
28
  return (np.array(labels),
28
29
  dict(a=np.array(a),
29
- b=np.array(b),
30
- c=np.array(c)))
30
+ b=np.array(b),
31
+ c=np.array(c)))
31
32
 
32
33
 
33
34
  def test_StatisticSample():
@@ -52,6 +53,18 @@ def test_StatisticSample_name():
52
53
  assert np.fabs(samples - statistic['first']).sum() == 0
53
54
 
54
55
 
56
+ def test_StatisticSamples_melt():
57
+ """Test StatisticSamples melt"""
58
+ from sklearn.metrics import accuracy_score
59
+ import pandas as pd
60
+ labels, algs = problem_algorithms()
61
+ stats = StatisticSamples(num_samples=15, statistic=accuracy_score)
62
+ for k, v in algs.items():
63
+ stats(labels, v, name=k)
64
+ df = stats.melt()
65
+ assert isinstance(df, pd.DataFrame)
66
+
67
+
55
68
 
56
69
  # def test_CI():
57
70
  # """Test CI"""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: CompStats
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: CompStats implements an evaluation methodology for statistically analyzing competition results and competition
5
5
  Project-URL: Homepage, https://compstats.readthedocs.io
6
6
  Project-URL: Repository, https://github.com/INGEOTEC/CompStats
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: CompStats
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: CompStats implements an evaluation methodology for statistically analyzing competition results and competition
5
5
  Project-URL: Homepage, https://compstats.readthedocs.io
6
6
  Project-URL: Repository, https://github.com/INGEOTEC/CompStats
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes