This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn import linear_model | |
from FeatureUtils import * | |
import numpy as np | |
(features,output) = getXy(sys.argv[1]) | |
clf = linear_model.LogisticRegression(penalty='l1') | |
clf.fit(features,output) | |
print clf.coef_ |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37313 14 68 7 0 0 5 4 162 35 11 0 0 | |
478335 9 14 2 0 0 2 5 70 1 24 0 0 | |
8945 5 94 10 0 1 3 3 3395 239 524 67 0 | |
8741 6 78 2 0 0 4 3 4784 938 564 17 0 | |
8976 3 156 6 0 4 5 4 3778 757 1781 269 0 | |
391411 6 90 1 0 0 2 1 686 32 150 1 0 | |
762005 5 511 0 0 4 2 5 10 0 0 0 0 | |
749982 5 169 0 0 0 1 4 1 0 0 0 0 | |
316016 6 81 1 0 0 3 2 134 29 27 0 0 | |
855171 6 567 1 0 0 1 2 87 0 19 0 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import types | |
import sys | |
import marshal | |
import Utils | |
from lxml import etree | |
import csv | |
class User: | |
#this is for user features | |
def __init__(self, userId, d): | |
self.reputation = d['reputation'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
import marshal | |
import Utils | |
from lxml import etree | |
if(len(sys.argv)<2): | |
print 'python name.py posts.xml acceptedIdsList users.xml userDictOutput' | |
sys.exit() | |
userdict = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getCreationDate(elem): | |
return elem.get("CreationDate") | |
def getParent(elem): | |
return elem.get("ParentId") | |
def getPostTypeId(elem): | |
return elem.get("PostTypeId") | |
def getOwner(elem): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#num non-hashes hashes | |
1 37.5968768597 38.9962208271 | |
4 39.5982711315 42.2955231667 | |
20 40.4657788277 43.3965361118 | |
50 120.064239025 128.437549829 | |
100 288.91673708 299.555378914 | |
200 584.331137896 609.95442009 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: | |
python Lookup.py recap.input Outputs mapping.map 1 > Measurements/1.txt | |
python Lookup.py recap.input Outputs mapping.map 4 > Measurements/4.txt | |
python Lookup.py recap.input Outputs mapping.map 20 > Measurements/20.txt | |
python Lookup.py recap.input Outputs mapping.map 50 > Measurements/50.txt | |
python Lookup.py recap.input Outputs mapping.map 100 > Measurements/100.txt | |
python Lookup.py recap.input Outputs mapping.map 200 > Measurements/200.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
import multiprocessing | |
from collections import defaultdict | |
from TrueCasing import * | |
import time | |
import redis | |
import gzip | |
class Project: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
import multiprocessing | |
from collections import defaultdict | |
from TrueCasing import * | |
import time | |
import redis | |
import gzip | |
class Project: |