Skip to content

Instantly share code, notes, and snippets.

Jaemin Cho j-min

Block or report user

Report or block j-min

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
@j-min
j-min / R_custom_ANOVA&Summary
Last active Jun 30, 2016
R_custom_ANOVA&Summary
View R_custom_ANOVA&Summary
ANOVA_SUMMARY = function(formula, data)
{
# 1. 데이터 전처리
# 종속변수를 항상 첫번째 input으로 "y~." 형식으로 받음
mf = model.frame(formula, data)
y = mf[,1]
Response_name = colnames(mf)[1] # 종속변수의 이름
Variable_name = c("(intercept)", colnames(mf)[-1]) # 독립변수의 이름
n = nrow(mf)
@j-min
j-min / pg-pong.py
Created Jul 13, 2016 — forked from karpathy/pg-pong.py
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
View pg-pong.py
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
View sejong_treebank.txt.v1
This file has been truncated, but you can view the full file.
; 새 생명.
(NP (DP 새/MM)
(NP 생명/NNG + ./SF))
; 나는 돈이다.
(S (NP_SBJ 나/NP + 는/JX)
(VNP 돈/NNG + 이/VCP + 다/EF + ./SF))
; 만 원이라는 이름을 붙인 채, 이제 막 태어났다.
@j-min
j-min / KoNLPy Install (Ubuntu & Python 2)
Last active Sep 30, 2016
KoNLPy Install (Ubuntu & Python 2)
View KoNLPy Install (Ubuntu & Python 2)
# Reference: http://konlpy.org/en/v0.4.4/install/#ubuntu
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install g++ openjdk-7-jdk python-dev python3-dev --fix-missing
sudo pip install JPype1
sudo pip install konlpy
sudo apt-get install curl
bash <(curl -s https://raw.githubusercontent.com/konlpy/konlpy/master/scripts/mecab.sh)
@j-min
j-min / Mecab-ko_iter.py
Last active Oct 12, 2016
Mecab-ko based POS tagging iterator
View Mecab-ko_iter.py
from konlpy.tag import Mecab
mecab = Mecab()
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
def mecab_pos_tag():
while True:
a = raw_input()
for x in mecab.pos(a):
View NLTK_Stanford_2015-12-09.md

NLTK API to Stanford NLP Tools compiled on 2015-12-09

Stanford NER

With NLTK version 3.1 and Stanford NER tool 2015-12-09, it is possible to hack the StanfordNERTagger._stanford_jar to include other .jar files that are necessary for the new tagger.

First set up the environment variables as per instructed at https://github.com/nltk/nltk/wiki/Installing-Third-Party-Software

@j-min
j-min / AWS_Jupyter_Notebook.sh
Last active Nov 8, 2016
Jupyter Notebook setup on AWS EC2
View AWS_Jupyter_Notebook.sh
sudo apt-get upgrade
sudo apt-get update
sudo pip install jupyter notebook
jupyter notebook --generate-config
ipython
from notebook.auth import passwd
passwd()
@j-min
j-min / install-tensorflow.sh
Last active Nov 15, 2016 — forked from erikbern/install-tensorflow.sh
TensorFlow Installation Log
View install-tensorflow.sh
# Note – this is not a bash script (some of the steps require reboot)
# I named it .sh just so Github does correct syntax highlighting.
#
# This is also available as an AMI in us-east-1 (virginia): ami-cf5028a5
#
# The CUDA part is mostly based on this excellent blog post:
# http://tleyden.github.io/blog/2014/10/25/cuda-6-dot-5-on-aws-gpu-instance-running-ubuntu-14-dot-04/
# Install various packages
sudo apt-get update
View CSVFileIO.py
import csv
import os
def get_csv_writer(filename, rows, delimiter):
with open(filename, 'w') as csvfile:
fieldnames = rows[0].keys()
writer = csv.DictWriter(csvfile, fieldnames=fieldnames, delimiter=delimiter)
writer.writeheader()
for row in rows:
try:
@j-min
j-min / 2_3.py
Created Nov 24, 2016
Python 2/3 compatibility
View 2_3.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
You can’t perform that action at this time.