{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/15435","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/15435/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/15435/comments","events_url":"https://api.github.com/repos/apache/spark/issues/15435/events","html_url":"https://github.com/apache/spark/pull/15435","id":182317661,"number":15435,"title":"[SPARK-17139][ML] Add model summary for MultinomialLogisticRegression","user":{"login":"WeichenXu123","id":19235986,"avatar_url":"https://avatars.githubusercontent.com/u/19235986?v=3","gravatar_id":"","url":"https://api.github.com/users/WeichenXu123","html_url":"https://github.com/WeichenXu123","followers_url":"https://api.github.com/users/WeichenXu123/followers","following_url":"https://api.github.com/users/WeichenXu123/following{/other_user}","gists_url":"https://api.github.com/users/WeichenXu123/gists{/gist_id}","starred_url":"https://api.github.com/users/WeichenXu123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeichenXu123/subscriptions","organizations_url":"https://api.github.com/users/WeichenXu123/orgs","repos_url":"https://api.github.com/users/WeichenXu123/repos","events_url":"https://api.github.com/users/WeichenXu123/events{/privacy}","received_events_url":"https://api.github.com/users/WeichenXu123/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2016-10-11T16:55:07Z","updated_at":"2016-10-27T05:47:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/15435","html_url":"https://github.com/apache/spark/pull/15435","diff_url":"https://github.com/apache/spark/pull/15435.diff","patch_url":"https://github.com/apache/spark/pull/15435.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nAdd model summary for MultinomialLogisticRegression.\r\ncurrently, using `MulticlassMetrics` to do the summary.\r\n\r\nbecause multi-class case has some differences with binary case,\r\n~~I just expose the `MulticlassMetrics` interface about summary for now.~~\r\ncurrently, I expose the following interfaces:\r\n\r\nlabels,\r\nfalsePositiveRateByLabel,\r\nprecisionByLabel,\r\nrecallByLabel,\r\nfMeasureByLabel,\r\naccuracy,\r\nweightedFalsePositiveRate,\r\nweightedPrecision,\r\nweightedRecall,\r\nweightedFMeasure\r\n\r\n~~And I add `findSummaryModelAndPredictionCol` method because the `MulticlassMetrics` need the `predictionCol` value. Although the `predictionCol` can be calculated from `probabilityCol`,  put some code here to do this thing will cause repeated code, so I do not use that way.~~\r\n\r\nbecause `MulticlassMetrics` need the `predictionCol` value, I use a udf to calculate it from `probabilityCol` value. So that it won't break the `LogisticRegressionSummary` interface.\r\n\r\n## How was this patch tested?\r\n\r\nExisting tests & added tests.\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/256552257","html_url":"https://github.com/apache/spark/pull/15435#issuecomment-256552257","issue_url":"https://api.github.com/repos/apache/spark/issues/15435","id":256552257,"user":{"login":"zhengruifeng","id":7322292,"avatar_url":"https://avatars.githubusercontent.com/u/7322292?v=3","gravatar_id":"","url":"https://api.github.com/users/zhengruifeng","html_url":"https://github.com/zhengruifeng","followers_url":"https://api.github.com/users/zhengruifeng/followers","following_url":"https://api.github.com/users/zhengruifeng/following{/other_user}","gists_url":"https://api.github.com/users/zhengruifeng/gists{/gist_id}","starred_url":"https://api.github.com/users/zhengruifeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhengruifeng/subscriptions","organizations_url":"https://api.github.com/users/zhengruifeng/orgs","repos_url":"https://api.github.com/users/zhengruifeng/repos","events_url":"https://api.github.com/users/zhengruifeng/events{/privacy}","received_events_url":"https://api.github.com/users/zhengruifeng/received_events","type":"User","site_admin":false},"created_at":"2016-10-27T05:47:46Z","updated_at":"2016-10-27T05:47:46Z","body":"It seems that many metrics in `MultinomialLogisticRegressionSummary` are generic to other classification algos. So what about create a new class `MultiClassificationSummary` and put it in a new file? Just like what @yanboliang does in https://github.com/apache/spark/pull/15555"}}
{"actor":{"display_login":"zhengruifeng"}}