extractor.py 868 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
"""
    Abstract class for feature extraction algorithms.
    
    Name: extractor.py
    Author: Alessandro dos Santos Ferreira ( santosferreira.alessandro@gmail.com )
"""

from abc import ABCMeta, abstractmethod

class Extractor(object):
14
    """Abstract class for feature extraction algorithms."""
15 16 17 18 19 20 21
    
    __metaclass__ = ABCMeta
    
    NUMERIC = 'numeric'
    NOMINAL = 'nominal'
    
    def get_name(self):
22 23 24 25 26 27 28
        """Return the name of class.
        
        Returns
        -------
        name : string
            Returns the name of instantiated class.
        """
29 30 31 32
        return self.__class__.__name__
    
    @abstractmethod
    def run(self):
33 34 35
        """Perform the feature extraction. 
        Implement this method to extend this class with a new feature extraction algorithm.
        """
36
        pass
37