Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CompStats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = '0.1.8'
__version__ = '0.1.9'
from CompStats.bootstrap import StatisticSamples
from CompStats.measurements import CI, SE, difference_p_value
from CompStats.performance import performance, difference, all_differences, plot_performance, plot_difference
Expand Down
20 changes: 11 additions & 9 deletions CompStats/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,8 @@ def dataframe(self, value_name:str='Score',
alg_legend:str='Algorithm',
sig_legend:str='Significant',
perf_names:str=None,
CI:float=0.05):
right:bool=True,
alpha:float=0.05):
"""Dataframe"""
if perf_names is None and isinstance(self.best, np.ndarray):
perf_names = [f'{alg}({k})'
Expand All @@ -617,18 +618,18 @@ def dataframe(self, value_name:str='Score',
perf_names=perf_names)
df[sig_legend] = False
if isinstance(self.best, str):
for name, p in self.p_value().items():
if p >= CI:
for name, p in self.p_value(right=right).items():
if p >= alpha:
continue
df.loc[df[alg_legend] == name, sig_legend] = True
else:
p_values = self.p_value()
p_values = self.p_value(right=right)
systems = list(p_values.keys())
p_values = np.array([p_values[k] for k in systems])
for name, p_value in zip(perf_names, p_values.T):
mask = df[var_name] == name
for alg, p in zip(systems, p_value):
if p >= CI:
if p >= alpha:
continue
_ = mask & (df[alg_legend] == alg)
df.loc[_, sig_legend] = True
Expand All @@ -639,7 +640,8 @@ def plot(self, value_name:str='Difference',
alg_legend:str='Algorithm',
sig_legend:str='Significant',
perf_names:list=None,
CI:float=0.05,
alpha:float=0.05,
right:bool=True,
kind:str='point', linestyle:str='none',
col_wrap:int=3, capsize:float=0.2,
set_refline:bool=True,
Expand Down Expand Up @@ -668,12 +670,12 @@ def plot(self, value_name:str='Difference',
alg_legend=alg_legend,
sig_legend=sig_legend,
perf_names=perf_names,
CI=CI)
title = var_name
alpha=alpha, right=right)
title = var_name
if var_name not in df.columns:
var_name = None
col_wrap = None
ci = lambda x: measurements.CI(x, alpha=CI)
ci = lambda x: measurements.CI(x, alpha=2*alpha)
f_grid = sns.catplot(df, x=value_name, errorbar=ci,
y=alg_legend, col=var_name,
kind=kind, linestyle=linestyle,
Expand Down
Loading