Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# define node inputs and outputs
inputs = [{
"name": transformer.input_features,
"port": "input"
}]
outputs = [{
"name": transformer.prediction_column,
"port": "output"
}]
self.serialize(transformer, path, model_name, attributes, inputs, outputs)
class TfidfVectorizerSerializer(MLeapSerializer):
pipeline_serializer = PipelineSerializer()
def __init__(self):
super(TfidfVectorizerSerializer, self).__init__()
@staticmethod
def set_prediction_column(transformer, prediction_column):
transformer.prediction_column = prediction_column
@staticmethod
def set_input_features(transformer, input_features):
transformer.input_features = input_features
def serialize_to_bundle(self, transformer, path, model_name):
num_features = transformer.idf_.shape[0]
vocabulary = [None] * num_features