knn module

class knn.Knn(config: config.Config)[source]

Bases: object

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'knn', '__init__': <function Knn.__init__>, 'calculate_kappa_coefficiente_validation': <function Knn.calculate_kappa_coefficiente_validation>, 'calculate_accuracy_test': <function Knn.calculate_accuracy_test>, '__dict__': <attribute '__dict__' of 'Knn' objects>, '__weakref__': <attribute '__weakref__' of 'Knn' objects>, '__doc__': None})
__dir__()

Default dir() implementation.

__eq__

Return self==value.

__format__()

Default object formatter.

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init__(config: config.Config)[source]

Constructor.

Parameters:config – Config object where all the hyperparameter values are loaded
__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'knn'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

Helper for pickle.

__reduce_ex__()

Helper for pickle.

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__()

Size of object in memory, in bytes.

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

calculate_accuracy_test(individual)[source]

Calculation of the test accuracy.

Parameters:individual – Chromosome of the individual (selected features)
calculate_kappa_coefficiente_validation(individual)[source]

Calculation of the validation Kappa coefficient.

Parameters:individual – Chromosome of the individual (selected features)