class_docstr: A class for feature importance methods.
class_docstr_tok: ["A","class","for","feature","importance","methods","."]
docstr: Rank features based on the F-statistics of the interaction.
  
  Args:
      data (pd.Dataframe): DataFrame containing outcome, features, and experiment group
      treatment_indicator (string): the column name for binary indicator of treatment (value 1) or control (value 0)
      features (list of string): list of feature names, that are columns in the data DataFrame
      y_name (string): name of the outcome variable
      order (int): the order of feature to be evaluated with the treatment effect, order takes 3 values: 1,2,3. order = 1 corresponds to linear importance of the feature, order=2 corresponds to quadratic and linear importance of the feature,
      order= 3 will calculate feature importance up to cubic forms.
  
  Returns:
      all_result : pd.DataFrame
          a data frame containing the feature importance statistics
docstr_tok: ["Rank","features","based","on","the","F-statistics","of","the","interaction",".","Args",":","data","(","pd.Dataframe",")",":","DataFrame","containing","outcome",",","features",",","and","experiment","group","treatment_indicator","(","string",")",":","the","column","name","for","binary","indicator","of","treatment","(","value","1",")","or","control","(","value","0",")","features","(","list","of","string",")",":","list","of","feature","names",",","that","are","columns","in","the","data","DataFrame","y_name","(","string",")",":","name","of","the","outcome","variable","order","(","int",")",":","the","order","of","feature","to","be","evaluated","with","the","treatment","effect",",","order","takes","3","values",":","1,2,3.","order","=","1","corresponds","to","linear","importance","of","the","feature",",","order=2","corresponds","to","quadratic","and","linear","importance","of","the","feature",",","order=","3","will","calculate","feature","importance","up","to","cubic","forms",".","Returns",":","all_result",":","pd.DataFrame","a","data","frame","containing","the","feature","importance","statistics"]
code: def filter_F(
      self, data, treatment_indicator, features, y_name, order=1
  ):
      """
      Rank features based on the F-statistics of the interaction.
  
      Args:
          data (pd.Dataframe): DataFrame containing outcome, features, and experiment group
          treatment_indicator (string): the column name for binary indicator of treatment (value 1) or control (value 0)
          features (list of string): list of feature names, that are columns in the data DataFrame
          y_name (string): name of the outcome variable
          order (int): the order of feature to be evaluated with the treatment effect, order takes 3 values: 1,2,3. order = 1 corresponds to linear importance of the feature, order=2 corresponds to quadratic and linear importance of the feature,
          order= 3 will calculate feature importance up to cubic forms.
  
      Returns:
          all_result : pd.DataFrame
              a data frame containing the feature importance statistics
      """
      if order not in [1, 2, 3]:
          raise Exception(
              "ValueError: order argument only takes value 1,2,3."
          )
  
      all_result = pd.DataFrame()
      for x_name_i in features:
          one_result = self._filter_F_one_feature(
              data=data,
              treatment_indicator=treatment_indicator,
              feature_name=x_name_i,
              y_name=y_name,
              order=order,
          )
          all_result = pd.concat([all_result, one_result])
  
      all_result = all_result.sort_values(by="score", ascending=False)
      all_result["rank"] = all_result["score"].rank(ascending=False)
  
      return all_result
  
imports: import numpy
  import pandas
  import statsmodels.api
  from scipy import stats
  from sklearn.impute import SimpleImputer
  import warnings
label_desc: Use image node_id 3 for calling the FilterSelect obj's underlying member method code with example usage: obj.filter_F(data, treatment_indicator, features, y_name, order) and returns: all_result