module search_rank.search_engine_predictions

Inheritance diagram of mlinsights.search_rank.search_engine_predictions

Short summary

module mlinsights.search_rank.search_engine_predictions

Implements a way to get close examples based on the output of a machine learned model.

source on GitHub

Classes

class

truncated documentation

SearchEnginePredictions

Extends class SearchEngineVectors by looking for neighbors to a vector X by looking neighbors to f(X)

Methods

method

truncated documentation

__init__

__repr__

usual

fit

Every vector comes with a list of metadata.

kneighbors

Searches for neighbors close to X.

Documentation

Implements a way to get close examples based on the output of a machine learned model.

source on GitHub

class mlinsights.search_rank.search_engine_predictions.SearchEnginePredictions(fct, fct_params=None, **knn)[source]

Bases: mlinsights.search_rank.search_engine_vectors.SearchEngineVectors

Extends class SearchEngineVectors by looking for neighbors to a vector X by looking neighbors to f(X) and not X. f can be any function which converts a vector into another one or a machine learned model. In that case, f will be set to a default behavior. See function model_featurizer.

source on GitHub

Parameters

source on GitHub

__init__(fct, fct_params=None, **knn)[source]
Parameters

source on GitHub

__repr__()[source]

usual

source on GitHub

fit(data=None, features=None, metadata=None)[source]

Every vector comes with a list of metadata.

Parameters
  • data – a dataframe or None if the the features and the metadata are specified with an array and a dictionary

  • features – features columns or an array

  • metadata – data

source on GitHub

kneighbors(X, n_neighbors=None)[source]

Searches for neighbors close to X.

Parameters

X – features

Returns

score, ind, meta

score is an array representing the lengths to points, ind contains the indices of the nearest points in the population matrix, meta is the metadata.

source on GitHub