diff --git a/CompStats/__init__.py b/CompStats/__init__.py index 668920e..48a6219 100644 --- a/CompStats/__init__.py +++ b/CompStats/__init__.py @@ -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 diff --git a/CompStats/interface.py b/CompStats/interface.py index 4ef310c..b1e2ee0 100644 --- a/CompStats/interface.py +++ b/CompStats/interface.py @@ -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})' @@ -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 @@ -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, @@ -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,