Skip to content

Instantly share code, notes, and snippets.

View ttungl's full-sized avatar

Tung Thanh Le ttungl

View GitHub Profile
@BioSciEconomist
BioSciEconomist / ex matching.py
Created June 26, 2021 19:17
Very basic propensity score matching and IPTW analysis with balance diagnostics
# *-----------------------------------------------------------------
# | PROGRAM NAME: ex matching.py
# | DATE: 6/25/21
# | CREATED BY: MATT BOGARD
# | PROJECT FILE:
# *----------------------------------------------------------------
# | PURPOSE: very basic matching and IPTW analysis with balance diagnostics
# *----------------------------------------------------------------
@khyatimahendru
khyatimahendru / creditcardfrauddetection.ipynb
Last active February 21, 2022 16:37
CreditCardFraudDetection.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
distributed:
version: 2
scheduler:
bandwidth: 1000000000 # 100 MB/s estimated worker-worker bandwidth
worker:
memory:
target: 0.90 # target fraction to stay below
spill: False # fraction at which we spill to disk
pause: 0.80 # fraction at which we pause worker threads
terminate: 0.95 # fraction at which we terminate the worker
@planetceres
planetceres / horovod_cluster_setup.md
Last active March 5, 2020 20:56
Horovod Cluster Setup with CUDA 9.0, Miniconda3 and Tensorflow 1.8rc

Setup of GPU Enabled VM for Distributed Tensorflow using Horovod

Update CentOS

Update CentOS and reboot (you will need to login again):

sudo yum update -y
sudo reboot
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active November 17, 2025 08:00
crack activate Office on mac with license file
@JenZhao
JenZhao / leetcode_sql.md
Created February 22, 2018 19:08
leetcode_sql

Here are my solutions to all SQL problems on leetcode.

Rank

-- how to do rank with out window function
select t1.category, count(distinct t2.id) as dense_rank
from table t1, table t2
where t1.id = t2.id and t1.value <= t2.value 
group by t1.category
@thoolihan
thoolihan / target_encode.py
Created November 30, 2017 15:08
TargetEncoder
import numpy as np
import pandas as pd
from sklearn.base import BaseEstimator, TransformerMixin
# Adapted from https://www.kaggle.com/ogrellier/python-target-encoding-for-categorical-features
class TargetEncoder(BaseEstimator, TransformerMixin):
def __init__(self, columns, noise_level = 0):
self.columns = columns
self.maps = {}
@kendricktan
kendricktan / capsule_networks.py
Last active August 17, 2021 17:12
Clean Code for Capsule Networks
"""
Dynamic Routing Between Capsules
https://arxiv.org/abs/1710.09829
"""
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torchvision.transforms as transforms
@geffy
geffy / stacking_example.py
Created October 7, 2017 17:33
Stacking example
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 23 23:16:44 2017
@author: Marios Michailidis
This is an example that performs stacking to improve mean squared error
This examples uses 2 bases learners (a linear regression and a random forest)
and linear regression (again) as a meta learner to achieve the best score.
The initial train data are split in 2 halves to commence the stacking.
@aparrish
aparrish / spacy_intro.ipynb
Last active March 14, 2025 21:43
NLP Concepts with spaCy. Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.