Skip to content

Instantly share code, notes, and snippets.

View parksunwoo's full-sized avatar
🎣
Focusing

Sunwoo Park parksunwoo

🎣
Focusing
View GitHub Profile
### SMOTE
from imblearn.over_sampling import SMOTE
X_resampled, y_resampled = SMOTE().fit_sample(X_train, y_train)
### ROC_AUC_SCORE
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import roc_auc_score
logreg = LogisticRegression()
logreg.fit(X_train, y_train)
import numpy as np
import pandas as pd
from sklearn.model_selection import StratifiedShuffleSplit
train = pd.read_csv("data/application_train.csv")
test = pd.read_csv("data/application_test.csv")
# common fuction
def error(actual, predicted):
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@parksunwoo
parksunwoo / basic_encoding_code.ipynb
Created August 8, 2018 02:05
basic encoding code
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@parksunwoo
parksunwoo / supplement_preprocessing.ipynb
Created August 23, 2018 11:38
supplement_preprocessing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@parksunwoo
parksunwoo / ConvexHull.java
Last active November 10, 2018 11:25
convexHull_grahamScan_java
package ssw;
import java.util.*;
/**
* Created by sunu.park on 2018. 11. 10.
*/
class Point{
int x, y;
@parksunwoo
parksunwoo / QA_baseline.py
Created December 8, 2018 03:09
QA_baseline
##!pip3 install summa
#Step1. textrank를 활용 문서에서 중요문장 추출
from summa.summarizer import summarize
f = open("wiki_en/chosun.txt", 'r')
data = f.read()
summary = summarize(data, ratio=0.2)
f = open("wiki_en/chosun_min.txt", "w")
@parksunwoo
parksunwoo / QA_baseline_ko.py
Last active December 8, 2018 03:21
QA_baseline_ko
##!pip3 install textrankr
# Step1. 문서요약으로 중요문장 찾기 (여기선 3문장)
from __future__ import print_function
from textrankr import TextRank
f = open("wiki/chosun.txt", 'r')
data = f.read()
textrank = TextRank(data)
@parksunwoo
parksunwoo / show_attend_tell_model.py
Last active December 25, 2018 06:56
show_attend_tell_model
'''
Source code for an attention based image caption generation system described
in:
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
International Conference for Machine Learning (2015)
http://arxiv.org/abs/1502.03044
'''
import torch
import torch.nn as nn
@parksunwoo
parksunwoo / environment.yml
Created January 17, 2020 03:19
lecture1_code_test
channels:
- defaults
dependencies:
- ipython
- ipywidgets
- matplotlib
- numpy
- scipy