SklearnProjector#
- class SklearnProjector(config)#
Bases:
Projector
The generic scikit-learn
Projector
step projects from one vector space to another. For more info see Decomposition.Note - So far only svd is supported -> TruncatedSVD
Input - all input fields need to be of type
list
[float
orint
] ornumpy.ndarray
Output - all output fields are filled with data of type
numpy.ndarray
with shape (‘n_components’,)- Parameters
Example
{ "step": "projector", "type": "sklearn", "model_type": "svd", "n_components": 100, "input_field": "embedded_text", "output_field": "embedded_text" }
Methods Summary
load
()Load a step
process_batch
(batch)Process a batch of documents.
save
()Save a step
train
(docs)Train on a step of a set of documents
Methods Documentation
- load()#
Load a step
- process_batch(batch)#
Process a batch of documents. If not defined will default to using self.process_doc for each document in the batch.
- save()#
Save a step