Skip to content

Instantly share code, notes, and snippets.

Thomas Jungblut thomasjungblut

Block or report user

Report or block thomasjungblut

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
thomasjungblut /
Last active Jun 18, 2018
XGBoost hyper parameter optimization using bayes_opt
from bayes_opt import BayesianOptimization
from sklearn.cross_validation import KFold
import xgboost as xgb
def xgbCv(train, features, numRounds, eta, gamma, maxDepth, minChildWeight, subsample, colSample):
# prepare xgb parameters
params = {
"objective": "reg:linear",
"booster" : "gbtree",
"eval_metric": "mae",
View FlatMapWithLocal
public class FlatMapTest {
public FlatMapTest() { // <init> //()V
<localVar:index=0 , name=this , desc=LFlatMapTest;, sig=null, start=L1, end=L2>
L1 {
aload0 // reference to self
invokespecial java/lang/Object <init>(()V);
thomasjungblut / gist.R
Last active Mar 18, 2016
XGBoost Validation and Early Stopping in R
View gist.R
train <- read.csv("train.csv")
bound <- floor(nrow(train) * 0.9)
train <- train[sample(nrow(train)), ]
df.train <- train[1:bound, ]
df.validation <- train[(bound+1):nrow(train), ]
train.y <- df.train$TARGET
validation.y <- df.validation$TARGET
dtrain <- xgb.DMatrix(data=df.train, label=train.y)
thomasjungblut / gist:624ba7b7f4dc6246659c
Created Jun 17, 2015
numerical gradients with fmincg
View gist:624ba7b7f4dc6246659c
import de.jungblut.math.DoubleVector;
import de.jungblut.math.MathUtils;
import de.jungblut.math.dense.DenseDoubleVector;
import de.jungblut.math.minimize.CostFunction;
import de.jungblut.math.minimize.CostGradientTuple;
import de.jungblut.math.minimize.Fmincg;
public class FminCGNumericalGradient {
static class RealCostFunction implements CostFunction {
View gist:e4759797f5a52d78e06d
package de.jungblut.nlp;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.concurrent.TimeUnit;
thomasjungblut / gist:fdf458587463a993d173
Created Feb 7, 2015
PiEstimator (multithreaded monte carlo)
View gist:fdf458587463a993d173
import java.util.concurrent.Executors
import scala.util.Random
import java.util.concurrent.ExecutorService
import java.util.concurrent.Callable
import java.util.concurrent.FutureTask
import java.util.concurrent.ExecutorCompletionService
import scala.collection.mutable.MutableList
object PiEstimator extends App {
thomasjungblut /
Last active Aug 29, 2015
findKthSmallestValue in a Binary Tree.
package de.jungblut.interviews;
import java.util.Stack;
public class BinaryTree {
class TreeNode {
TreeNode left;
View gist:11193991
pub 2048D/4F238505 2011-09-20
uid Thomas Jungblut <>
sig 3 4F238505 2011-09-20 Thomas Jungblut <>
pub 4096R/56623ACB 2014-04-22
uid Thomas Jungblut (apache account email pgp client blax) <>
sig 3 56623ACB 2014-04-22 Thomas Jungblut (apache account email pgp client blax) <>
sub 4096R/BDDECF6D 2014-04-22
sig 56623ACB 2014-04-22 Thomas Jungblut (apache account email pgp client blax) <>
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
String pathBase = "/home/thomasjungblut/Downloads/";
PDDocument source = PDDocument.load(pathBase
+ "c1.pdf");
PDDocument lastPage = PDDocument.load(pathBase + "updated.pdf");
source.removePage(source.getNumberOfPages() - 1);
source.addPage( (PDPage) lastPage.getDocumentCatalog().getAllPages().get(0) ); + "c2_updated.pdf");
You can’t perform that action at this time.