Skip to content

Instantly share code, notes, and snippets.

remove(list=ls())
library(LiblineaR)
library(glmpath)
set.seed(1)
x1 <- rnorm(100, mean = 100, sd=10)
x2 <- rnorm(100, sd=19)
x3 <- -1*(5*x1 - 75*x2)
x4 <- -17*x1 + 2*x2 + 17*x3
x5 <- -1*(30*x1 + 13*x3 - 15*x4)
# This file does a bootstrapping experiment to see what the average recall is when we shuffle the element
# Largely take reference here to calculate precision, recall and f1:
# http://stats.stackexchange.com/questions/15158/precision-and-recall-for-clustering
remove(list=ls())
library(combinat)
# label 1: 1779
# label 2: 2979
# label 3: 1975
# label 4: 3260
@czxttkl
czxttkl / gist:9cc879b9881fef3f79d36ed7e12b53a6
Last active January 9, 2019 21:42
DQN + Double Q-Network + OpenAI Gym
import random
import gym
import math
import numpy as np
from collections import deque
from keras.models import Sequential
from keras.layers import Dense
from keras.optimizers import Adam
from keras.models import clone_model
import tensorflow as tf