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 cvalidate(): | |
targetset = np.genfromtxt(open('trainLabels.csv','r'), dtype='f16') | |
y = [x for x in targetset] | |
trainset = np.genfromtxt(open('train.csv','r'), delimiter=',', dtype='f16') | |
X = np.array([x for x in trainset]) | |
X_train, X_test, y_train, y_test = cross_validation.train_test_split(X, y, test_size = 0.3, random_state = 0) | |
X_train, X_test = decomposition_pca(X_train, X_test) |
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 main(): | |
targetset = np.genfromtxt(open('trainLabels.csv','r'), dtype='f16') | |
target = [x for x in targetset] | |
trainset = np.genfromtxt(open('train.csv','r'), delimiter=',', dtype='f16') | |
train = np.array([x for x in trainset]) | |
testset = np.genfromtxt(open('test.csv','r'), delimiter = ',', dtype='f16') | |
train, testset = decomposition_pca(train, testset) |
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 cvalidate(): | |
from sklearn import cross_validation | |
trainset = np.genfromtxt(open('train.csv','r'), delimiter=',')[1:] | |
X = np.array([x[1:8] for x in trainset]) | |
y = np.array([x[8] for x in trainset]) | |
#print X,y | |
import math | |
for i, x in enumerate(X): |
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
// shf.go | |
package main | |
import ( | |
"github.com/madaan/shuffler" | |
) | |
func main() { | |
shuffler.Shuffle_sentence("All work and no play makes jack a dull boy") | |
} |
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
#sg | |
command='curl -O -C - http://www.mpi-inf.mpg.de/yago-naga/aida/download/entity-repository/AIDA_entity_repository_2010-08-17v5-1.sql.bz2' | |
restarts=0 | |
CLICK_TIME=5 | |
until `$command`;do | |
echo "Download stopped!" | |
#keep taking snapshots | |
if [ `echo "$restart % $CLICK_TIME" | bc` -eq 0 ];then | |
cp AIDA_entity_repository_2010-08-17v5-1.sql.bz2 aida_backup |
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
//0. Read the dataset! | |
//1. loading dataset | |
data=read_csv("~/cs215/session_22_07/train.csv"); | |
header = data(1, :); //save the header for description | |
data=evstr(data(2:$, :)); | |
ageIn = 4; | |
genderIn = 3; | |
classIn = 2; | |
fareIn = 7; |
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
data=evstr(read_csv("~/cs215/session_22_07/data.txt")) | |
X=data(:, 1:2); | |
X=[ones(size(X, 1), 1) X]; | |
y=data(:, 3); | |
W = inv(X' * X) * X' * y; | |
predictions = X * W; | |
plot(predictions, 'r'); | |
plot(y, 'g'); | |
legend(["Predictions"; "True Value"]); | |
title("Linear Regression") |
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
package edu.washington.multir.experiment; | |
import java.io.IOException; | |
import java.util.List; | |
import edu.stanford.nlp.ling.CoreAnnotations; | |
import edu.stanford.nlp.ling.CoreLabel; | |
import edu.stanford.nlp.pipeline.Annotation; | |
import edu.stanford.nlp.util.CoreMap; | |
import edu.stanford.nlp.util.Pair; |
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
{ | |
"corpusPath" : | |
"jdbc:derby:/mnt/a99/d0/aman/multir-exp-second/MultirExperiments-master/data/FullCorpus-First100Sentences", | |
"train" : "true", | |
"testDocumentsFile" : | |
"data/emptyFile", | |
"fg" : | |
"edu.washington.multirframework.featuregeneration.DefaultFeatureGenerator", | |
"ai" : |
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
#sg | |
#This script iterates over documents in a directory and strips tags | |
#Thanks to http://stackoverflow.com/questions/753052/strip-html-from-strings-in-python | |
from HTMLParser import HTMLParser | |
class MLStripper(HTMLParser): | |
def __init__(self): | |
self.reset() | |
self.fed = [] |
OlderNewer