Package miopia :: Package adapter :: Module Adapter :: Class Adapter
[hide private]
[frames] | no frames]

Class Adapter

source code

object --+
         |
        Adapter
Known Subclasses:

Adapter is an abstract class which defines the interface for different features Adapter's provided in the package adapter

Instance Methods [hide private]
 
__init__(self, path_weka, counter, weight_factor='BW')
Constructor
source code
 
get_counter(self) source code
 
get_weighting_factor(self) source code
 
count_features(self, list_text_info) source code
 
classes_from_arff(self, arff_file) source code
 
_long_id_feature_to_string(self, expanded_id) source code
 
to_arff(self, list_text_info, arff_file, arff_header=None, is_test_set=False) source code
 
arff_header_from_arff_file(self, arff_file) source code
 
_proccess(self, list_text_info, is_test_set) source code
 
_features_from_arff_header(self, arff_header) source code
 
_arff_header(self, dict_features, classes) source code
 
get_weighting_value(self, str_ftc, value)
@param str_ftc.
source code
 
_arff_data(self, dict_features, dict_feature_position, list_text_info) source code
 
_get_feature_configuration(self, str_name_feature)
Given a long name of a feature it returns the FeatureType and the FeatureTypeConfiguration
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  BINARY_WEIGHTING_FACTOR = 'BW'
  TOTAL_WEIGHTING_FACTOR = 'TW'
  DELIMITER_FEATURE_TYPE_AND_LIST_FEATURES = ':'
  ALLOWED_JAVA_HEAP_XMX = '11000M'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, path_weka, counter, weight_factor='BW')
(Constructor)

source code 

Constructor

Parameters:
  • path_weka - The path to the WEKA.jar
  • abstracted_lexicons_counter - An instance of Counter
  • weight_factor - A value {BINARY_WEIGHTING_FACTOR, TOTAL_WEIGHTING_FACTOR}
Overrides: object.__init__

count_features(self, list_text_info)

source code 
Parameters:
  • list_text_info - A list of TextInfo @param A dictionary with the features detected

classes_from_arff(self, arff_file)

source code 
Parameters:
  • arff_file - The path to an arff file @return The classes considered in hat arff

_long_id_feature_to_string(self, expanded_id)

source code 
Parameters:

To Do: Change this in the future

to_arff(self, list_text_info, arff_file, arff_header=None, is_test_set=False)

source code 
Parameters:
  • list_text_info - A list of TextInfo
  • arff_file - A string. The path to the destination of the data represented in the ARFF format.
  • arff_header - A string containing an arff header, which will indicate the features that will be taken into account. None if no header specified.
  • is_test_set - A boolean. True if it's a test set. False otherwise.

arff_header_from_arff_file(self, arff_file)

source code 
Parameters:
  • arff_file - The path to an ARFF file @return A string. The ARFF header of the arff_file

_features_from_arff_header(self, arff_header)

source code 
Parameters:
  • arff_header - A string. an ARFF header @return A dictionary of the features considered in the ARFF header and their with their corresponding position in the file.

_arff_header(self, dict_features, classes)

source code 
Parameters:
  • classes - The classes considered by the classifier. @return A string. The ARFF header.

get_weighting_value(self, str_ftc, value)

source code 

@param str_ftc. A string. The representation of an instance of FeatureTypeConfiguration

Parameters:
  • value - An integer. @return A weighted value according to the weighting factor employed by the current adapter

_arff_data(self, dict_features, dict_feature_position, list_text_info)

source code 
Parameters:
  • classes - The classes considered by the classifier. @return A string. The ARFF header.