aduzlo commited on
Commit
1a28591
1 Parent(s): 8b00c97

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +5 -10
handler.py CHANGED
@@ -7,17 +7,12 @@ class EndpointHandler:
7
  self.model = joblib.load(path + "/valid_trial_v3_2.joblib")
8
 
9
  def __call__(self, data: Dict[str, Any]) -> List[Any]:
10
- """
11
- data args:
12
- inputs (:obj: `str`)
13
- date (:obj: `str`)
14
- Return:
15
- A :obj:`list`
16
- """
17
  # get inputs
18
- input = data.pop("input", data)
19
- input_series = pd.Series(input)
 
20
 
21
  # run normal prediction
22
- prediction = self.model.predict_proba(input_series)[:, 1]
23
  return prediction
 
7
  self.model = joblib.load(path + "/valid_trial_v3_2.joblib")
8
 
9
  def __call__(self, data: Dict[str, Any]) -> List[Any]:
10
+
 
 
 
 
 
 
11
  # get inputs
12
+ s_in = data.pop("inputs", data)
13
+ s_in = pd.Series(s_in)
14
+ d_in = pd.DataFrame(s_in).transpose()
15
 
16
  # run normal prediction
17
+ prediction = self.model.predict_proba(d_in)[:, 1]
18
  return prediction