subrela.records.from_arrays function¶
-
subrela.records.from_arrays(flags, scores, features=None)[source]¶ Make records of feature subsets from flags and scores.
- Parameters
- Returns
pandas.Series – Score records.
- Raises
ValueError – If the number of rows in
flagsis not equal to the size ofscores. If the number of columns inflagsis not equal to the size offeatures.
Notes
An index of returned
pandas.Seriesis apandas.MultiIndexindicating used features. Levels of the index are features.Examples
>>> from_arrays([[True, False, False], [True, False, True]], [0.2, 0.8]) feature_0 feature_1 feature_2 True False False 0.2 True 0.8 dtype: float64
>>> from_arrays([[True, False, False], [True, False, True]], [0.2, 0.8], ... features=['A', 'B', 'C']) A B C True False False 0.2 True 0.8 dtype: float64