전체 글
-
4/13카테고리 없음 2022. 4. 22. 17:01
# 4/13 corr = train['TARGET'].corr(train['EXT_SOURCE_3']) = corr = train['EXT_SOURCE_3'].corr(train['TARGET']) = -0.17891869762837073 bureau_agg = bureau.drop(columns = ['SK_ID_BUREAU']).groupby('SK_ID_CURR', as_index = False).agg(['count', 'mean', 'max', 'min', 'sum']).reset_index() columns = ['SK_ID_CURR'] for var in bureau_agg.columns.levels[0]: if var != 'SK_ID_CURR': for stat in bureau_agg...
-
4/12카테고리 없음 2022. 4. 22. 17:01
# 4/12 fit()/transform() vs fit_transform() train셋에만 fit_transform() 가능, test셋에 쓰면 train셋으로 학습한걸 지워버리고 test셋만 학습해버리기 때문에 안됨 StandardScaler.fit() : 평균 𝜇과 표준편차 𝜎를 계산 StandardScaler.transform() : 정규화/표준화, Standardization, z = (𝑥-𝜇)/𝜎 RobustScaler : 평균과 분산 대신에 중간 값과 사분위 값을 사용합니다. Normalizer : 특성 벡터의 유클리디안 길이가 1이되도록 조정합니다. # KFold model = lgb.LGBMClassifier(n_estimators=10000, objective = 'binary', b..
-
4/11카테고리 없음 2022. 4. 22. 17:00
.value_counts() = unique() #항목명 + nunique() #항목개수 ex) df['color'].unique() # array['red','blue','green'], df['color'].nunique() # 3, df[].value_counts() # red 1 blue 1 green 1 df.select_dtypes('object').apply(pd.Series.nunique, axis=0) # 더미화 대상찾기 (2면 labelencoder 2이상 onehotencoder) app_train, app_test = app_train.align(app_test, join = 'inner', axis = 1) # 더미화 후 train엔 있지만 test엔 없는 변수제거 (app_tra..
-
-
4/8카테고리 없음 2022. 4. 8. 20:51
def 모델 데이터 샘플링 변수 중요도(shap) def extract_good_features_using_shap_LGB(params, SEED): clf = lgb.LGBMClassifier(objective='multiclass', random_state=1989, silent=True, metric='multi_logloss', n_jobs=-1, n_estimators=10000, class_weight='balanced', max_depth=params['max_depth'], learning_rate=params['learning_rate'], colsample_bytree = params['colsample_bytree'], min_split_gain= params['min_split_ga..
-
-
3/28<Kaggle>/[TensorFlow Speech Recognition] 2022. 3. 28. 21:19
- tf.constant() - tf.Variable() - tf.placeholder() # tf.constant() : 변하지 않는 상수 생성 # tf.Variable() : 값이 바뀔 수도 있는 변수 생성 import tensorflow as tf sess = tf.Session() x1 = tf.constant([10], dtype=tf.float32, name='test1') x2 = tf.Variable([8], dtype=tf.float32, name='test2') init = tf.global_variables_initializer() sess.run(init) # 초기화 먼저 진행 print(sess.run(x1)) # 값 부여 ## tf.placeholder + feed_dict : ..
-
3/26<Kaggle>/[TensorFlow Speech Recognition] 2022. 3. 26. 21:25
-tf.placeholder() : 선언한 후, 값을 부여한다. - clip = noise[idx:(idx+16000)] - glob.glob(path, recursive=True) from glob import glob 파라미터 recursive=True 로 설정하고 ** 로 작성하면 하위 폴더에도 접근할 수 있습니다 - filter(조건 함수, 순회 가능한 데이터) - map(조건 함수, 순회 가능한 데이터) - .strip() : 문자열/공백 제거 ex_str = " abc " ex_str.strip() # 'abc'