This file contains 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
cd /tmp | |
wget http://cran.r-project.org/src/base/R-2/R-2.15.2.tar.gz | |
# You can download latest R version from CRAN | |
# Go to http://cran.r-project.org/ | |
# or Go & choose what u want:- http://cran.r-project.org/src/base/ | |
# Untar | |
tar -xzf R-2.15.2.tar.gz | |
cd R-2.15.2 |
This file contains 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 left_join(df1, df2, key, cols, lsuffix="", rsuffix="", default_value=None): | |
if type(key) != list: | |
key_left, key_right = key, key | |
else: | |
key_left, key_right = key[0], key[1] | |
if type(cols) != list: | |
cols = [cols,] | |
ind = pd.match(df1[key], df2[key]) |
This file contains 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
# -*- coding: utf-8 -*- | |
""" | |
Created on Thu Jun 26 13:00:02 2014 | |
@author: pawel | |
""" | |
import multiprocessing as mp | |
import numpy as np | |
import logging |
This file contains 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 textblob import TextBlob, Word | |
from features.skipgrams import EssaySkipgram | |
from features.essay_feature import EssayFeature, FunctionalTextEssayFeature, EssayTextConversion | |
from features.text_features import * | |
from features.word2vec_word_clusters import EssayTextToW2VClusters | |
from features.wiki_ngram_coverage import check_1gram_coverage, check_2gram_coverage, check_3gram_coverage | |
from features.convert_text_to_definitions import convert_text_to_definitions | |
#from features.word2vec_features import EssayWord2Vec, EssayWord2VecFirstWords |
This file contains 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 model_generic(data, model_f, n_folds=10, feature_selection_f=None, feature_transform_f=None, save_as=None, make_predictions=False, standard_model=False): | |
# save as | |
if os.path.exists(save_as): | |
print("Skipping",save_as) | |
return None | |
else: | |
touch(save_as) | |
nobs_tr = data["train"]["X"].shape[0] |
This file contains 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
// adds ssh key to a server | |
cat ~/.ssh/id_rsa.pub | ssh -l root 1.1.1.1 'cat >> .ssh/authorized_keys' |
This file contains 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
// discards all changes to the code (without commiting) | |
git checkout -- . |
This file contains 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
''' | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2004 Sam Hocevar <[email protected]> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. |
This file contains 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
; this is a comment | |
; this is a double function | |
(defn doublen [x] (* x 2)) | |
; basic collections (lists, vectors, maps) | |
(def a-list '(1 2 3)) | |
(def a-vector [1 2 3]) | |
(def a-map {:key1 val1 :key2 val2}) |
This file contains 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
#dataX - variables | |
#datay - labels | |
rows = dataX.shape[0] | |
out_of_fold_predictions = zeros(rows) # this is our out of fold prediction vector | |
for tr, te in cross_validation(10): | |
model = fit(dataX[tr,], datay[tr]) |
OlderNewer