Thief of Wealth
PCA로 feature 줄이기 예제!
개발/ML+ Data Science 2019. 10. 1. 13:02

다음은 IEEE Fraud dataset에서 V1~340으로 표시된 feature를 줄이는 예제이다. sc = preprocessing.MinMaxScaler()pca = PCA(n_components=2) # 2개로!vcol_pca = pca.fit_transform( sc.fit_transform( all_data[vcols].fillna(-1) ) # na값 최소값인 -1로하고 minmax! 한후에 pca!!) all_data['_vcol_pca0'] = vcol_pca[:, 0] # PCA로 2개가 나왔을테니 그중 1개를 피처all_data['_vcol_pca1'] = vcol_pca[:, 1] # PCA로 2개가 나왔을테니 그중 1개를 피처all_data['_vcol_nulls'] = all_d..

어떤 feature의 value_count를 그래프로 정렬해서 표현하는 template
개발/ML+ Data Science 2019. 10. 1. 12:43

def plot_count(feature, title, df, size=1): f,ax = plt.subplots(1,1,figsize=(4*size, 4)) total = float( len(df) ) g = sns.countplot(df[feature], order=df[feature].value_counts().index[:30], palette='Set3') g.set_title(F"Number and percentage of {title}") if( size > 2 ): plt.xticks(rotation=90, size=8) for p in ax.patches: height = p.get_height() ax.text(p.get_x() + p.get_width()/2., height + 3, ..

train set이랑 test set의 feature별 개수차이 보여주는 template
개발/ML+ Data Science 2019. 10. 1. 12:32

def print_train_test_diff(trainset, testset): temp_df = pd.DataFrame() for column in list(trainset.columns.values): field_type = trainset[column].dtype try: temp_df = temp_df.append( pd.DataFrame( { 'column' : column, 'train': trainset[column].nunique(), 'test' : testset[column].nunique(), 'type' : field_type }, index = [0] ) ) except: "Error trying to add target from test" # testset에 target값이 없..

Missing data 개수,비율,dtype 출력하는 template
개발/ML+ Data Science 2019. 10. 1. 12:14

def missing_data(data): total = data.isnull().sum() percent = (data.isnull().sum()/data.isnull().count() * 100) tt = pd.concat( [total, percent], axis=1, keys=['Total', 'Percent'] ) types = [] for col in data.columns: dtype = str(data[col].dtype) types.append(dtype) tt['Types'] = types return (np.transpose(tt))

Node Js에 대한 직관적인 해석
개발/Web Programming 2019. 10. 1. 10:29

" 브라우저 밖의 JavaScript " node 치면 콘솔창에서도 javaScript를 사용할 수 있음 (일부 예외 alert같은거) javascript는 원래 브라우저에 종속되어있었는데, nodejs가 탄생함으로써 그 관계를 벗어날 수 있게됨.

WebApp과 Website차이
개발/Web Programming 2019. 10. 1. 10:27

https://www.quora.com/What-is-the-difference-between-a-web-application-and-a-web-site -WebSite Websites are basically collections of web pages. You access them using a browser. You're basically just supposed to read and look at everything that's on a website, and that's the majority of your experience as a user. When you read the content on a website, your goal is to learn something and to absor..

딥러닝 논문읽기 텐서플로우 코리아 주관
개발/Deep Learning 2019. 9. 30. 22:53

https://www.youtube.com/playlist?list=PLWKf9beHi3TgstcIn8K6dI_85_ppAxzB8

what is helmet? (helmet이란 무엇인가?)
개발/Web Programming 2019. 9. 30. 21:12

https://www.npmjs.com/package/helmet Helmet helps you secure your Express apps by setting various HTTP headers. It's not a silver bullet, but it can help! helmet은 http header을 보안해주는 역할을 한다. import helmet from "helmet"; app.use(helmet());

profile on loading

Loading...