Skip to content

Instantly share code, notes, and snippets.

View gorkemozkaya's full-sized avatar

Gorkem Ozkaya gorkemozkaya

  • San Francisco, CA
View GitHub Profile
@gorkemozkaya
gorkemozkaya / quantitative_to_categorical.R
Created September 15, 2017 03:30
how to convert a quantitative column into categorical with 10 equal segments
q2c <- function(col) {
breaks = quantile(col, seq(0.1, 0.9, 0.1), na.rm=TRUE)
cuts <- addNA(cut(col, breaks = breaks))
}
@gorkemozkaya
gorkemozkaya / tensorflow_pca.py
Created October 4, 2017 19:14 — forked from ahwillia/tensorflow_pca.py
PCA in TensorFlow
import numpy as np
import tensorflow as tf
# N, size of matrix. R, rank of data
N = 100
R = 5
# generate data
W_true = np.random.randn(N,R)
C_true = np.random.randn(R,N)
@gorkemozkaya
gorkemozkaya / keybindings.json
Last active May 6, 2020 23:23
VSCode Config
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "cmd+enter"
"command": "workbench.action.terminal.runSelectedText",
"when": "editorTextFocus"
}
,{
"key": "ctrl+enter",
"command": "multiCommand.sendToScala",
@gorkemozkaya
gorkemozkaya / Maven shade with shaded jar
Created November 19, 2018 18:25
How to get the shaded jar with all dependencies
<!--Build assembly jar-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
@gorkemozkaya
gorkemozkaya / xgboost_single_jar.diff
Created November 19, 2018 22:21
mvn pom.xml change needed to compile xgboost jvm as a single file
diff --git a/jvm-packages/xgboost4j-spark/pom.xml b/jvm-packages/xgboost4j-spark/pom.xml
index 601bad1..4e24a49 100644
--- a/jvm-packages/xgboost4j-spark/pom.xml
+++ b/jvm-packages/xgboost4j-spark/pom.xml
@@ -10,15 +10,25 @@
</parent>
<artifactId>xgboost4j-spark</artifactId>
<build>
- <plugins>
- <plugin>
@gorkemozkaya
gorkemozkaya / run_tf_glue.ipynb
Created December 26, 2019 19:15 — forked from ceshine/run_tf_glue.ipynb
Train huggingface/transformers BERT model on Cloud CPU with TF 2.1 (nightly build)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.