def label_map(self) -> Optional[Mapping[str, float]]:
"""
Returns the mapping of nominal labels to numeric labels for the data set.
This method delegates to the selected parser.
Returns
-------
map of str to int
The mapping of nominal labels to numeric labels
Raises
------
IOError
If the data set cannot be parsed
"""
if not self.can_parse():
raise IOError("unable to parse data set at {}".format(self._basedir))
return self._parser.label_map
评论列表
文章目录