def PredictIrisSpecies(self, request, context): model = self.__class__.get_or_create_model() sepal_length = request.sepal_length sepal_width = request.sepal_width petal_length = request.petal_length petal_width = request.petal_width result = model.predict([[sepal_length, sepal_width, petal_length, petal_width]]) return iris_pb2.IrisPredictReply(species=result[0])
def PredictIrisSpecies(self, request): model = self.__class__.get_model() sepal_length = request.sepal_length sepal_width = request.sepal_width petal_length = request.petal_length petal_width = request.petal_width # Previsão do modelo result = model.predict( [[sepal_length, sepal_width, petal_length, petal_width]]) return iris_pb2.IrisPredictReply(species=result[0])