POST /predict
hippocrates vision, model API
This method allows users to request a petition to a given deployed API from a trained vision hippocrates model
Request
The Following structure must be followed
{
zip_gcloud : str,
label_cols : list <str>,
images_col : str,
model_type : int,
optimization_type : int,
experiment_id : int,
user_token : str,
user_id : str,
study_type : str,
type_of_experiment : str,
task : str,
data_cols : list<str>,
optimization_metric : str
}
Request specifications
- zip_gcloud : Download link of the .zip file in the Google Cloud bucket (EJ: “User_X/Experiment-#X/file.zip”)
- label_cols : NAME of the column that contains the labels that the algorithm will use in the training/validation/testing process (EJ: [“label”])
- images_col : NAME of the column that contains the complete path of the images used for the training/validation/testing process (only if @task is “vision”) (EJ: “ruta”)
- model_type : Defines the type of algorithm that will be generated
- int 0 : Classification algorithm
- int 1 : Regression algorithm
- optimization_type : Defines the priority for the creation of the algorithm
- int 0 : Prioritize precision
- int 1 : Prioritize time
- experiment_id : Number set to identify the experiment
- user_token : Token to identify the user with @user_id
- user_id : a string that identifys the User running the experiment
- study_type : Defines the type of studiy being performed
- “Hippocrates” : Building a model of @model_type defined
- “Retrospective” : Building a retrospective study to test a model on given data (not implemented yet)
- task : Defines the type of task that need to solve the algorithm
- “vision” : an algorithm that only uses images as input
- “data” : an algorithm that uses structured data as input
- data_cols : Column NAMES containint the structured data that Hippocrated must use to build the algorithm (EJ: [“Column1”, “Column2”, etc]
- optimization_metric : defines the metric that will be taken into account for evaluation of the algorithm
- “AUC”
- “F-macro”
- “Precision”
- “Recall”
- body can’t be empty and must include a direct link to a valid image uri
string
. Request body must follow this structure: {“message”: uri (string
)}
Response
If succeeds, returns the created thing.
Status: 201 Created
{
prediccion: list<Boolean>,
score: dict,
classes: dict,
error: boolean
columnas: int
filas:int
gradients:dict
}
Response specifications
- “error”: Returns 0 for a succesful prediction otherwise it’s 1.
- “classes”: Dictionary with class semantic meanings, ex: {“0”:”Normal”, “1”:”Patológica”}.
- “prediccion”: List of binary values with length equal to class numbers, if class i is predicted as positive, it is returned with a value of 1, otherwise, it’s 0
- “score”: List of float, contains model scores for each prediction, has the same length as prediccion
- “filas”: Int, not relevant for user.
- “columnas”: Int, not relevant for user.
- “gradients”: Dictionary with keys related to each position i for which prediccion returned 1. Values correspond to a list of lists (Activation values per pixel in range [0-255]) for each of these keys.
Ex: {“1”:<list<list
>>}