payload: {"action":"opened","issue":{"url":"https://api.github.com/repos/SeldonIO/seldon-core/issues/461","repository_url":"https://api.github.com/repos/SeldonIO/seldon-core","labels_url":"https://api.github.com/repos/SeldonIO/seldon-core/issues/461/labels{/name}","comments_url":"https://api.github.com/repos/SeldonIO/seldon-core/issues/461/comments","events_url":"https://api.github.com/repos/SeldonIO/seldon-core/issues/461/events","html_url":"https://github.com/SeldonIO/seldon-core/issues/461","id":418490580,"node_id":"MDU6SXNzdWU0MTg0OTA1ODA=","number":461,"title":"Sending an object dtype array as the request JSON for a Model API","user":{"login":"nsriram13","id":5950690,"node_id":"MDQ6VXNlcjU5NTA2OTA=","avatar_url":"https://avatars2.githubusercontent.com/u/5950690?v=4","gravatar_id":"","url":"https://api.github.com/users/nsriram13","html_url":"https://github.com/nsriram13","followers_url":"https://api.github.com/users/nsriram13/followers","following_url":"https://api.github.com/users/nsriram13/following{/other_user}","gists_url":"https://api.github.com/users/nsriram13/gists{/gist_id}","starred_url":"https://api.github.com/users/nsriram13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsriram13/subscriptions","organizations_url":"https://api.github.com/users/nsriram13/orgs","repos_url":"https://api.github.com/users/nsriram13/repos","events_url":"https://api.github.com/users/nsriram13/events{/privacy}","received_events_url":"https://api.github.com/users/nsriram13/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-03-07T20:07:21Z","updated_at":"2019-03-07T20:07:21Z","closed_at":null,"author_association":"NONE","body":"I am building an sklearn pipeline that involves some pre-processing (specifically one-hot-encoding categorical variables and scaling numeric variables) which then gets forwarded to a classifier. I have provided the pipeline below (inspired by this [blog](https://jorisvandenbossche.github.io/blog/2018/05/28/scikit-learn-columntransformer/)):\r\n\r\n```\r\nimport joblib\r\nimport pandas as pd\r\n\r\nfrom sklearn.preprocessing import StandardScaler, OneHotEncoder\r\nfrom sklearn.compose import ColumnTransformer, make_column_transformer\r\nfrom sklearn.model_selection import train_test_split\r\nfrom sklearn.pipeline import make_pipeline\r\nfrom sklearn.linear_model import LogisticRegression\r\nfrom sklearn.impute import SimpleImputer\r\n\r\ntitanic = pd.read_csv(\"https://raw.githubusercontent.com/amueller/scipy-2017-sklearn/master/notebooks/datasets/titanic3.csv\")\r\ntarget = titanic.survived.values\r\nfeatures = titanic[['pclass', 'sex', 'age', 'fare', 'embarked']].copy()\r\nX_train, X_test, y_train, y_test = train_test_split(features, target, random_state=0)\r\n\r\nnumerical_features = features.dtypes == 'float'\r\ncategorical_features = ~numerical_features\r\n\r\npreprocess = make_column_transformer(\r\n    (make_pipeline(SimpleImputer(strategy='median'), StandardScaler()), numerical_features),\r\n    (make_pipeline(SimpleImputer(strategy='constant', fill_value='missing'), OneHotEncoder(handle_unknown='ignore')), categorical_features))\r\n\r\nmodel = make_pipeline(\r\n    preprocess,\r\n    LogisticRegression(solver='lbfgs'))\r\n\r\nmodel.fit(X_train, y_train)\r\nprint(\"logistic regression score: %f\" % model.score(X_test, y_test))\r\njoblib.dump(model, 'model.joblib')\r\n```\r\n\r\nI am saving the trained model and then using that to create a Docker image to be deployed using s2i based on the model template app ([link](https://github.com/SeldonIO/seldon-core/tree/master/wrappers/s2i/python/test/model-template-app)). I am able to successfully build the image and have it run locally.\r\n\r\nNow I am trying to test by sending in a curl request to a predict endpoint. But I am not sure what the input format should be like. An example input to the model is an array like so:\r\n```\r\narray([[1, 'female', 29.0, 211.3375, 'S']], dtype=object)\r\n```\r\n\r\nAll examples seemed to point to the use case were all input array was all numeric. I did not find an example where we can send this mixed object type. \r\n\r\nCan you please let me know if this is possible in seldon-core or should I always assume that the input has to be numeric. If so, is there a recommended way of deploying this pipeline.\r\n\r\n"}}
other: {"actor":{"display_login":"nsriram13"}}