deepinsight.apinode.predict package¶
Submodules¶
deepinsight.apinode.predict.customserver module¶
deepinsight.apinode.predict.functionserver module¶
Single-thread hoster for a custom-code based predictor
-
class
deepinsight.apinode.predict.functionserver.LoadedFunction(code_file, function_name, data_folders=[])¶ Bases:
object-
predict(data)¶
-
-
deepinsight.apinode.predict.functionserver.serve(port, secret)¶
deepinsight.apinode.predict.predictor module¶
-
class
deepinsight.apinode.predict.predictor.ClassificationPredictor(data_folder)¶ Bases:
objectThe base interface for a classification Custom API node predictor
-
predict(df)¶ The main prediction method.
Param: df: a dataframe of 1 or several records to predict Returns: Either: decision_seriesor(decision_series, proba_df)or(decision_series, proba_df, custom_keys_list)decision_series must be a Pandas Series of decisions
proba_df is optional and must contain one column per class
custom_keys_list is optional and must contain one entry per input row. Each entry of custom_keys_list must be a Python dictionary. These custom keys will be sent in the output result
decision_series, proba_df and custom_keys_list must have the same number of rows than df. It is legal to refuse to score a record. Leave a NA in decision_series
-
-
class
deepinsight.apinode.predict.predictor.RegressionPredictor(data_folder)¶ Bases:
objectThe base interface for a classification Custom API node predictor
-
predict(df)¶ The main prediction method.
Param: df: a dataframe of 1 or several records to predict Returns: Either: prediction_seriesor(prediction_series, custom_keys_list)prediction_series must be a Pandas Series of decisions
custom_keys_list is optional and must contain one entry per input row. Each entry of custom_keys_list must be a Python dictionary. These custom keys will be sent in the output result
prediction_series and custom_keys_list must have the same number of rows than df. It is legal to refuse to score a record. Leave a NA in prediction_series
-
deepinsight.apinode.predict.server module¶
Single-thread hoster for a “legacy” scikit-learn based predictor
-
deepinsight.apinode.predict.server.handle_predict(predictor, data)¶
-
deepinsight.apinode.predict.server.pred_to_dict(pred_df, nb_records)¶
-
deepinsight.apinode.predict.server.serve(port, secret)¶