class_docstr: Unit test Smart Predictor class
class_docstr_tok: ["Unit","test","Smart","Predictor","class"]
docstr: Unit test convert_dict_dataset
docstr_tok: ["Unit","test","convert_dict_dataset"]
code: def test_convert_dict_dataset(self):
      """
      Unit test convert_dict_dataset
      """
      predictor_1 = self.predictor_1
  
      x = predictor_1.convert_dict_dataset(x={"x1": 1, "x2": "M"})
  
      assert all(
          [
              str(x[feature].dtypes)
              == predictor_1.features_types[feature]
              for feature in predictor_1.features_types.keys()
          ]
      )
  
      with self.assertRaises(ValueError):
          predictor_1.convert_dict_dataset(x={"x1": "M", "x2": "M"})
          predictor_1.convert_dict_dataset(
              x={"x1": 1, "x2": "M", "x3": "M"}
          )
  
imports: import unittest
  from shapash.explainer.smart_predictor import SmartPredictor
  from shapash import SmartExplainer
  from shapash.explainer.smart_state import SmartState
  from shapash.explainer.multi_decorator import MultiDecorator
  from shapash.backend import ShapBackend
  import os
  from os import path
  from pathlib import Path
  import pandas
  import numpy
  import catboost
  from catboost import Pool
  import category_encoders
  from unittest.mock import patch
  import types
  from sklearn.compose import ColumnTransformer
  import sklearn.preprocessing
  import shap
label_desc: Use image node_id 33 for calling the TestSmartPredictor obj's underlying member method code with example usage: obj.test_convert_dict_dataset() without return types