docstr: Split data based on subpopulation
docstr_tok: ["Split","data","based","on","subpopulation"]
code: def data_split(self) -> DataSplit:
      """Split data based on subpopulation"""
      base_splits = self.base_population.data_split()
      current_population = self.population().index.to_numpy()
  
      train_ids = np.intersect1d(
          base_splits.train, current_population, assume_unique=True
      )
  
      ## print the unlabeled number
      train_unlabeled = np.intersect1d(train_ids, self.unlabeled_ids)
      self.ratio_unlabeled = float(train_unlabeled.shape[0]) / float(
          train_ids.shape[0]
      )
      logger.info(
          "Fraction of unlabeled samples in TRAIN: %.3f"
          % self.ratio_unlabeled
      )
      val_ids = np.intersect1d(
          base_splits.val, current_population, assume_unique=True
      )
      test_ids = np.intersect1d(
          base_splits.test, current_population, assume_unique=True
      )
  
      assert (
          current_population.shape[0]
          == train_ids.shape[0] + test_ids.shape[0] + val_ids.shape[0]
      )
  
      return DataSplit(
          train=train_ids,
          val=val_ids,
          test=test_ids,
      )
  
file_path: life2vec/src/data_new/populations/emm.py
imports: from asyncio.log import logger
  from dataclasses import dataclass
  from multiprocessing import resource_tracker
  from pathlib import Path
  from functools import reduce
  import dask.array
  import dask.dataframe
  import numpy
  import pandas
  from ..decorators import save_pickle
  from ..serialize import DATA_ROOT
  from .base import DataSplit, Population
label_desc: Use image node_id 5 for calling the EmmSubPopulation obj's underlying member method code with example usage: obj.data_split() and returns: DataSplit