karthik-0306 opened a new issue, #41385:
URL: https://github.com/apache/beam/issues/41385

   ### What happened?
   
   `_default_pandas_inference_fn` in `sklearn_inference.py` takes 
`inference_args` but calls `model.predict(vectorized_batch)` without them, 
while `_default_numpy_inference_fn` calls `model.predict(vectorized_batch, 
**inference_args)`. `ModelHandler.validate_inference_args` accepts any 
arguments, so `RunInference(SklearnModelHandlerPandas(...), 
inference_args={...})` silently drops them.
   
   Repro: an estimator whose `predict(X, scale=1)` returns `X.sum(axis=1) * 
scale`, called through `run_inference` with `inference_args={'scale': 10}`, 
gives `10.0` with `SklearnModelHandlerNumpy` and `1.0` with 
`SklearnModelHandlerPandas`.
   
   Expected: `inference_args` are passed to `model.predict`, as in the numpy 
handler. I plan to pass them through in `_default_pandas_inference_fn` and add 
a test.
   
   Version: master at b791929763 (2.79.0.dev).
   
   
   ### Issue Priority
   
   Priority: 2 (default / most bugs should be filed as P2)
   
   ### Issue Components
   
   - [x] Component: Python SDK
   - [ ] Component: Java SDK
   - [ ] Component: Go SDK
   - [ ] Component: Typescript SDK
   - [ ] Component: IO connector
   - [ ] Component: Beam YAML
   - [ ] Component: Beam examples
   - [ ] Component: Beam playground
   - [ ] Component: Beam katas
   - [ ] Component: Website
   - [ ] Component: Infrastructure
   - [ ] Component: Spark Runner
   - [ ] Component: Flink Runner
   - [ ] Component: Prism Runner
   - [ ] Component: Hazelcast Jet Runner
   - [ ] Component: Google Cloud Dataflow Runner


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to