code: def partial_plot_test():
      # Import data set that contains NAs
      data = h2o.import_file(
          pyunit_utils.locate("smalldata/prostate/prostate_cat_NA.csv")
      )
      x = data.names
      y = "CAPSULE"
      x.remove(y)
  
      weights = h2o.H2OFrame([3.0] * data.nrow)
      tweight2 = [1.0] * data.nrow
      random.seed(12345)
      for ind in range(len(tweight2)):
          tweight2[ind] = random.randint(0, 5)
      weights2 = h2o.H2OFrame(tweight2)
      data = data.cbind(weights)
      data = data.cbind(weights2)
      data.set_name(data.ncol - 2, "constWeight")
      data.set_name(data.ncol - 1, "variWeight")
  
      # Build a GBM model predicting for response CAPSULE
      gbm_model = H2OGradientBoostingEstimator(
          ntrees=50, learn_rate=0.05, seed=12345
      )
      gbm_model.train(x=x, y=y, training_frame=data)
  
      # pdp without weight or NA
      pdpOrig = gbm_model.partial_plot(
          frame=data, cols=["AGE", "RACE"], server=True, plot=True
      )
      # pdp with constant weight and NA
      pdpcWNA = gbm_model.partial_plot(
          frame=data,
          cols=["AGE", "RACE"],
          server=True,
          plot=True,
          weight_column="constWeight",
          include_na=True,
      )
  
      # compare results
      pyunit_utils.assert_H2OTwoDimTable_equal_upto(
          pdpOrig[0], pdpcWNA[0], pdpOrig[0].col_header, tolerance=1e-10
      )
      pyunit_utils.assert_H2OTwoDimTable_equal_upto(
          pdpOrig[1], pdpcWNA[1], pdpOrig[1].col_header, tolerance=1e-10
      )
      # pdp with changing weight NA
      pdpvWNA = gbm_model.partial_plot(
          frame=data,
          cols=["AGE", "RACE"],
          server=True,
          plot=True,
          weight_column="variWeight",
          include_na=True,
      )
      ageList = pyunit_utils.extract_col_value_H2OTwoDimTable(
          pdpvWNA[0], "age"
      )
      raceList = pyunit_utils.extract_col_value_H2OTwoDimTable(
          pdpvWNA[1], "race"
      )
      raceList.remove(raceList[2])
      raceList.append(data[21, "RACE"])  # replace with NA word
      ageList[len(ageList) - 1] = float(
          "nan"
      )  # replace nan with proper form for python
  
      compare_weightedStats(
          gbm_model,
          "smalldata/prostate/prostate_cat_NA.csv",
          raceList,
          "RACE",
          tweight2,
          pdpvWNA[1],
          tol=1e-10,
      )
      compare_weightedStats(
          gbm_model,
          "smalldata/prostate/prostate_cat_NA.csv",
          ageList,
          "AGE",
          tweight2,
          pdpvWNA[0],
          tol=1e-10,
      )
  
file_path: h2o-3/h2o-py/tests/testdir_misc/pyunit_pubdev_5761_pdp_NA.py
imports: import sys
  import h2o
  import math
  from tests import pyunit_utils
  from h2o.estimators.gbm import H2OGradientBoostingEstimator
  import random
  from h2o.utils.typechecks import is_type
label_desc: Use image node_id 1 for calling a global function with example usage: partial_plot_test() without return types