Skip to content

Commit 0495c31

Browse files
committed
clean up comments
1 parent f509f16 commit 0495c31

4 files changed

Lines changed: 1 addition & 13 deletions

File tree

vetiver/handlers/sklearn.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,10 @@ def handler_predict(self, input_data, check_prototype):
3333
prediction
3434
Prediction from model
3535
"""
36-
# if check_prototype:
37-
# input_data = api_data_to_frame(input_data)
3836

3937
if not check_prototype or isinstance(input_data, pd.DataFrame):
4038
prediction = self.model.predict(input_data)
4139
else:
4240
prediction = self.model.predict([input_data])
4341

44-
# some sort of post-prediction/pre send back to user hook
45-
4642
return prediction.tolist()

vetiver/handlers/statsmodels.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ def handler_predict(self, input_data, check_prototype):
4242
if not sm_exists:
4343
raise ImportError("Cannot import `statsmodels`")
4444

45-
# if check_prototype:
46-
# input_data = api_data_to_frame(input_data)
47-
4845
if isinstance(input_data, (list, pd.DataFrame)):
4946
prediction = self.model.predict(input_data)
5047
else:

vetiver/handlers/torch.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,8 @@ def handler_predict(self, input_data, check_prototype):
4343
raise ImportError("Cannot import `torch`.")
4444

4545
if check_prototype:
46-
# input_data = api_data_to_frame(input_data)
4746
input_data = np.array(input_data, dtype=np.array(self.prototype_data).dtype)
4847
prediction = self.model(torch.from_numpy(input_data))
49-
50-
# do not check ptype
5148
else:
5249
input_data = torch.tensor(input_data)
5350
prediction = self.model(input_data)

vetiver/handlers/xgboost.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,12 @@ def handler_predict(self, input_data, check_prototype):
4343
if not xgb_exists:
4444
raise ImportError("Cannot import `xgboost`")
4545

46-
# if check_prototype:
47-
# input_data = api_data_to_frame(input_data)
48-
4946
if not isinstance(input_data, pd.DataFrame):
5047
try:
5148
input_data = pd.DataFrame(input_data)
5249
except ValueError:
5350
raise (f"Expected a dict or DataFrame, got {type(input_data)}")
51+
5452
input_data = xgboost.DMatrix(input_data)
5553

5654
prediction = self.model.predict(input_data)

0 commit comments

Comments
 (0)