def _extract_features(data, labels, wildcards, features=None):
        """Extracts features in dictionary and combines with generic region
        features.
        """
        from ops.process import feature_table
        from ops.features import features_basic
        features = features.copy() if features else dict()
        features.update(features_basic)

        df = feature_table(data, labels, features)

        for k, v in sorted(wildcards.items()):
            df[k] = v

        return df
示例#2
0
    def _extract_features_bare(data, labels, features=None, wildcards=None,**kwargs):
        """Extracts features in dictionary and combines with generic region
        features.
        """
        from ops.process import feature_table
        features = features.copy() if features else dict()
        features.update({'label': lambda r: r.label})

        df = feature_table(data, labels, features)

        if wildcards is not None:
            for k,v in sorted(wildcards.items()):
                df[k] = v

        return df