def on_loader_end(self, runner: "IRunner") -> None:
        """Loader end hook: for the train loader train classifier,
        for the test check the quality.

        Args:
            runner: current runner
        """
        if runner.loader_key == self._train_loader:
            data = self.storage.compute_key_value()
            collected_size = self.storage.collected_samples
            loader_len = runner.loader_sample_len

            assert (
                collected_size == loader_len
            ), f"collected samples - {collected_size} != loader len - {loader_len}!"

            assert (
                torch.isnan(data[self.feature_key]).sum() == 0
            ), "SklearnModelCallback - NaN after Accumulation!"

            self.model = self.model_fabric_fn()
            if self.target_key is None:
                features = data[self.feature_key].detach().cpu().numpy()
                self.model.fit(features)
            else:
                features = data[self.feature_key].detach().cpu().numpy()
                targets = data[self.target_key].detach().cpu().numpy()
                self.model.fit(features, targets)
Loader end hook: for the train loader train classifier,
        for the test check the quality.

        Args:
            runner: current runner
        
catalyst/callbacks/sklearn_model.py