original_docstring: Computes 2-way ANOVA for AUC and factors - improvement, tracker
docstring: Computes 2-way ANOVA for AUC and factors - improvement, tracker
docstring_tokens: Computes 2 - way ANOVA for AUC and factors - improvement tracker
code: def run2WayAnovaAUC(self):
          """Computes 2-way ANOVA for AUC and factors - improvement, tracker"""
          g1 = []
          g2 = []
          for i in range(len(self.IMPROVEMENTS)):
              for j in range(len(self.TRACKERS)):
                  g1.append(self.IMPROVEMENTS[i])
                  g2.append(self.TRACKERS[j])
  
          default_auc = self._getAUCAllTrackers(default=True).tolist()
          border_auc = self._getAUCAllTrackers(border=True).tolist()
          nfov_auc = self._getAUCAllTrackers(nfov=True).tolist()
          # concat
          auc = default_auc + border_auc + nfov_auc
          auc_rounded = [round(num / 100, 3) for num in auc]
  
          df = pd.DataFrame(list(zip(auc_rounded, g1, g2)), columns=['auc', 'improvement', 'tracker'], dtype=np.float64)
          print(df)
  
          # Type 2 ANOVA DataFrame - https://www.statsmodels.org/dev/anova.html#module-statsmodels.stats.anova
          df_lm = ols('auc ~ C(improvement, Sum) + C(tracker, Sum)', data=df).fit()
          # df_lm = ols('auc ~ C(improvement) + C(tracker)', data=df).fit()
          table = sm.stats.anova_lm(df_lm, typ=2) 
          print(table)
code_tokens: def run2WayAnovaAUC ( self ) : g1 = [ ] g2 = [ ] for i in range ( len ( self . IMPROVEMENTS ) ) : for j in range ( len ( self . TRACKERS ) ) : g1 . append ( self . IMPROVEMENTS [ i ] ) g2 . append ( self . TRACKERS [ j ] ) default_auc = self . _getAUCAllTrackers ( default = True ) . tolist ( ) border_auc = self . _getAUCAllTrackers ( border = True ) . tolist ( ) nfov_auc = self . _getAUCAllTrackers ( nfov = True ) . tolist ( ) auc = default_auc + border_auc + nfov_auc auc_rounded = [ round ( num / 100 , 3 ) for num in auc ] df = pd . DataFrame ( list ( zip ( auc_rounded , g1 , g2 ) ) , columns = [ 'auc' , 'improvement' , 'tracker' ] , dtype = np . float64 ) print ( df ) df_lm = ols ( 'auc ~ C(improvement, Sum) + C(tracker, Sum)' , data = df ) . fit ( ) table = sm . stats . anova_lm ( df_lm , typ = 2 ) print ( table )
short_docstring: Computes 2-way ANOVA for AUC and factors - improvement, tracker
short_docstring_tokens: Computes 2 - way ANOVA for AUC and factors - improvement tracker
comment: """Computes 2-way ANOVA for AUC and factors - improvement, tracker"""$SEP$# concat$SEP$# Type 2 ANOVA DataFrame - https://www.statsmodels.org/dev/anova.html#module-statsmodels.stats.anova$SEP$# df_lm = ols('auc ~ C(improvement) + C(tracker)', data=df).fit()