ModErn Text Analysis
META Enumerates Textual Applications
Public Types | Public Member Functions | List of all members
meta::classify::classifier Class Referenceabstract

A classifier uses a document's feature space to identify which group it belongs to. More...

#include <classifier.h>

Inheritance diagram for meta::classify::classifier:
meta::classify::dual_perceptron meta::classify::knn meta::classify::logistic_regression meta::classify::naive_bayes meta::classify::nearest_centroid meta::classify::online_classifier meta::classify::svm_wrapper meta::classify::winnow

Public Types

using instance_type = multiclass_dataset::instance_type
 
using feature_vector = learn::feature_vector
 
using dataset_view_type = multiclass_dataset_view
 

Public Member Functions

virtual ~classifier ()=default
 Default destructor is virtual for polymorphic delete.
 
virtual class_label classify (const feature_vector &instance) const =0
 Classifies an instance_type into a specific group, as determined by training data. More...
 
virtual confusion_matrix test (dataset_view_type docs) const
 Classifies a collection document into specific groups, as determined by training data; this function will make repeated calls to classify(). More...
 
virtual void save (std::ostream &out) const =0
 Saves the classifier model to the output stream. More...
 

Detailed Description

A classifier uses a document's feature space to identify which group it belongs to.

This is a base class that defines an interface for multi-class classification.

Member Function Documentation

§ classify()

virtual class_label meta::classify::classifier::classify ( const feature_vector instance) const
pure virtual

Classifies an instance_type into a specific group, as determined by training data.

Parameters
instanceThe instance to classify
Returns
the class it belongs to

Implemented in meta::classify::dual_perceptron, meta::classify::logistic_regression, meta::classify::svm_wrapper, meta::classify::winnow, meta::classify::knn, meta::classify::naive_bayes, meta::classify::one_vs_one, meta::classify::nearest_centroid, and meta::classify::one_vs_all.

§ test()

confusion_matrix meta::classify::classifier::test ( dataset_view_type  docs) const
virtual

Classifies a collection document into specific groups, as determined by training data; this function will make repeated calls to classify().

Parameters
docsThe documents to classify
Returns
a confusion_matrix detailing the performance of the classifier

Reimplemented in meta::classify::svm_wrapper.

§ save()

virtual void meta::classify::classifier::save ( std::ostream &  out) const
pure virtual

The documentation for this class was generated from the following files: