{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/9581","labels_url":"https://api.github.com/repos/apache/spark/issues/9581/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/9581/comments","events_url":"https://api.github.com/repos/apache/spark/issues/9581/events","html_url":"https://github.com/apache/spark/pull/9581","id":116007035,"number":9581,"title":"[SPARK-7675][ML][PYSpark] sparkml params type conversion","user":{"login":"holdenk","id":59893,"avatar_url":"https://avatars.githubusercontent.com/u/59893?v=3","gravatar_id":"","url":"https://api.github.com/users/holdenk","html_url":"https://github.com/holdenk","followers_url":"https://api.github.com/users/holdenk/followers","following_url":"https://api.github.com/users/holdenk/following{/other_user}","gists_url":"https://api.github.com/users/holdenk/gists{/gist_id}","starred_url":"https://api.github.com/users/holdenk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holdenk/subscriptions","organizations_url":"https://api.github.com/users/holdenk/orgs","repos_url":"https://api.github.com/users/holdenk/repos","events_url":"https://api.github.com/users/holdenk/events{/privacy}","received_events_url":"https://api.github.com/users/holdenk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-11-10T01:41:49Z","updated_at":"2016-01-05T08:04:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/9581","html_url":"https://github.com/apache/spark/pull/9581","diff_url":"https://github.com/apache/spark/pull/9581.diff","patch_url":"https://github.com/apache/spark/pull/9581.patch"},"body":"From JIRA:\r\nCurrently, PySpark wrappers for spark.ml Scala classes are brittle when accepting Param types. E.g., Normalizer's \"p\" param cannot be set to \"2\" (an integer); it must be set to \"2.0\" (a float). Fixing this is not trivial since there does not appear to be a natural place to insert the conversion before Python wrappers call Java's Params setter method.\r\n\r\n\r\nA possible fix will be to include a method \"_checkType\" to PySpark's Param class which checks the type, prints an error if needed, and converts types when relevant (e.g., int to float, or scipy matrix to array). The Java wrapper method which copies params to Scala can call this method when available.\r\n\r\nThis fix instead checks the types at set time since I think failing sooner is better, but I can switch it around to check at copy time if that would be better. So far this only converts int to float and other conversions (like scipymatrix to array) are left for the future."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/168930029","html_url":"https://github.com/apache/spark/pull/9581#issuecomment-168930029","issue_url":"https://api.github.com/repos/apache/spark/issues/9581","id":168930029,"user":{"login":"AmplabJenkins","id":4031291,"avatar_url":"https://avatars.githubusercontent.com/u/4031291?v=3","gravatar_id":"","url":"https://api.github.com/users/AmplabJenkins","html_url":"https://github.com/AmplabJenkins","followers_url":"https://api.github.com/users/AmplabJenkins/followers","following_url":"https://api.github.com/users/AmplabJenkins/following{/other_user}","gists_url":"https://api.github.com/users/AmplabJenkins/gists{/gist_id}","starred_url":"https://api.github.com/users/AmplabJenkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmplabJenkins/subscriptions","organizations_url":"https://api.github.com/users/AmplabJenkins/orgs","repos_url":"https://api.github.com/users/AmplabJenkins/repos","events_url":"https://api.github.com/users/AmplabJenkins/events{/privacy}","received_events_url":"https://api.github.com/users/AmplabJenkins/received_events","type":"User","site_admin":false},"created_at":"2016-01-05T08:04:36Z","updated_at":"2016-01-05T08:04:36Z","body":"Test PASSed.\nRefer to this link for build results (access rights to CI server needed): \nhttps://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/48746/\nTest PASSed."}}