AgileDataScienceUB / ADS4

0 stars 0 forks source link

Define communication protocol (in/out) for the prediction service #35

Closed acompanys closed 6 years ago

acompanys commented 6 years ago

DoD:Create a markdown document defining how communication between client and API should be implemented. Effort: 2

riccardobucco commented 6 years ago

Method: POST Path: /create-predictor Body The body must contain the following keys:

The server mainly relies on the following features (they're optional, a file can contain all of them, few of them or none of them): employee_id, record_id, hire_date, record_date, termination_date, length_of_service, age, birth_date, birth_year and job_title. They're content is described here: https://github.com/AgileDataScienceUB/ADS4/wiki/Data-consolidation.

Since the file that the client uploads could use different names for these features, in the body of the request you can optionally specify the names that are used in the file, so that the server can use properly the content of each column.

Example Let's say that you have the following CSV file

A,B,C,D,E
1556,34,5,developer,1
1557,41,10,analyst,0
1558,25,3,developer,0

where A represents the employee id, B represents the age of the employee, C represents the length of service, D represents the job title and E the target (whether the employee left or not the job). The body of a possible request can be the following one:

{
"file": (the CSV file that you want to upload),
"target": "E",
"employee_id": "A",
"age": "B",
"length_of_service": "C",
"job_title": "D"
}
riccardobucco commented 6 years ago

@MCardus Look at the interface and tell me if you have any problems with that. I'm working on the interface of the predict method now