DashAI.back.models.KNeighborsClassifier

class KNeighborsClassifier(**kwargs)[source]

Scikit-learn’s K-Nearest Neighbors (KNN) classifier wrapper for DashAI.

__init__(**kwargs) None[source]

Methods

__init__(**kwargs)

calculate_metrics([split, level, log_index, ...])

Calculate and save metrics for a given data split and level.

fit(X, y)

Fit the k-nearest neighbors classifier from the training dataset.

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

get_schema()

Generates the component related Json Schema.

kneighbors([X, n_neighbors, return_distance])

Find the K-neighbors of a point.

kneighbors_graph([X, n_neighbors, mode])

Compute the (weighted) graph of k-Neighbors for points in X.

load(filename)

Load the model of the specified path.

predict(x_pred)

Make a prediction with the model.

predict_proba(X)

Return probability estimates for the test data X.

prepare_dataset(dataset[, is_fit])

Apply the model transformations to the dataset.

prepare_output(dataset[, is_fit])

Prepare output targets using Label encoding.

save(filename)

Save the model in the specified path.

score(X, y[, sample_weight])

Return the mean accuracy on the given test data and labels.

set_params(**params)

Set the parameters of this estimator.

set_predict_request(*[, x_pred])

Configure whether metadata should be requested to be passed to the predict method.

set_score_request(*[, sample_weight])

Configure whether metadata should be requested to be passed to the score method.

train(x_train, y_train[, x_validation, ...])

Train the model with the provided data.

validate_and_transform(raw_data)

It takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.

Attributes

CATEGORICAL_ENCODING

COLOR

COMPATIBLE_COMPONENTS

DISPLAY_NAME

TYPE