def setUpClass(self):
        """
        Set up the unit test by loading the dataset and training a model.
        """
        scikit_data = load_boston()
        # axis parameter deprecated in SimpleImputer >= 0.22. which now imputes
        # only along columns as desired here.
        if _SKLEARN_VERSION >= Version("0.22"):
            scikit_model = Imputer(strategy="most_frequent")
        else:
            scikit_model = Imputer(strategy="most_frequent", axis=0)
        scikit_data["data"][1, 8] = np.nan

        input_data = scikit_data["data"][:, 8].reshape(-1, 1)
        scikit_model.fit(input_data, scikit_data["target"])

        # Save the data and the model
        self.scikit_data = scikit_data
        self.scikit_model = scikit_model

        Set up the unit test by loading the dataset and training a model.
        
coremltools/test/sklearn_tests/test_categorical_imputer.py