sgbaird commited on
Commit
2423e7a
1 Parent(s): 3d21777

revert predict wrapper

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -10,19 +10,9 @@ X, y = load_linnerud(return_X_y=True, as_frame=True)
10
  regr = MultiOutputRegressor(Ridge(random_state=123)).fit(X, y)
11
  # example usage: regr.predict(X.iloc[[0]])
12
 
13
-
14
- def predict(X):
15
- max_rows = 100000
16
- if X.shape[0] > max_rows:
17
- raise ValueError(
18
- f"Too many rows ({X.shape[0]}), please use less than {max_rows} rows."
19
- )
20
- return regr.predict(X)
21
-
22
-
23
  iface = gr.Interface(
24
  title="MultiOutputRegressor Example",
25
- fn=predict,
26
  inputs=gr.Dataframe(
27
  value=X.head(1),
28
  headers=list(X.columns),
@@ -38,3 +28,13 @@ iface = gr.Interface(
38
  ),
39
  )
40
  iface.launch()
 
 
 
 
 
 
 
 
 
 
 
10
  regr = MultiOutputRegressor(Ridge(random_state=123)).fit(X, y)
11
  # example usage: regr.predict(X.iloc[[0]])
12
 
 
 
 
 
 
 
 
 
 
 
13
  iface = gr.Interface(
14
  title="MultiOutputRegressor Example",
15
+ fn=regr.predict,
16
  inputs=gr.Dataframe(
17
  value=X.head(1),
18
  headers=list(X.columns),
 
28
  ),
29
  )
30
  iface.launch()
31
+
32
+ # %% Code Graveyard
33
+
34
+ # def predict(X):
35
+ # max_rows = 100000
36
+ # if X.shape[0] > max_rows:
37
+ # raise ValueError(
38
+ # f"Too many rows ({X.shape[0]}), please use less than {max_rows} rows."
39
+ # )
40
+ # return regr.predict(X)