class_docstr: Test grid hyperparameter optimization API.
class_docstr_tok: ["Test","grid","hyperparameter","optimization","API","."]
docstr: Test of hyperparam_opt with singletask RF ECFP regression API.
docstr_tok: ["Test","of","hyperparam_opt","with","singletask","RF","ECFP","regression","API","."]
code: def test_rf_hyperparam_min(self):
      """Test of hyperparam_opt with singletask RF ECFP regression API."""
      optimizer = dc.hyper.GridHyperparamOpt(self.rf_model_builder)
      params_dict = {"n_estimators": [10, 100]}
      transformers = []
      metric = dc.metrics.Metric(dc.metrics.pearson_r2_score)
  
      (
          best_model,
          best_hyperparams,
          all_results,
      ) = optimizer.hyperparam_search(
          params_dict,
          self.train_dataset,
          self.valid_dataset,
          metric,
          transformers,
          use_max=False,
      )
      valid_score = best_model.evaluate(
          self.valid_dataset, [metric], transformers
      )
  
      assert valid_score["pearson_r2_score"] == min(
          all_results.values()
      )
      assert valid_score["pearson_r2_score"] > 0
  
file_path: deepchem/deepchem/hyper/tests/test_grid_hyperparam_opt.py
imports: import unittest
  import tempfile
  import numpy
  import pytest
  import deepchem
  import sklearn
  import sklearn.ensemble
  import os
label_desc: Use image node_id 3 for calling the TestGridHyperparamOpt obj's underlying member method code with example usage: obj.test_rf_hyperparam_min() without return types