Repository: roboflow/supervision
File: supervision/dataset/core.py (Python)

Code before:
            >>> train_cd, test_cd = cd.split(split_ratio=0.7, random_state=42, shuffle=True)
            >>> len(train_cd), len(test_cd)
            (700, 300)
            ```
        """
        image_names = list(self.images.keys())
        train_names, test_names = train_test_split(
            data=image_names,
            train_ratio=split_ratio,
            random_state=random_state,
            shuffle=shuffle,
        )

        train_dataset = ClassificationDataset(
            classes=self.classes,
            images={name: self.images[name] for name in train_names},
            annotations={name: self.annotations[name] for name in train_names},
        )
        test_dataset = ClassificationDataset(
            classes=self.classes,
            images={name: self.images[name] for name in test_names},
            annotations={name: self.annotations[name] for name in test_names},
        )
        return train_dataset, test_dataset

    def as_multiclass_folder_structure(self, output_directory_path: str) -> None:
        """
        Saves the dataset as a multi-class folder structure.

        Args:
            output_directory_path (str): The path to the directory where the dataset will be saved.

        Example:
            ```python
            >>> import supervision as sv

            >>> cd = sv.ClassificationDataset(...)

            >>> cd.as_multiclass_folder_structure(
            ...     root_directory_path="./images/valid/",
            ...     output_directory_path="./out",
            ... )
        """
        os.makedirs(output_directory_path, exist_ok=True)

        for class_name in self.classes:
            os.makedirs(os.path.join(output_directory_path, class_name), exist_ok=True)

            for image in self.annotations:
                for class_id in self.annotations[image].class_id:
                    if class_id == self.classes.index(class_name):

Review comment (suggestion):
In https://github.com/roboflow/supervision/issues/119 we agreed to call that argument `root_directory_path`. Let's rename `output_directory_path` to `root_directory_path`.

Code after:
            >>> train_cd, test_cd = cd.split(split_ratio=0.7, random_state=42, shuffle=True)
            >>> len(train_cd), len(test_cd)
            (700, 300)
            ```
        """
        image_names = list(self.images.keys())
        train_names, test_names = train_test_split(
            data=image_names,
            train_ratio=split_ratio,
            random_state=random_state,
            shuffle=shuffle,
        )

        train_dataset = ClassificationDataset(
            classes=self.classes,
            images={name: self.images[name] for name in train_names},
            annotations={name: self.annotations[name] for name in train_names},
        )
        test_dataset = ClassificationDataset(
            classes=self.classes,
            images={name: self.images[name] for name in test_names},
            annotations={name: self.annotations[name] for name in test_names},
        )
        return train_dataset, test_dataset

    def as_multiclass_folder_structure(self, root_directory_path: str) -> None:
        """
        Saves the dataset as a multi-class folder structure.

        Args:
            root_directory_path (str): The path to the directory where the dataset will be saved.
        """
        os.makedirs(root_directory_path, exist_ok=True)

        for class_name in self.classes:
            os.makedirs(os.path.join(root_directory_path, class_name), exist_ok=True)

        for image_name in self.images:
            classification = self.annotations[image_name]
            image = self.images[image_name]
            class_id = (
                classification.class_id[0]
                if classification.confidence is None
                else classification.get_top_k(1)[0]
            )
            class_name = self.classes[class_id]
            image_path = os.path.join(root_directory_path, class_name, image_name)
            cv2.imwrite(image_path, image)

    @classmethod
    def from_multiclass_folder_structure(