{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/11581","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/11581/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/11581/comments","events_url":"https://api.github.com/repos/apache/spark/issues/11581/events","html_url":"https://github.com/apache/spark/pull/11581","id":139357851,"number":11581,"title":"[SPARK-11888] [ML] Decision tree persistence in spark.ml","user":{"login":"jkbradley","id":5084283,"avatar_url":"https://avatars.githubusercontent.com/u/5084283?v=3","gravatar_id":"","url":"https://api.github.com/users/jkbradley","html_url":"https://github.com/jkbradley","followers_url":"https://api.github.com/users/jkbradley/followers","following_url":"https://api.github.com/users/jkbradley/following{/other_user}","gists_url":"https://api.github.com/users/jkbradley/gists{/gist_id}","starred_url":"https://api.github.com/users/jkbradley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkbradley/subscriptions","organizations_url":"https://api.github.com/users/jkbradley/orgs","repos_url":"https://api.github.com/users/jkbradley/repos","events_url":"https://api.github.com/users/jkbradley/events{/privacy}","received_events_url":"https://api.github.com/users/jkbradley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2016-03-08T18:38:01Z","updated_at":"2016-03-16T14:45:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/11581","html_url":"https://github.com/apache/spark/pull/11581","diff_url":"https://github.com/apache/spark/pull/11581.diff","patch_url":"https://github.com/apache/spark/pull/11581.patch"},"body":"### What changes were proposed in this pull request?\r\n\r\nMade these MLReadable and MLWritable: DecisionTreeClassifier, DecisionTreeClassificationModel, DecisionTreeRegressor, DecisionTreeRegressionModel\r\n* The shared implementation is in treeModels.scala\r\n* I use case classes to create a DataFrame to save, and I use the Dataset API to parse loaded files.\r\n\r\nOther changes:\r\n* Made CategoricalSplit.numCategories public (to use in persistence)\r\n* Fixed a bug in DefaultReadWriteTest.testEstimatorAndModelReadWrite, where it did not call the checkModelData function passed as an argument.  This caused an error in LDASuite, which I fixed.\r\n\r\n### How was this patch tested?\r\n\r\nPersistence is tested via unit tests.  For each algorithm, there are 2 non-trivial trees (depth 2).  One is built with continuous features, and one with categorical; this ensures that both types of splits are tested.\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/197361857","html_url":"https://github.com/apache/spark/pull/11581#issuecomment-197361857","issue_url":"https://api.github.com/repos/apache/spark/issues/11581","id":197361857,"user":{"login":"yanboliang","id":1962026,"avatar_url":"https://avatars.githubusercontent.com/u/1962026?v=3","gravatar_id":"","url":"https://api.github.com/users/yanboliang","html_url":"https://github.com/yanboliang","followers_url":"https://api.github.com/users/yanboliang/followers","following_url":"https://api.github.com/users/yanboliang/following{/other_user}","gists_url":"https://api.github.com/users/yanboliang/gists{/gist_id}","starred_url":"https://api.github.com/users/yanboliang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yanboliang/subscriptions","organizations_url":"https://api.github.com/users/yanboliang/orgs","repos_url":"https://api.github.com/users/yanboliang/repos","events_url":"https://api.github.com/users/yanboliang/events{/privacy}","received_events_url":"https://api.github.com/users/yanboliang/received_events","type":"User","site_admin":false},"created_at":"2016-03-16T14:45:35Z","updated_at":"2016-03-16T14:45:35Z","body":"@jkbradley Looks good for me now, thanks."}}