Class Spearman
source code
ClassifyI --+
|
AbstractClassify --+
|
Spearman
The Spearman-rho Classifier is a non-parametric measure of correlation between two
sets of ranked values
Spearman-rho classification is a supervised classifier. It needs to be trained
with representative examples of each class. From these examples the classifier
calculates the most probable classification of the sample.
6 * sum((Ai - Bi)^2)
p = 1 - -------------------------
(n^3) - n
where A, B are the vectors of ranked objects
n is the number of ranked objects being compared
Internal data structures:
_feature_dectector:
holds a feature detector function
_classes:
holds a list of classes supplied during trainning
_cls_rank:
holds a dictionary of ordered lists,
the order of the list is deturnmined by:
first ranked object is ordered first
duplicate values are ordered in alphabetical order
__init__(self,
feature_detector,
crop_data=100)
(Constructor)
| source code
|
- Parameters:
feature_detector - feature detector produced function
crop_data - ranking beyond which features are ignored this produces a maximum
rank for large data sets where the lower order values would
offset the results
|
- Parameters:
text - sample to be classified
|
- Parameters:
text - sample to be classified
|
- Parameters:
sample_dist - sample frequency distribution
|