I hereby claim:
- I am tomquisel on github.
- I am tom (https://keybase.io/tom) on keybase.
- I have a public key whose fingerprint is 5772 C3AE 84D2 175D 3C2C DE71 1BA1 B957 7D34 77A2
To claim this, I am signing this object:
| import { extrapolateFromXdr } from "./xdr"; | |
| jest.unmock("stellar-sdk"); | |
| const deleteOfferXdr = | |
| "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAADAAAAAAAAAAAAAAACAAAAAA=="; | |
| const createOfferXdr = | |
| "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAVvtc2vNsygpxOUKCQKkmSJSQItaJ0LxMot3/9ups4/AAAAAAK1OXcAAAAAAAAAAVhDTgAAAAAAm466+JY4VR3PnqT3QyBxEGuHqw4ts9abdaU4InL3WdgAAAAAAOThwAAAABQAAAADAAAAAAAAAAAAAAAA"; | |
| describe("extrapolateFromXdr", () => { |
| // adapted from: https://github.com/stellar/laboratory/blob/master/src/utilities/extrapolateFromXdr.js | |
| import * as _ from "lodash"; | |
| import { xdr, StrKey, Keypair, Operation } from "stellar-sdk"; | |
| /** | |
| * Convert XDR string to minimal JSON object | |
| * @param input input xdr string | |
| * @param type type of XDR (TransactionResult, TransactionMeta, etc...) | |
| */ | |
| export function extrapolateFromXdr(input: string, type: string) { |
| class VotingClassifier(object): | |
| """Stripped-down version of VotingClassifier that uses prefit estimators""" | |
| def __init__(self, estimators, voting='hard', weights=None): | |
| self.estimators = [e[1] for e in estimators] | |
| self.named_estimators = dict(estimators) | |
| self.voting = voting | |
| self.weights = weights | |
| def fit(self, X, y, sample_weight=None): | |
| raise NotImplementedError |
| def do_R_wilcoxon(before, after, paired=True, two_tailed=False): | |
| b_mat = before.as_matrix() | |
| a_mat = after.as_matrix() | |
| alternative = 'g' | |
| if two_tailed: | |
| alternative = 'two.sided' | |
| %R -i b_mat,a_mat,paired,alternative -o wilcox_res wilcox_res=wilcox.test(b_mat, a_mat, paired=paired, exact=TRUE, conf.int=TRUE, alternative=alternative) | |
| #print list(enumerate(wilcox_res)) | |
| # this returns just the p-value and the conf interval | |
| return { |
I hereby claim:
To claim this, I am signing this object:
| df.to_hdf('/home/tom/data/behaviorXoutcomes/user_features.h5', 'data', complevel=1, complib='zlib') |
| from pyspark.sql import SQLContext | |
| sqlContext = SQLContext(sc) | |
| df = sqlContext.read.format("org.elasticsearch.spark.sql").load("index/type") | |
| df.printSchema() |
| %reload_ext rpy2.ipython | |
| %R -n library(dplyr) | |
| %%R | |
| do_regression = function(mpr, features) { | |
| df = read.csv("activity_quantity_df.csv", header=T) | |
| df$mem_gender = as.factor(df$mem_gender) | |
| df$mem_age = as.factor(df$mem_age) | |
| feature_str = paste(features, collapse=" + ") | |
| print(paste(mpr, "~", feature_str, " + mem_gender*mem_age")) |
| #!/usr/bin/env python | |
| import sys, os, re, random | |
| import time, datetime | |
| from collections import defaultdict | |
| import pandas as pd | |
| import numpy as np | |
| from argparse import ArgumentParser | |
| def main(): | |
| args = handle_args() |