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
import pandas as pd | |
import numpy as np | |
import multiprocessing | |
from functools import partial | |
def _df_split(tup_arg, **kwargs): | |
split_ind, df_split, df_f_name = tup_arg | |
return (split_ind, getattr(df_split, df_f_name)(**kwargs)) | |
def df_multi_core(df, df_f_name, subset=None, njobs=-1, **kwargs): |
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
rm -r -f vmware-tools-update | |
mkdir vmware-tools-update | |
cd vmware-tools-update | |
cp /media/[user-name]/VMware\ Tools/VMwareTools-*.tar.gz . | |
tar -xzvf VMwareTools-*.tar.gz | |
cd vmware-tools-distrib | |
./vmware-install.pl |
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
import pandas as pd | |
def balance_train_ds(df_train, unseen_pos_rate, train_y_field): | |
df_train_pos = df_train[df_train[train_y_field] == 1] | |
df_train_neg = df_train[df_train[train_y_field] == 0] | |
p = df_train_pos.shape[0] | |
n = df_train_neg.shape[0] | |
train_pos_rate = float(p) / float(df_train.shape[0]) | |
print 'train ds pos rate {0}, unseen ds reported pos rate {1}'.format(train_pos_rate, unseen_pos_rate) | |
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
#java 8 – includes some interactive responses on your side | |
sudo add-apt-repository ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get install oracle-java8-installer | |
#test it: | |
java -version | |
#should be: java version “1.8.XX” | |
#fixing apt-get, installation and post service config | |
wget -qO – https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add – |