Configuring Distance Metric

Configuring Distance Metric for KNN

Function Signature

def config_distance(self, distance):

Parameters

Return Value

This function does not return anything. It modifies the KNN instance.

Description

The config_distance function sets the distance metric for the KNN instance.

The valid distance metrics that can be passed to this function are:

Examples

from deeprai.models import KNN

# Create an instance of the classifier
classifier = KNN()

# Configure the distance metric to be used
classifier.config_distance("euclidean distance")

Revision #1
Created 12 October 2023 05:13:33 by Kieran Carter
Updated 12 October 2023 05:16:21 by Kieran Carter