module 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.
Classes#
class |
truncated documentation |
---|---|
Extends class |
Methods#
method |
truncated documentation |
---|---|
usual |
|
Every vector comes with a list of metadata. |
|
Searches for neighbors close to X. |
Documentation#
Implements a way to get close examples based on the output of a machine learned model.
- class mlinsights.search_rank.search_engine_predictions.SearchEnginePredictions(fct, fct_params=None, **knn)#
Bases:
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 functionmodel_featurizer
.- Parameters:
fct – function f applied before looking for neighbors, it can also be a machine learned model
fct_params – parameters sent to function
model_featurizer
pknn – list of parameters, see sklearn.neighborsNearestNeighbors
- __init__(fct, fct_params=None, **knn)#
- Parameters:
fct – function f applied before looking for neighbors, it can also be a machine learned model
fct_params – parameters sent to function
model_featurizer
pknn – list of parameters, see sklearn.neighborsNearestNeighbors
- __repr__()#
usual
- fit(data=None, features=None, metadata=None)#
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
- kneighbors(X, n_neighbors=None)#
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.