Skip to content
Snippets Groups Projects
Commit 0ee66d4d authored by dmt's avatar dmt
Browse files

Provide property for checking if the data block has labels or not.

parent bbb66be9
No related branches found
No related tags found
No related merge requests found
from typing import List
from abc import abstractmethod, ABC from abc import abstractmethod, ABC
import pandas as pd import pandas as pd
...@@ -59,6 +60,18 @@ class PandasBlock: ...@@ -59,6 +60,18 @@ class PandasBlock:
def __len__(self): def __len__(self):
return self.__data_block.shape[0] return self.__data_block.shape[0]
@property
def labeled(self):
return not self.__data_block.Z.nunique() == 1
@property
def columns(self):
return list(self.__data_block.columns)
@property
def n_features(self):
return self.__data_block.shape[1] - self._LAST_THREE_COLUMNS
def as_numpy_array(self): def as_numpy_array(self):
return self.__data_block[ return self.__data_block[
self.__data_block.columns[ self.__data_block.columns[
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment