{"action":"created","issue":{"url":"https://api.github.com/repos/aws/sagemaker-python-sdk/issues/131","repository_url":"https://api.github.com/repos/aws/sagemaker-python-sdk","labels_url":"https://api.github.com/repos/aws/sagemaker-python-sdk/issues/131/labels{/name}","comments_url":"https://api.github.com/repos/aws/sagemaker-python-sdk/issues/131/comments","events_url":"https://api.github.com/repos/aws/sagemaker-python-sdk/issues/131/events","html_url":"https://github.com/aws/sagemaker-python-sdk/issues/131","id":312043429,"number":131,"title":"Corner Case - One input feature and prediction","user":{"login":"ChandraLingam","id":20747492,"avatar_url":"https://avatars0.githubusercontent.com/u/20747492?v=4","gravatar_id":"","url":"https://api.github.com/users/ChandraLingam","html_url":"https://github.com/ChandraLingam","followers_url":"https://api.github.com/users/ChandraLingam/followers","following_url":"https://api.github.com/users/ChandraLingam/following{/other_user}","gists_url":"https://api.github.com/users/ChandraLingam/gists{/gist_id}","starred_url":"https://api.github.com/users/ChandraLingam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChandraLingam/subscriptions","organizations_url":"https://api.github.com/users/ChandraLingam/orgs","repos_url":"https://api.github.com/users/ChandraLingam/repos","events_url":"https://api.github.com/users/ChandraLingam/events{/privacy}","received_events_url":"https://api.github.com/users/ChandraLingam/received_events","type":"User","site_admin":false},"labels":[{"id":749522466,"url":"https://api.github.com/repos/aws/sagemaker-python-sdk/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-06T16:43:50Z","updated_at":"2018-04-07T10:34:57Z","closed_at":null,"author_association":"NONE","body":"There is an issue with csv serializer when running prediction on a model that has only one input feature.  Serializer or the SageMaker Prediction endpoint is not able to handle single feature models when running predictions.  I used CSV for inference format.\r\n\r\nI don't have the exact error message that was reported by the serializer; wanted to report this issue.  \r\n\r\nI trained the data with XGBoost algorithm\r\n\r\nData set consisted of just X, y\r\nX, y\r\n1,1\r\n2,4\r\n3,9\r\n....\r\n"},"comment":{"url":"https://api.github.com/repos/aws/sagemaker-python-sdk/issues/comments/379459930","html_url":"https://github.com/aws/sagemaker-python-sdk/issues/131#issuecomment-379459930","issue_url":"https://api.github.com/repos/aws/sagemaker-python-sdk/issues/131","id":379459930,"user":{"login":"ChandraLingam","id":20747492,"avatar_url":"https://avatars0.githubusercontent.com/u/20747492?v=4","gravatar_id":"","url":"https://api.github.com/users/ChandraLingam","html_url":"https://github.com/ChandraLingam","followers_url":"https://api.github.com/users/ChandraLingam/followers","following_url":"https://api.github.com/users/ChandraLingam/following{/other_user}","gists_url":"https://api.github.com/users/ChandraLingam/gists{/gist_id}","starred_url":"https://api.github.com/users/ChandraLingam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChandraLingam/subscriptions","organizations_url":"https://api.github.com/users/ChandraLingam/orgs","repos_url":"https://api.github.com/users/ChandraLingam/repos","events_url":"https://api.github.com/users/ChandraLingam/events{/privacy}","received_events_url":"https://api.github.com/users/ChandraLingam/received_events","type":"User","site_admin":false},"created_at":"2018-04-07T10:34:57Z","updated_at":"2018-04-07T10:34:57Z","author_association":"NONE","body":"```\r\nTraining (relevant section):\r\n# content type can be libsvm or csv for XGBoost\r\ntraining_input_config = sagemaker.session.s3_input(s3_data=s3_training_file_location,content_type=\"csv\")\r\nvalidation_input_config = sagemaker.session.s3_input(s3_data=s3_validation_file_location,content_type=\"csv\")\r\n\r\n# fit\r\nestimator.fit({'train':training_input_config, 'validation':validation_input_config})\r\n\r\n# deploy\r\npredictor = estimator.deploy(initial_instance_count=1, instance_type='ml.m4.xlarge',                            endpoint_name = 'my-endpoint')\r\n\r\n# predict\r\narr_test = df.as_matrix([\"x\"])\r\n\r\ntype(arr_test)\r\n>>numpy.ndarray\r\n\r\narr_test.dtype\r\n>>dtype('float64')\r\n\r\narr_test[:5]\r\n\r\n>>\r\narray([[ 4.43986342],\r\n       [17.41464612],\r\n       [ 4.13438311],\r\n       [18.37221816],\r\n       [ 9.76822378]])\r\n\r\n\r\n# predict\r\nresult = predictor.predict(arr_test[:5])\r\n\r\n```\r\n\r\n"}}
{"actor":{"display_login":"ChandraLingam"}}