Skip to content

Instantly share code, notes, and snippets.

import openml
from arbok.bench import Benchmark
# We create a benchmark setup where we specify the headers, the interpreter we
# want to use, the directory to where we store the jobs (.sh-files), and we give
# it the config-file we created earlier.
bench = Benchmark(
headers="#PBS -lnodes=1:cpu3\n#PBS -lwalltime=15:00:00",
python_interpreter="/home/jhoof/python/python36/bin/python3", # Path to interpreter
import openml
from arbok.bench import Benchmark
# We create a benchmark setup where we specify the headers, the interpreter we
# want to use, the directory to where we store the jobs (.sh-files), and we give
# it the config-file we created earlier.
bench = Benchmark(
headers="#PBS -lnodes=1:cpu3\n#PBS -lwalltime=15:00:00",
@Yatoom
Yatoom / bench-long.py
Last active May 17, 2018 00:10
Benchmark on openml's CC18 using TPOT and AutoSklearn
import openml
from arbok.bench import Benchmark
# We create a benchmark setup where we specify the headers, the interpreter we
# want to use, the directory to where we store the jobs (.sh-files), and we give
# it the config-file we created earlier.
bench = Benchmark(
headers="#PBS -lnodes=1:cpu3\n#PBS -lwalltime=15:00:00",
@Yatoom
Yatoom / bench.py
Last active May 16, 2018 19:10
Benchmark on openml's CC18 using TPOT and AutoSklearn
# /home/jhoof/python/python36/bin/python3 bench.py
import openml
from arbok.bench import Benchmark
# We create a benchmark setup where we specify the headers, the interpreter we
# want to use, the directory to where we store the jobs (.sh-files), and we give
# it the config-file we created earlier.
@Yatoom
Yatoom / id_finder.py
Last active April 14, 2018 23:15
Add ids and image ids columns
from tqdm import tqdm
import string
import json
import collections
import numpy as np
import os
DATA_PATH = "data"
################################################################################################
@Yatoom
Yatoom / setup.md
Last active October 31, 2024 18:45
Thinkfan configuration

Thinkfan setup

Note: I configured this thinkfan setup for my old Thinkpad w520 on Ubuntu 17.10.

1. Install necessary programs

Install lm-sensors and thinkfan.

sudo apt-get install lm-sensors thinkfan
@Yatoom
Yatoom / program.py
Created September 18, 2017 21:59
Minion translator
from words import words
minionese_to_english = {v: k for k, v in words.items()}
def translate(sentence, minionese=False):
dictionary = words if not minionese else minionese_to_english
result = ""
for word in sentence.split(" "):
if word in dictionary.keys():
@Yatoom
Yatoom / program.py
Created September 18, 2017 21:59
Minion translator
from words import words
minionese_to_english = {v: k for k, v in words.items()}
def translate(sentence, minionese=False):
dictionary = words if not minionese else minionese_to_english
result = ""
for word in sentence.split(" "):
if word in dictionary.keys():
function randomIndex(list) {
return Math.floor(Math.random() * list.length) - 1
}
function triggerUpdate(el) {
el.click()
el.dispatchEvent(new Event('change'));
}
function fillRandom() {
import pymysql.cursors
connection = pymysql.connect(host='localhost', user='slayer', password='', db='rumor_slayer', charset='utf8mb4', cursorclass=pymysql.cursors.DictCursor)
with connection.cursor() as cursor:
sql = "SELECT text FROM tweets"
cursor.execute(sql)
result = cursor.fetchall()
for tweet in result: