class_docstr: This class is available only for Uplift DRF model.
  This class is essentially an API for the AUUC object.
docstr: Plot Uplift Curve. 
  
  :param server: if ``True``, generate plot inline using matplotlib's Anti-Grain Geometry (AGG) backend.
  :param save_to_file: filename to save the plot to.
  :param plot: ``True`` to plot curve, ``False`` to get a tuple of values at axis x and y of the plot 
      (number of observations and uplift values)
  :param metric: AUUC metric type. One of:
  
      - "qini"
      - "lift"
      - "gain"
      - "AUTO" (default; defaults to "qini")
      
  :param normalize: If ``True``, normalized values are plotted.
  
  :examples:
  
  >>> from h2o.estimators import H2OUpliftRandomForestEstimator
  >>> train = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/uplift/criteo_uplift_13k.csv")
  >>> treatment_column = "treatment"
  >>> response_column = "conversion"
  >>> train[treatment_column] = train[treatment_column].asfactor()
  >>> train[response_column] = train[response_column].asfactor()
  >>> predictors = ["f1", "f2", "f3", "f4", "f5", "f6"]
  >>>
  >>> uplift_model = H2OUpliftRandomForestEstimator(ntrees=10, 
  ...                                               max_depth=5,
  ...                                               treatment_column=treatment_column,
  ...                                               uplift_metric="kl",
  ...                                               distribution="bernoulli",
  ...                                               min_rows=10,
  ...                                               auuc_type="gain")
  >>> uplift_model.train(y=response_column, x=predictors, training_frame=train)
  >>> perf = uplift_model.model_performance()
  >>> perf.plot_uplift(plot=True)
  >>> n, uplift = perf.plot_uplift(plot=False)
docstr_tok: ["Plot","Uplift","Curve",".",":","param","server",":","if","``","True","``",",","generate","plot","inline","using","matplotlib","'s","Anti-Grain","Geometry","(","AGG",")","backend",".",":","param","save_to_file",":","filename","to","save","the","plot","to",".",":","param","plot",":","``","True","``","to","plot","curve",",","``","False","``","to","get","a","tuple","of","values","at","axis","x","and","y","of","the","plot","(","number","of","observations","and","uplift","values",")",":","param","metric",":","AUUC","metric","type",".","One","of",":","-","``","qini","''","-","``","lift","''","-","``","gain","''","-","``","AUTO","''","(","default",";","defaults","to","``","qini","''",")",":","param","normalize",":","If","``","True","``",",","normalized","values","are","plotted",".",":","examples",":",">",">",">","from","h2o.estimators","import","H2OUpliftRandomForestEstimator",">",">",">","train","=","h2o.import_file","(","``","https",":","\/\/s3.amazonaws.com\/h2o-public-test-data\/smalldata\/uplift\/criteo_uplift_13k.csv","''",")",">",">",">","treatment_column","=","``","treatment","''",">",">",">","response_column","=","``","conversion","''",">",">",">","train","[","treatment_column","]","=","train","[","treatment_column","]",".asfactor","(",")",">",">",">","train","[","response_column","]","=","train","[","response_column","]",".asfactor","(",")",">",">",">","predictors","=","[","``","f1","''",",","``","f2","''",",","``","f3","''",",","``","f4","''",",","``","f5","''",",","``","f6","''","]",">",">",">",">",">",">","uplift_model","=","H2OUpliftRandomForestEstimator","(","ntrees=10",",","...","max_depth=5",",","...","treatment_column=treatment_column",",","...","uplift_metric=","''","kl","''",",","...","distribution=","''","bernoulli","''",",","...","min_rows=10",",","...","auuc_type=","''","gain","''",")",">",">",">","uplift_model.train","(","y=response_column",",","x=predictors",",","training_frame=train",")",">",">",">","perf","=","uplift_model.model_performance","(",")",">",">",">","perf.plot_uplift","(","plot=True",")",">",">",">","n",",","uplift","=","perf.plot_uplift","(","plot=False",")"]
code: def plot_uplift(
      self,
      server=False,
      save_to_file=None,
      plot=True,
      metric="AUTO",
      normalize=False,
  ):
      """
      Plot Uplift Curve.
  
      :param server: if ``True``, generate plot inline using matplotlib's Anti-Grain Geometry (AGG) backend.
      :param save_to_file: filename to save the plot to.
      :param plot: ``True`` to plot curve, ``False`` to get a tuple of values at axis x and y of the plot
          (number of observations and uplift values)
      :param metric: AUUC metric type. One of:
  
          - "qini"
          - "lift"
          - "gain"
          - "AUTO" (default; defaults to "qini")
  
      :param normalize: If ``True``, normalized values are plotted.
  
      :examples:
  
      >>> from h2o.estimators import H2OUpliftRandomForestEstimator
      >>> train = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/uplift/criteo_uplift_13k.csv")
      >>> treatment_column = "treatment"
      >>> response_column = "conversion"
      >>> train[treatment_column] = train[treatment_column].asfactor()
      >>> train[response_column] = train[response_column].asfactor()
      >>> predictors = ["f1", "f2", "f3", "f4", "f5", "f6"]
      >>>
      >>> uplift_model = H2OUpliftRandomForestEstimator(ntrees=10,
      ...                                               max_depth=5,
      ...                                               treatment_column=treatment_column,
      ...                                               uplift_metric="kl",
      ...                                               distribution="bernoulli",
      ...                                               min_rows=10,
      ...                                               auuc_type="gain")
      >>> uplift_model.train(y=response_column, x=predictors, training_frame=train)
      >>> perf = uplift_model.model_performance()
      >>> perf.plot_uplift(plot=True)
      >>> n, uplift = perf.plot_uplift(plot=False)
      """
      assert metric in ["AUTO", "qini", "lift", "gain"], (
          "Metric "
          + metric
          + " should be 'AUTO', 'qini','lift' or 'gain'."
      )
      if plot:
          plt = get_matplotlib_pyplot(server)
          if plt is None:
              return
          plt.ylabel("Cumulative " + metric)
          plt.xlabel("Number Targeted")
          rnd = self.uplift_random(metric)
          if normalize:
              plt.title(
                  "Cumulate Uplift Curve - "
                  + metric
                  + "\n"
                  + r"Normalized AUUC={0:.4f}".format(
                      self.auuc_normalized(metric)
                  )
              )
              uplift = self.uplift_normalized(metric)
              if metric != "lift":
                  max = abs(rnd[len(rnd) - 1])
                  rnd = [x / max for x in rnd]
          else:
              plt.title(
                  "Cumulate Uplift Curve - "
                  + metric
                  + "\n"
                  + r"AUUC={0:.4f}".format(self.auuc(metric))
              )
              uplift = self.uplift(metric)
          n = self.n()
          plt.plot(n, uplift, "b-", label="uplift")
          plt.plot(n, rnd, "k--", label="random")
          if metric == "lift":
              plt.legend(loc="upper right")
          else:
              plt.legend(loc="lower right")
          plt.grid(True)
          plt.tight_layout()
          if not server:
              plt.show()
          if (
              save_to_file is not None
          ):  # only save when a figure is actually plotted
              plt.savefig(save_to_file)
      else:
          return self.n(), self.uplift(metric)
  
imports: import h2o
  from h2o.model import MetricsBase
  from h2o.plot import get_matplotlib_pyplot
label_desc: Use image node_id 17 for calling the H2OBinomialUpliftModelMetrics obj's underlying member method code with example usage: obj.plot_uplift(server, save_to_file, plot, metric, normalize) and returns: self,  self