code: def test_predict_proba(self):
      iris = datasets.load_iris()
      df = pdml.ModelFrame(iris)
  
      models = ["SVC"]
      for model in models:
          mod1 = getattr(df.svm, model)(
              probability=True, random_state=self.random_state
          )
          mod2 = getattr(svm, model)(
              probability=True, random_state=self.random_state
          )
  
          df.fit(mod1)
          mod2.fit(iris.data, iris.target)
  
          result = df.predict(mod1)
          expected = mod2.predict(iris.data)
  
          self.assertIsInstance(result, pdml.ModelSeries)
          self.assert_numpy_array_almost_equal(result.values, expected)
  
          result = df.predict_proba(mod1)
          expected = mod2.predict_proba(iris.data)
  
          self.assertIsInstance(result, pdml.ModelFrame)
          tm.assert_index_equal(result.index, df.index)
          self.assert_numpy_array_almost_equal(result.values, expected)
          self.assert_numpy_array_almost_equal(
              df.proba.values, expected
          )
  
          result = df.predict_log_proba(mod1)
          expected = mod2.predict_log_proba(iris.data)
  
          self.assertIsInstance(result, pdml.ModelFrame)
          tm.assert_index_equal(result.index, df.index)
          self.assert_numpy_array_almost_equal(result.values, expected)
          self.assert_numpy_array_almost_equal(
              df.log_proba.values, expected
          )
  
          result = df.decision_function(mod1)
          expected = mod2.decision_function(iris.data)
  
          self.assertIsInstance(result, pdml.ModelFrame)
          tm.assert_index_equal(result.index, df.index)
          self.assert_numpy_array_almost_equal(result.values, expected)
          self.assert_numpy_array_almost_equal(
              df.decision.values, expected
          )
  
          # not reset if estimator is identical
          df.fit(mod1)
          self.assertFalse(df._predicted is None)
          self.assertFalse(df._proba is None)
          self.assertFalse(df._log_proba is None)
          self.assertFalse(df._decision is None)
  
          # reset estimator
          mod3 = getattr(df.svm, model)(
              probability=True, random_state=self.random_state
          )
          df.fit(mod3)
          self.assertTrue(df._predicted is None)
          self.assertTrue(df._proba is None)
          self.assertTrue(df._log_proba is None)
          self.assertTrue(df._decision is None)
  
imports: import pytest
  import datetime
  import warnings
  import numpy
  import pandas
  import sklearn.datasets
  import sklearn.svm
  import pandas_ml
  import pandas_ml.util.testing
label_desc: Use image node_id 18 for calling the TestModelFrame obj's underlying member method code with example usage: obj.test_predict_proba() without return types