docstr: Tests that predictions are made from extracts for a single model.
docstr_tok: ["Tests","that","predictions","are","made","from","extracts","for","a","single","model","."]
code: def testMakeSklearnPredictExtractor(self):
      """Tests that predictions are made from extracts for a single model."""
      feature_extractor = tfma.extractors.FeaturesExtractor(
          self._eval_config
      )
      prediction_extractor = (
          sklearn_predict_extractor._make_sklearn_predict_extractor(
              self._eval_shared_model
          )
      )
      with beam.Pipeline() as pipeline:
          predict_extracts = (
              pipeline
              | "Create"
              >> beam.Create(
                  [e.SerializeToString() for e in self._examples]
              )
              | "BatchExamples" >> self._tfx_io.BeamSource()
              | "InputsToExtracts"
              >> tfma.BatchedInputsToExtracts()  # pylint: disable=no-value-for-parameter
              | feature_extractor.stage_name
              >> feature_extractor.ptransform
              | prediction_extractor.stage_name
              >> prediction_extractor.ptransform
          )
  
          def check_result(actual):
              try:
                  for item in actual:
                      self.assertEqual(
                          item["labels"].shape,
                          item["predictions"].shape,
                      )
  
              except AssertionError as err:
                  raise util.BeamAssertException(err)
  
          util.assert_that(predict_extracts, check_result)
  
file_path: tfx/tfx/examples/penguin/experimental/sklearn_predict_extractor_test.py
imports: import os
  import pickle
  import apache_beam
  from apache_beam.testing import util
  from sklearn import neural_network
  import tensorflow_model_analysis
  from tfx.examples.penguin.experimental import sklearn_predict_extractor
  from tfx_bsl.tfxio import tensor_adapter
  from tfx_bsl.tfxio import test_util
  from google.protobuf import text_format
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 2 for calling the SklearnPredictExtractorTest obj's underlying member method code with example usage: obj.testMakeSklearnPredictExtractor() without return types