Skip to content

Commit 5341bd9

Browse files
authored
Merge pull request #23 from INGEOTEC/develop
Version - 0.1.9
2 parents 47b7ce5 + caa3a21 commit 5341bd9

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

CompStats/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
__version__ = '0.1.8'
14+
__version__ = '0.1.9'
1515
from CompStats.bootstrap import StatisticSamples
1616
from CompStats.measurements import CI, SE, difference_p_value
1717
from CompStats.performance import performance, difference, all_differences, plot_performance, plot_difference

CompStats/interface.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,8 @@ def dataframe(self, value_name:str='Score',
606606
alg_legend:str='Algorithm',
607607
sig_legend:str='Significant',
608608
perf_names:str=None,
609-
CI:float=0.05):
609+
right:bool=True,
610+
alpha:float=0.05):
610611
"""Dataframe"""
611612
if perf_names is None and isinstance(self.best, np.ndarray):
612613
perf_names = [f'{alg}({k})'
@@ -617,18 +618,18 @@ def dataframe(self, value_name:str='Score',
617618
perf_names=perf_names)
618619
df[sig_legend] = False
619620
if isinstance(self.best, str):
620-
for name, p in self.p_value().items():
621-
if p >= CI:
621+
for name, p in self.p_value(right=right).items():
622+
if p >= alpha:
622623
continue
623624
df.loc[df[alg_legend] == name, sig_legend] = True
624625
else:
625-
p_values = self.p_value()
626+
p_values = self.p_value(right=right)
626627
systems = list(p_values.keys())
627628
p_values = np.array([p_values[k] for k in systems])
628629
for name, p_value in zip(perf_names, p_values.T):
629630
mask = df[var_name] == name
630631
for alg, p in zip(systems, p_value):
631-
if p >= CI:
632+
if p >= alpha:
632633
continue
633634
_ = mask & (df[alg_legend] == alg)
634635
df.loc[_, sig_legend] = True
@@ -639,7 +640,8 @@ def plot(self, value_name:str='Difference',
639640
alg_legend:str='Algorithm',
640641
sig_legend:str='Significant',
641642
perf_names:list=None,
642-
CI:float=0.05,
643+
alpha:float=0.05,
644+
right:bool=True,
643645
kind:str='point', linestyle:str='none',
644646
col_wrap:int=3, capsize:float=0.2,
645647
set_refline:bool=True,
@@ -668,12 +670,12 @@ def plot(self, value_name:str='Difference',
668670
alg_legend=alg_legend,
669671
sig_legend=sig_legend,
670672
perf_names=perf_names,
671-
CI=CI)
672-
title = var_name
673+
alpha=alpha, right=right)
674+
title = var_name
673675
if var_name not in df.columns:
674676
var_name = None
675677
col_wrap = None
676-
ci = lambda x: measurements.CI(x, alpha=CI)
678+
ci = lambda x: measurements.CI(x, alpha=2*alpha)
677679
f_grid = sns.catplot(df, x=value_name, errorbar=ci,
678680
y=alg_legend, col=var_name,
679681
kind=kind, linestyle=linestyle,

0 commit comments

Comments
 (0)