{"action":"created","comment":{"url":"https://api.github.com/repos/EducationalTestingService/rsmtool/pulls/comments/85451166","pull_request_review_id":6167930,"id":85451166,"diff_hunk":"@@ -571,6 +572,32 @@ def train_builtin_model(model_name, df_train, experiment_id, csvdir, figdir):\n         # we used only the non-zero features\n         used_features = non_zero_features\n \n+    elif model_name == 'WeightedLeastSquares':\n+\n+        # train weighted least squares regression \n+        # get the feature columns\n+\n+        X = df_train[feature_columns]\n+\n+        # add the intercept\n+        X = sm.add_constant(X)\n+\n+        # define the weights as inverse proportion of total number of data points for each score\n+\n+        score_levels = df_train['sc1'].unique()\n+        expected_proportion = 1/len(score_levels)\n+        score_weights_dict = dict([(sc1, expected_proportion/len(df_train[df_train['sc1']==sc1])) for sc1 in score_levels])","path":"rsmtool/model.py","position":28,"original_position":28,"commit_id":"a7899abbe357d7e856dc313815e33821f2f4a1b2","original_commit_id":"a7899abbe357d7e856dc313815e33821f2f4a1b2","user":{"login":"desilinguist","id":161680,"avatar_url":"https://avatars.githubusercontent.com/u/161680?v=3","gravatar_id":"","url":"https://api.github.com/users/desilinguist","html_url":"https://github.com/desilinguist","followers_url":"https://api.github.com/users/desilinguist/followers","following_url":"https://api.github.com/users/desilinguist/following{/other_user}","gists_url":"https://api.github.com/users/desilinguist/gists{/gist_id}","starred_url":"https://api.github.com/users/desilinguist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/desilinguist/subscriptions","organizations_url":"https://api.github.com/users/desilinguist/orgs","repos_url":"https://api.github.com/users/desilinguist/repos","events_url":"https://api.github.com/users/desilinguist/events{/privacy}","received_events_url":"https://api.github.com/users/desilinguist/received_events","type":"User","site_admin":false},"body":"Any thoughts @aloukina?","created_at":"2016-10-27T23:53:27Z","updated_at":"2016-10-27T23:53:27Z","html_url":"https://github.com/EducationalTestingService/rsmtool/pull/69#discussion_r85451166","pull_request_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/pulls/69","_links":{"self":{"href":"https://api.github.com/repos/EducationalTestingService/rsmtool/pulls/comments/85451166"},"html":{"href":"https://github.com/EducationalTestingService/rsmtool/pull/69#discussion_r85451166"},"pull_request":{"href":"https://api.github.com/repos/EducationalTestingService/rsmtool/pulls/69"}}},"pull_request":{"url":"https://api.github.com/repos/EducationalTestingService/rsmtool/pulls/69","id":90466340,"html_url":"https://github.com/EducationalTestingService/rsmtool/pull/69","diff_url":"https://github.com/EducationalTestingService/rsmtool/pull/69.diff","patch_url":"https://github.com/EducationalTestingService/rsmtool/pull/69.patch","issue_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/issues/69","number":69,"state":"open","locked":false,"title":"Weighted least squares","user":{"login":"aloukina","id":16725768,"avatar_url":"https://avatars.githubusercontent.com/u/16725768?v=3","gravatar_id":"","url":"https://api.github.com/users/aloukina","html_url":"https://github.com/aloukina","followers_url":"https://api.github.com/users/aloukina/followers","following_url":"https://api.github.com/users/aloukina/following{/other_user}","gists_url":"https://api.github.com/users/aloukina/gists{/gist_id}","starred_url":"https://api.github.com/users/aloukina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aloukina/subscriptions","organizations_url":"https://api.github.com/users/aloukina/orgs","repos_url":"https://api.github.com/users/aloukina/repos","events_url":"https://api.github.com/users/aloukina/events{/privacy}","received_events_url":"https://api.github.com/users/aloukina/received_events","type":"User","site_admin":false},"body":"- Added weighted least squares to the list of built-in models\r\n- Updated documentation\r\n- Added a test","created_at":"2016-10-22T01:57:33Z","updated_at":"2016-10-27T23:53:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"601ed49a432273d2f4ef70e8b105f9dc52a1b296","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/pulls/69/commits","review_comments_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/pulls/69/comments","review_comment_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/pulls/comments{/number}","comments_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/issues/69/comments","statuses_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/statuses/a7899abbe357d7e856dc313815e33821f2f4a1b2","head":{"label":"EducationalTestingService:Weighted-least-squares","ref":"Weighted-least-squares","sha":"a7899abbe357d7e856dc313815e33821f2f4a1b2","user":{"login":"EducationalTestingService","id":4822867,"avatar_url":"https://avatars.githubusercontent.com/u/4822867?v=3","gravatar_id":"","url":"https://api.github.com/users/EducationalTestingService","html_url":"https://github.com/EducationalTestingService","followers_url":"https://api.github.com/users/EducationalTestingService/followers","following_url":"https://api.github.com/users/EducationalTestingService/following{/other_user}","gists_url":"https://api.github.com/users/EducationalTestingService/gists{/gist_id}","starred_url":"https://api.github.com/users/EducationalTestingService/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EducationalTestingService/subscriptions","organizations_url":"https://api.github.com/users/EducationalTestingService/orgs","repos_url":"https://api.github.com/users/EducationalTestingService/repos","events_url":"https://api.github.com/users/EducationalTestingService/events{/privacy}","received_events_url":"https://api.github.com/users/EducationalTestingService/received_events","type":"Organization","site_admin":false},"repo":{"id":55423129,"name":"rsmtool","full_name":"EducationalTestingService/rsmtool","owner":{"login":"EducationalTestingService","id":4822867,"avatar_url":"https://avatars.githubusercontent.com/u/4822867?v=3","gravatar_id":"","url":"https://api.github.com/users/EducationalTestingService","html_url":"https://github.com/EducationalTestingService","followers_url":"https://api.github.com/users/EducationalTestingService/followers","following_url":"https://api.github.com/users/EducationalTestingService/following{/other_user}","gists_url":"https://api.github.com/users/EducationalTestingService/gists{/gist_id}","starred_url":"https://api.github.com/users/EducationalTestingService/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EducationalTestingService/subscriptions","organizations_url":"https://api.github.com/users/EducationalTestingService/orgs","repos_url":"https://api.github.com/users/EducationalTestingService/repos","events_url":"https://api.github.com/users/EducationalTestingService/events{/privacy}","received_events_url":"https://api.github.com/users/EducationalTestingService/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EducationalTestingService/rsmtool","description":"RSMTool is a python package for facilitating research on building and evaluating automated scoring models.","fork":false,"url":"https://api.github.com/repos/EducationalTestingService/rsmtool","forks_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/forks","keys_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/teams","hooks_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/hooks","issue_events_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/issues/events{/number}","events_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/events","assignees_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/assignees{/user}","branches_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/branches{/branch}","tags_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/tags","blobs_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/git/refs{/sha}","trees_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/statuses/{sha}","languages_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/languages","stargazers_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/stargazers","contributors_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/contributors","subscribers_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/subscribers","subscription_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/subscription","commits_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/commits{/sha}","git_commits_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/git/commits{/sha}","comments_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/comments{/number}","issue_comment_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/issues/comments{/number}","contents_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/contents/{+path}","compare_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/merges","archive_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/downloads","issues_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/issues{/number}","pulls_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/pulls{/number}","milestones_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/milestones{/number}","notifications_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/labels{/name}","releases_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/releases{/id}","deployments_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/deployments","created_at":"2016-04-04T15:35:11Z","updated_at":"2016-10-24T20:15:17Z","pushed_at":"2016-10-27T22:32:46Z","git_url":"git://github.com/EducationalTestingService/rsmtool.git","ssh_url":"git@github.com:EducationalTestingService/rsmtool.git","clone_url":"https://github.com/EducationalTestingService/rsmtool.git","svn_url":"https://github.com/EducationalTestingService/rsmtool","homepage":"rsmtool.readthedocs.io","size":6131,"stargazers_count":14,"watchers_count":14,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":14,"default_branch":"master"}},"base":{"label":"EducationalTestingService:master","ref":"master","sha":"436457f0c4db6b5c5043dad1704818a1f8af34a8","user":{"login":"EducationalTestingService","id":4822867,"avatar_url":"https://avatars.githubusercontent.com/u/4822867?v=3","gravatar_id":"","url":"https://api.github.com/users/EducationalTestingService","html_url":"https://github.com/EducationalTestingService","followers_url":"https://api.github.com/users/EducationalTestingService/followers","following_url":"https://api.github.com/users/EducationalTestingService/following{/other_user}","gists_url":"https://api.github.com/users/EducationalTestingService/gists{/gist_id}","starred_url":"https://api.github.com/users/EducationalTestingService/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EducationalTestingService/subscriptions","organizations_url":"https://api.github.com/users/EducationalTestingService/orgs","repos_url":"https://api.github.com/users/EducationalTestingService/repos","events_url":"https://api.github.com/users/EducationalTestingService/events{/privacy}","received_events_url":"https://api.github.com/users/EducationalTestingService/received_events","type":"Organization","site_admin":false},"repo":{"id":55423129,"name":"rsmtool","full_name":"EducationalTestingService/rsmtool","owner":{"login":"EducationalTestingService","id":4822867,"avatar_url":"https://avatars.githubusercontent.com/u/4822867?v=3","gravatar_id":"","url":"https://api.github.com/users/EducationalTestingService","html_url":"https://github.com/EducationalTestingService","followers_url":"https://api.github.com/users/EducationalTestingService/followers","following_url":"https://api.github.com/users/EducationalTestingService/following{/other_user}","gists_url":"https://api.github.com/users/EducationalTestingService/gists{/gist_id}","starred_url":"https://api.github.com/users/EducationalTestingService/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EducationalTestingService/subscriptions","organizations_url":"https://api.github.com/users/EducationalTestingService/orgs","repos_url":"https://api.github.com/users/EducationalTestingService/repos","events_url":"https://api.github.com/users/EducationalTestingService/events{/privacy}","received_events_url":"https://api.github.com/users/EducationalTestingService/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EducationalTestingService/rsmtool","description":"RSMTool is a python package for facilitating research on building and evaluating automated scoring models.","fork":false,"url":"https://api.github.com/repos/EducationalTestingService/rsmtool","forks_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/forks","keys_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/teams","hooks_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/hooks","issue_events_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/issues/events{/number}","events_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/events","assignees_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/assignees{/user}","branches_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/branches{/branch}","tags_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/tags","blobs_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/git/refs{/sha}","trees_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/statuses/{sha}","languages_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/languages","stargazers_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/stargazers","contributors_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/contributors","subscribers_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/subscribers","subscription_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/subscription","commits_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/commits{/sha}","git_commits_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/git/commits{/sha}","comments_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/comments{/number}","issue_comment_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/issues/comments{/number}","contents_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/contents/{+path}","compare_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/merges","archive_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/downloads","issues_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/issues{/number}","pulls_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/pulls{/number}","milestones_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/milestones{/number}","notifications_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/labels{/name}","releases_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/releases{/id}","deployments_url":"https://api.github.com/repos/EducationalTestingService/rsmtool/deployments","created_at":"2016-04-04T15:35:11Z","updated_at":"2016-10-24T20:15:17Z","pushed_at":"2016-10-27T22:32:46Z","git_url":"git://github.com/EducationalTestingService/rsmtool.git","ssh_url":"git@github.com:EducationalTestingService/rsmtool.git","clone_url":"https://github.com/EducationalTestingService/rsmtool.git","svn_url":"https://github.com/EducationalTestingService/rsmtool","homepage":"rsmtool.readthedocs.io","size":6131,"stargazers_count":14,"watchers_count":14,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/EducationalTestingService/rsmtool/pulls/69"},"html":{"href":"https://github.com/EducationalTestingService/rsmtool/pull/69"},"issue":{"href":"https://api.github.com/repos/EducationalTestingService/rsmtool/issues/69"},"comments":{"href":"https://api.github.com/repos/EducationalTestingService/rsmtool/issues/69/comments"},"review_comments":{"href":"https://api.github.com/repos/EducationalTestingService/rsmtool/pulls/69/comments"},"review_comment":{"href":"https://api.github.com/repos/EducationalTestingService/rsmtool/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/EducationalTestingService/rsmtool/pulls/69/commits"},"statuses":{"href":"https://api.github.com/repos/EducationalTestingService/rsmtool/statuses/a7899abbe357d7e856dc313815e33821f2f4a1b2"}}}}
{"actor":{"display_login":"desilinguist"}}