{"action":"created","comment":{"url":"https://api.github.com/repos/linkedin/photon-ml/pulls/comments/82108541","pull_request_review_id":3038383,"id":82108541,"diff_hunk":"@@ -69,3 +70,14 @@ class SmoothedHingeLossLinearSVMModel(override val coefficients: Coefficients)\n     }\n   }\n }\n+\n+object SmoothedHingeLossLinearSVMModel {\n+  /**\n+   * Create a new smoothed hinge loss SVM model with the provided coefficients (means) and variances\n+   *\n+   * @param coefficients The feature coefficient means and variances for the model\n+   * @return A smoothed hinge loss SVM model\n+   */\n+  def createModel(coefficients: Coefficients): SmoothedHingeLossLinearSVMModel =\n+    new SmoothedHingeLossLinearSVMModel(coefficients)","path":"photon-ml/src/main/scala/com/linkedin/photon/ml/supervised/classification/SmoothedHingeLossLinearSVMModel.scala","position":55,"original_position":55,"commit_id":"ad129ceba4760a4ece156bde78cf406f7f4a18eb","original_commit_id":"6329f575a5eaa1c9ed7260ab5cf47dccb845975a","user":{"login":"ashelkovnykov","id":4383244,"avatar_url":"https://avatars.githubusercontent.com/u/4383244?v=3","gravatar_id":"","url":"https://api.github.com/users/ashelkovnykov","html_url":"https://github.com/ashelkovnykov","followers_url":"https://api.github.com/users/ashelkovnykov/followers","following_url":"https://api.github.com/users/ashelkovnykov/following{/other_user}","gists_url":"https://api.github.com/users/ashelkovnykov/gists{/gist_id}","starred_url":"https://api.github.com/users/ashelkovnykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashelkovnykov/subscriptions","organizations_url":"https://api.github.com/users/ashelkovnykov/orgs","repos_url":"https://api.github.com/users/ashelkovnykov/repos","events_url":"https://api.github.com/users/ashelkovnykov/events{/privacy}","received_events_url":"https://api.github.com/users/ashelkovnykov/received_events","type":"User","site_admin":false},"body":"For the regression model classes (LinearRegressionModel, LogisticRegressionModel, etc.) it's necessary to keep the GeneralizedLinearOptimizationProblem and descendants simple and avoid the type/covariance issues we had prior to the refactor.\r\n\r\nFor the OptimizerFactory, it's a standard implementation of the Factory Pattern: we don't know what kind of Optimizer to generate until runtime. \r\n\r\nFor the optimization problem classes it's just a convenience method, it's not necessary. In these cases the factory methods serve as constructors.\r\n\r\nAfter I noticed that I was using the factory pattern, I decided I may as well restrict object construction for those classes to the factory method. I don't have any hard reasoning, it just seemed natural to fully commit to the factory pattern, also to limit access as strictly as possible and then loosen it if necessary.","created_at":"2016-10-06T02:36:34Z","updated_at":"2016-10-06T02:36:34Z","html_url":"https://github.com/linkedin/photon-ml/pull/131#discussion_r82108541","pull_request_url":"https://api.github.com/repos/linkedin/photon-ml/pulls/131","_links":{"self":{"href":"https://api.github.com/repos/linkedin/photon-ml/pulls/comments/82108541"},"html":{"href":"https://github.com/linkedin/photon-ml/pull/131#discussion_r82108541"},"pull_request":{"href":"https://api.github.com/repos/linkedin/photon-ml/pulls/131"}}},"pull_request":{"url":"https://api.github.com/repos/linkedin/photon-ml/pulls/131","id":75725684,"html_url":"https://github.com/linkedin/photon-ml/pull/131","diff_url":"https://github.com/linkedin/photon-ml/pull/131.diff","patch_url":"https://github.com/linkedin/photon-ml/pull/131.patch","issue_url":"https://api.github.com/repos/linkedin/photon-ml/issues/131","number":131,"state":"open","locked":false,"title":"Objective Function Refactor","user":{"login":"ashelkovnykov","id":4383244,"avatar_url":"https://avatars.githubusercontent.com/u/4383244?v=3","gravatar_id":"","url":"https://api.github.com/users/ashelkovnykov","html_url":"https://github.com/ashelkovnykov","followers_url":"https://api.github.com/users/ashelkovnykov/followers","following_url":"https://api.github.com/users/ashelkovnykov/following{/other_user}","gists_url":"https://api.github.com/users/ashelkovnykov/gists{/gist_id}","starred_url":"https://api.github.com/users/ashelkovnykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashelkovnykov/subscriptions","organizations_url":"https://api.github.com/users/ashelkovnykov/orgs","repos_url":"https://api.github.com/users/ashelkovnykov/repos","events_url":"https://api.github.com/users/ashelkovnykov/events{/privacy}","received_events_url":"https://api.github.com/users/ashelkovnykov/received_events","type":"User","site_admin":false},"body":"PR for issue #122 \r\n\r\nMajor changes include:\r\n- Split `LBFGS` and `OWLQN` optimizers\r\n- Removed all `withL1Regularization()` / `withL2Regularization()` code from the differentiable traits\r\n- Removed the `L1RegularizationTerm` trait (choosing between `LBFGS` and `OWLQN` happens in the `OptimizerFactory` using the `RegularizationContext`\r\n- Moved L2 regularization code to the stackable `L2Regularization` trait\r\n- Created the `ObjectiveFunction` class as a base for the `DiffFunction`, `TwiceDiffFunction`, and `L2Regularization` traits\r\n- RDD ownership has been removed wherever possible, working towards a pipeline of transformers\r\n- The optimization problems and objective functions have been split into one class for Iterable[LabeledPoint] and one class for RDD[LabeledPoint]\r\n- The `AbstractOptimizer` and `Optimizer` have been merged into a single class\r\n- The hacky typing and contravariance issues from the first refactor have been resolved\r\n\r\n**TODO:** Performance tests between Photon and GAME from before the refactor","created_at":"2016-06-29T21:34:19Z","updated_at":"2016-10-06T02:36:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"61b8f811730c489c463b4de982219336ad55bff9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/linkedin/photon-ml/pulls/131/commits","review_comments_url":"https://api.github.com/repos/linkedin/photon-ml/pulls/131/comments","review_comment_url":"https://api.github.com/repos/linkedin/photon-ml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/linkedin/photon-ml/issues/131/comments","statuses_url":"https://api.github.com/repos/linkedin/photon-ml/statuses/ad129ceba4760a4ece156bde78cf406f7f4a18eb","head":{"label":"ashelkovnykov:objf","ref":"objf","sha":"ad129ceba4760a4ece156bde78cf406f7f4a18eb","user":{"login":"ashelkovnykov","id":4383244,"avatar_url":"https://avatars.githubusercontent.com/u/4383244?v=3","gravatar_id":"","url":"https://api.github.com/users/ashelkovnykov","html_url":"https://github.com/ashelkovnykov","followers_url":"https://api.github.com/users/ashelkovnykov/followers","following_url":"https://api.github.com/users/ashelkovnykov/following{/other_user}","gists_url":"https://api.github.com/users/ashelkovnykov/gists{/gist_id}","starred_url":"https://api.github.com/users/ashelkovnykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashelkovnykov/subscriptions","organizations_url":"https://api.github.com/users/ashelkovnykov/orgs","repos_url":"https://api.github.com/users/ashelkovnykov/repos","events_url":"https://api.github.com/users/ashelkovnykov/events{/privacy}","received_events_url":"https://api.github.com/users/ashelkovnykov/received_events","type":"User","site_admin":false},"repo":{"id":56338079,"name":"photon-ml","full_name":"ashelkovnykov/photon-ml","owner":{"login":"ashelkovnykov","id":4383244,"avatar_url":"https://avatars.githubusercontent.com/u/4383244?v=3","gravatar_id":"","url":"https://api.github.com/users/ashelkovnykov","html_url":"https://github.com/ashelkovnykov","followers_url":"https://api.github.com/users/ashelkovnykov/followers","following_url":"https://api.github.com/users/ashelkovnykov/following{/other_user}","gists_url":"https://api.github.com/users/ashelkovnykov/gists{/gist_id}","starred_url":"https://api.github.com/users/ashelkovnykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashelkovnykov/subscriptions","organizations_url":"https://api.github.com/users/ashelkovnykov/orgs","repos_url":"https://api.github.com/users/ashelkovnykov/repos","events_url":"https://api.github.com/users/ashelkovnykov/events{/privacy}","received_events_url":"https://api.github.com/users/ashelkovnykov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ashelkovnykov/photon-ml","description":"A scalable machine learning library on Apache Spark","fork":true,"url":"https://api.github.com/repos/ashelkovnykov/photon-ml","forks_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/forks","keys_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/teams","hooks_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/hooks","issue_events_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/issues/events{/number}","events_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/events","assignees_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/assignees{/user}","branches_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/branches{/branch}","tags_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/tags","blobs_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/git/refs{/sha}","trees_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/statuses/{sha}","languages_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/languages","stargazers_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/stargazers","contributors_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/contributors","subscribers_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/subscribers","subscription_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/subscription","commits_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/commits{/sha}","git_commits_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/git/commits{/sha}","comments_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/comments{/number}","issue_comment_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/issues/comments{/number}","contents_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/contents/{+path}","compare_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/merges","archive_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/downloads","issues_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/issues{/number}","pulls_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/pulls{/number}","milestones_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/milestones{/number}","notifications_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/labels{/name}","releases_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/releases{/id}","deployments_url":"https://api.github.com/repos/ashelkovnykov/photon-ml/deployments","created_at":"2016-04-15T17:28:42Z","updated_at":"2016-04-15T17:28:43Z","pushed_at":"2016-10-03T17:40:38Z","git_url":"git://github.com/ashelkovnykov/photon-ml.git","ssh_url":"git@github.com:ashelkovnykov/photon-ml.git","clone_url":"https://github.com/ashelkovnykov/photon-ml.git","svn_url":"https://github.com/ashelkovnykov/photon-ml","homepage":"","size":33205,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"linkedin:master","ref":"master","sha":"947930bff5fbef080b0e9070c17587d435a8fcc7","user":{"login":"linkedin","id":357098,"avatar_url":"https://avatars.githubusercontent.com/u/357098?v=3","gravatar_id":"","url":"https://api.github.com/users/linkedin","html_url":"https://github.com/linkedin","followers_url":"https://api.github.com/users/linkedin/followers","following_url":"https://api.github.com/users/linkedin/following{/other_user}","gists_url":"https://api.github.com/users/linkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/linkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkedin/subscriptions","organizations_url":"https://api.github.com/users/linkedin/orgs","repos_url":"https://api.github.com/users/linkedin/repos","events_url":"https://api.github.com/users/linkedin/events{/privacy}","received_events_url":"https://api.github.com/users/linkedin/received_events","type":"Organization","site_admin":false},"repo":{"id":50964104,"name":"photon-ml","full_name":"linkedin/photon-ml","owner":{"login":"linkedin","id":357098,"avatar_url":"https://avatars.githubusercontent.com/u/357098?v=3","gravatar_id":"","url":"https://api.github.com/users/linkedin","html_url":"https://github.com/linkedin","followers_url":"https://api.github.com/users/linkedin/followers","following_url":"https://api.github.com/users/linkedin/following{/other_user}","gists_url":"https://api.github.com/users/linkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/linkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkedin/subscriptions","organizations_url":"https://api.github.com/users/linkedin/orgs","repos_url":"https://api.github.com/users/linkedin/repos","events_url":"https://api.github.com/users/linkedin/events{/privacy}","received_events_url":"https://api.github.com/users/linkedin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/linkedin/photon-ml","description":"A scalable machine learning library on Apache Spark","fork":false,"url":"https://api.github.com/repos/linkedin/photon-ml","forks_url":"https://api.github.com/repos/linkedin/photon-ml/forks","keys_url":"https://api.github.com/repos/linkedin/photon-ml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linkedin/photon-ml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linkedin/photon-ml/teams","hooks_url":"https://api.github.com/repos/linkedin/photon-ml/hooks","issue_events_url":"https://api.github.com/repos/linkedin/photon-ml/issues/events{/number}","events_url":"https://api.github.com/repos/linkedin/photon-ml/events","assignees_url":"https://api.github.com/repos/linkedin/photon-ml/assignees{/user}","branches_url":"https://api.github.com/repos/linkedin/photon-ml/branches{/branch}","tags_url":"https://api.github.com/repos/linkedin/photon-ml/tags","blobs_url":"https://api.github.com/repos/linkedin/photon-ml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linkedin/photon-ml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linkedin/photon-ml/git/refs{/sha}","trees_url":"https://api.github.com/repos/linkedin/photon-ml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linkedin/photon-ml/statuses/{sha}","languages_url":"https://api.github.com/repos/linkedin/photon-ml/languages","stargazers_url":"https://api.github.com/repos/linkedin/photon-ml/stargazers","contributors_url":"https://api.github.com/repos/linkedin/photon-ml/contributors","subscribers_url":"https://api.github.com/repos/linkedin/photon-ml/subscribers","subscription_url":"https://api.github.com/repos/linkedin/photon-ml/subscription","commits_url":"https://api.github.com/repos/linkedin/photon-ml/commits{/sha}","git_commits_url":"https://api.github.com/repos/linkedin/photon-ml/git/commits{/sha}","comments_url":"https://api.github.com/repos/linkedin/photon-ml/comments{/number}","issue_comment_url":"https://api.github.com/repos/linkedin/photon-ml/issues/comments{/number}","contents_url":"https://api.github.com/repos/linkedin/photon-ml/contents/{+path}","compare_url":"https://api.github.com/repos/linkedin/photon-ml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linkedin/photon-ml/merges","archive_url":"https://api.github.com/repos/linkedin/photon-ml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linkedin/photon-ml/downloads","issues_url":"https://api.github.com/repos/linkedin/photon-ml/issues{/number}","pulls_url":"https://api.github.com/repos/linkedin/photon-ml/pulls{/number}","milestones_url":"https://api.github.com/repos/linkedin/photon-ml/milestones{/number}","notifications_url":"https://api.github.com/repos/linkedin/photon-ml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linkedin/photon-ml/labels{/name}","releases_url":"https://api.github.com/repos/linkedin/photon-ml/releases{/id}","deployments_url":"https://api.github.com/repos/linkedin/photon-ml/deployments","created_at":"2016-02-03T01:12:07Z","updated_at":"2016-10-05T05:08:00Z","pushed_at":"2016-10-05T22:44:12Z","git_url":"git://github.com/linkedin/photon-ml.git","ssh_url":"git@github.com:linkedin/photon-ml.git","clone_url":"https://github.com/linkedin/photon-ml.git","svn_url":"https://github.com/linkedin/photon-ml","homepage":"","size":33299,"stargazers_count":350,"watchers_count":350,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":72,"mirror_url":null,"open_issues_count":32,"forks":72,"open_issues":32,"watchers":350,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linkedin/photon-ml/pulls/131"},"html":{"href":"https://github.com/linkedin/photon-ml/pull/131"},"issue":{"href":"https://api.github.com/repos/linkedin/photon-ml/issues/131"},"comments":{"href":"https://api.github.com/repos/linkedin/photon-ml/issues/131/comments"},"review_comments":{"href":"https://api.github.com/repos/linkedin/photon-ml/pulls/131/comments"},"review_comment":{"href":"https://api.github.com/repos/linkedin/photon-ml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/linkedin/photon-ml/pulls/131/commits"},"statuses":{"href":"https://api.github.com/repos/linkedin/photon-ml/statuses/ad129ceba4760a4ece156bde78cf406f7f4a18eb"}}}}
{"actor":{"display_login":"ashelkovnykov"}}