Skip to content

Instantly share code, notes, and snippets.

View NAMYUNWOO's full-sized avatar
🎴
🔨

NAM YUNWOO NAMYUNWOO

🎴
🔨
View GitHub Profile
import random
import time
class CARD:
card = [m+i for m in ["♣","♦","♥","♠"] for i in ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10',"J","Q","K"]]
def __init__(self):
random.shuffle(self.card)
def pop(self):
return self.card.pop()
import os
import datetime
import re
from functools import reduce
import pandas as pd
def dtString_to_datetime(sendDt):
return datetime.datetime.strptime(sendDt,"%Y-%m-%d %H:%M:%S")
def sender_time_receivers(row):
if type(row) == dict:
@NAMYUNWOO
NAMYUNWOO / tcga_cancer_clf_dnn.py
Created June 14, 2018 15:32
unist_cse611_bio_HPC
# coding: utf-8
# In[28]:
from __future__ import print_function
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout
@NAMYUNWOO
NAMYUNWOO / tcga_cancer_clf.py
Created June 14, 2018 07:32
unist_cse611_bio_HPC
import pandas as pd
import re
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import log_loss,accuracy_score,confusion_matrix
from sklearn.calibration import CalibratedClassifierCV
from sklearn import preprocessing
from sklearn.metrics import roc_auc_score
from sklearn.grid_search import GridSearchCV
@NAMYUNWOO
NAMYUNWOO / Rational
Created May 28, 2018 14:12
Rational
class Rational(x:Int, y:Int){
require(y != 0 , "denominator must be nonzero")
def this(x: Int) = this(x,1)
private def gcd(a:Int,b:Int): Int = if(b==0) a else gcd(b,a%b)
def numer = x
def denom = y
def less(that:Rational) = numer * that.denom < that.numer * denom
def max(that:Rational) = if(this.less(that)) that else this
def add(that:Rational) =
new Rational(
import requests, grequests,re,sqlite3,datetime,sys,getopt,pymongo,time
from collections import deque
class SteamData:
R_URL = "http://store.steampowered.com/appreviews/%d?json=1&filter=recent&start_offset=%d"
GL_URL = "http://api.steampowered.com/ISteamApps/GetAppList/v0002/?key=STEAMKEY&format=json"
G_URL = "http://store.steampowered.com/api/appdetails?appids=%d"
U_URL = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=%s&steamids=%s"
UA_URL = "http://api.steampowered.com/ISteamUserStats/GetPlayerAchievements/v0001/?appid=%d&key=%s&steamid=%s"
US_URL = "http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/?appid=%d&key=%s&steamid=%s"
import numpy as np
from six.moves import cPickle
from matplotlib import pyplot as plt
from matplotlib.ticker import NullFormatter
# problem 1
#1)
n = 100000
x = np.random.rand(n,1)
# coding: utf-8
# In[60]:
import pandas as pd
import statsmodels.api as sm
from statsmodels.stats.outliers_influence import variance_inflation_factor
import numpy as np
# coding: utf-8
# In[60]:
import pandas as pd
import statsmodels.api as sm
from statsmodels.stats.outliers_influence import variance_inflation_factor
import numpy as np
# coding: utf-8
# In[60]:
import pandas as pd
import statsmodels.api as sm
from statsmodels.stats.outliers_influence import variance_inflation_factor
import numpy as np