Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
else:
sk_model_obj = get_ensemble_model(pmml)
elif pmml.NaiveBayesModel:
pmml_modelobj = pmml.NaiveBayesModel[0]
sk_model_obj = get_naivebayes_model(pmml)
elif pmml.NearestNeighborModel:
pmml_modelobj = pmml.NearestNeighborModel[0]
sk_model_obj = get_knn_model(pmml)
elif pmml.DeepNetwork:
return GenerateKerasModel(pmml)
else:
raise NotImplementedError("Not Implemented")
if output == "modelOnly":
return sk_model_obj
elif output == "preProcessingPipelineWithModel":
pipe = reconstructPeprocessingPipeline.generate_pipeline(pmml,pmml_modelobj)
if pipe:
pipe.steps.append(("model", sk_model_obj))
return pipe
else:
return sk_model_obj
elif output == "asDictionary":
return {"preProcessingPipeline" : reconstructPeprocessingPipeline.generate_pipeline(pmml,pmml_modelobj), "model" : sk_model_obj}
else:
raise ValueError("Invalid Arguments")
except Exception as err:
print("Error Occurred while reconstructing, details are : {} ".format(str(err)))
print(str(traceback.format_exc()))
sk_model_obj = get_knn_model(pmml)
elif pmml.DeepNetwork:
return GenerateKerasModel(pmml)
else:
raise NotImplementedError("Not Implemented")
if output == "modelOnly":
return sk_model_obj
elif output == "preProcessingPipelineWithModel":
pipe = reconstructPeprocessingPipeline.generate_pipeline(pmml,pmml_modelobj)
if pipe:
pipe.steps.append(("model", sk_model_obj))
return pipe
else:
return sk_model_obj
elif output == "asDictionary":
return {"preProcessingPipeline" : reconstructPeprocessingPipeline.generate_pipeline(pmml,pmml_modelobj), "model" : sk_model_obj}
else:
raise ValueError("Invalid Arguments")
except Exception as err:
print("Error Occurred while reconstructing, details are : {} ".format(str(err)))
print(str(traceback.format_exc()))