Skip to content

Instantly share code, notes, and snippets.

View robinvanemden's full-sized avatar
🌳
⏩ ⏩

Robin van Emden robinvanemden

🌳
⏩ ⏩
View GitHub Profile
@robinvanemden
robinvanemden / LinUCB.ipynb
Created November 16, 2017 23:12 — forked from tushuhei/LinUCB.ipynb
LinUCB implementation based on Chu, Wei, et al. "Contextual Bandits with Linear Payoff Functions." AISTATS. Vol. 15. 2011.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@robinvanemden
robinvanemden / CMAB.py
Created November 16, 2017 23:12 — forked from axlevisu/CMAB.py
A class which solves multi-armed bandit problem
from scipy.stats import beta
from scipy.integrate import quad
from random import randint
import numpy as np
from operator import add
#Contextual Multi-Armed Bandit for Bernoulli Case
class CMAB:
Wrk2 client
Provider: Hetzner
Type server: Virtual server single core
OS: Clean Ubuntu-1604-xenial-64-minimal with custom /etc/sysctl.conf *
Wrk2: wrk 4.0.0 [epoll] https://github.com/giltene/wrk2
RAM: 1 GB
Hard Drive: SSD
Connection: 1 Gbit/s NIC
# -*- coding: utf-8 -*-
"""
Answers to assignments, "Coding the Matrix", by Philip N. Klein, Chapter 0.5
"""
###############################################################################
# 0.5.1 Number of minutes in a week
###############################################################################
print("\n### 0.5.1 ###\n")
@robinvanemden
robinvanemden / basic_peak_detection.R
Created May 18, 2017 12:28
Basic scripts to import and work with Bobbi data
# ----------- Totem Bobbi basic data analysis in R ------------
# ----------- Based on: https://tinyurl.com/n3tw7lc -----------
library(ggplot2)
library(wavelets)
# ----------------- Load data, set vars ----------------------
# set home directory to this file's directory
setwd("C:\\Users\\robin\\PycharmProjects\\TotemHeartRate")
@robinvanemden
robinvanemden / basic_peak_detection.py
Last active November 28, 2022 04:26
Imports data from the Totem Bobbi into a Pandas dataframe
import heart_beat as hb
fs = 500 # sampling frequency 500hz
#import data sample
dataset = hb.get_data("data/8-sdataHR_sample.df")
hb.process_basic_peak(dataset, 0.75, fs)
#We have imported our Python module as an object called 'hb'
#This object contains the dictionary 'measures' with all values in it
@robinvanemden
robinvanemden / data_kinect_distance_app.csv
Last active April 18, 2017 16:14
Example data file of Kinect distance app, short data file format
HR_timestamp UNIX_timestamp Body_1_Color Body_2_Color Body_1_Height_Estimate Body_2_Height_Estimate Body_1_TrackingID Body_2_TrackingID Body_1_Closest_SpineBase Body_1_XYZ_SpineBase Body_1_Closest_SpineMid Body_1_XYZ_SpineMid Body_1_Closest_Neck Body_1_XYZ_Neck Body_1_Closest_Head Body_1_XYZ_Head Body_1_Closest_ShoulderLeft Body_1_XYZ_ShoulderLeft Body_1_Closest_ElbowLeft Body_1_XYZ_ElbowLeft Body_1_Closest_WristLeft Body_1_XYZ_WristLeft Body_1_Closest_HandLeft Body_1_XYZ_HandLeft Body_1_Closest_ShoulderRight Body_1_XYZ_ShoulderRight Body_1_Closest_ElbowRight Body_1_XYZ_ElbowRight Body_1_Closest_WristRight Body_1_XYZ_WristRight Body_1_Closest_HandRight Body_1_XYZ_HandRight Body_1_Closest_HipLeft Body_1_XYZ_HipLeft Body_1_Closest_KneeLeft Body_1_XYZ_KneeLeft Body_1_Closest_AnkleLeft Body_1_XYZ_AnkleLeft Body_1_Closest_FootLeft Body_1_XYZ_FootLeft Body_1_Closest_HipRight Body_1_XYZ_HipRight Body_1_Closest_KneeRight Body_1_XYZ_KneeRight Body_1_Closest_AnkleRight Body_1_XYZ_AnkleRight Body_1_Closest_FootRight Bod
@robinvanemden
robinvanemden / qualtrics_check_answer.js
Last active April 4, 2017 13:58
Complex Experimental Design - Qualtrics Wide to Long Melt Example
Qualtrics.SurveyEngine.addOnload(function()
{
jQuery('#QID1013 input.radio').prop( "checked", true );
jQuery(document).ready(function(){
jQuery('#QID1013 input.radio').prop( "checked", true );
})
});
@robinvanemden
robinvanemden / D6_D8_sync_db_to_nodes.php
Last active April 18, 2017 18:42
Drupal 6 to Drupal 8 field conversion helper scripts. Bare bones, rough and simple - yet effective.
<?php
use Drupal\node\Entity\Node;
$message = "Click button to start Drupal 6 DB to Drupal 8 entityreference field conversion.";
// D6 field machine name
$field = "field_name";
// D8 field machine name
$target_field = "field_name";
@robinvanemden
robinvanemden / Data_Sim_Basic_Lif.py
Last active November 10, 2016 17:22
Basic LiF Sims
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import json
import pandas as pd
pd_csv = pd.read_csv('face_clean_with_demo.csv')