Skip to content

Instantly share code, notes, and snippets.

View ddofer's full-sized avatar

Dan Ofer ddofer

View GitHub Profile
@ddofer
ddofer / dnn.py
Last active August 29, 2015 14:07 — forked from syhw/dnn.py
"""
A deep neural network with or w/o dropout in one file.
License: Do What The Fuck You Want to Public License http://www.wtfpl.net/
"""
import numpy, theano, sys, math
from theano import tensor as T
from theano import shared
from theano.tensor.shared_randomstreams import RandomStreams
@ddofer
ddofer / freqLabs.R
Created August 9, 2017 12:33
Filter lab tests for tests that occured for at least K users distinctly, and then filter by the most frequent (non distinct) labs. R
#LABS
#get most frequent lab tests, for distinct patients.
#Filter for distinct by user:
# data.labs = as.data.frame(data.labs)
# data.labs.userDistinct = subset(as.data.table(data.labs),select=c("guid_tz","kod_bdika")) #ORIG
# data.labs.userDistinct= unique(data.labs.userDistinct) #ORIG
data.labs.userDistinct= unique(data.labs,by="guid_tz") #changed
@ddofer
ddofer / get_chemical_elements_wikipedia.py
Last active April 22, 2020 09:51
Get list of chemical elements from Wikipedia + Pandas
import pandas as pd
# read wikipedia html table with info on all elemetns, including symbols, names, properties:
df_base = pd.read_html("https://en.wikipedia.org/wiki/List_of_chemical_elements")[0]
element_full_names = df_base["List of chemical elements"]["Element"][:-1] # last row is comments
element_full_names =list(element_full_names.apply(lambda x: x[0],axis=1).values) # get individual names out of wrapped list format
# element_full_names.to_csv("names_of_elements.csv",index=False)
@ddofer
ddofer / README.md
Created December 1, 2020 09:12 — forked from jackd/README.md
tensorflow graphics keras port for PR #155

Get my forked tensorflow graphics repo and switch to appropriate branch

git clone https://github.com/jackd/graphics.git
cd graphics
git checkout sparse-feastnet
pip install -e .
cd ..

Get this gist: