Thief of Wealth
Classifier 저장 및 불러오기
개발/ML+ Data Science 2019. 8. 22. 21:41

Cloud를 이용해서 사용하다보면 연결이 끊기거나 세션이 강제로 종료될떄 처음 부터 다시 시작해야하는 단점이 있습니다.이를 해결해기 위해서 이떄까지 학습한 classifier들을 저장하고 불러오는 방법을 아래에 소개합니다. 학습도중 가중치를 저장했다가 이어서하는 방법은 추후에 올리도록 하겠습니다. https://machinelearningmastery.com/save-load-machine-learning-models-python-scikit-learn/ 123456789101112131415161718192021222324252627# Save Model Using Pickleimport pandasfrom sklearn import model_selectionfrom sklearn.linear_mod..

t-SNE (t-Stochastic Neighbor Embedding) 이란?
개발/ML+ Data Science 2019. 8. 22. 08:56

https://lovit.github.io/nlp/representation/2018/09/28/tsne/ t-Stocastic Nearest Neighbor (y-SNE)는 vector visualization 을 위하여 자주 이용되는 알고리즘입니다.t-SNE는 고차원의 벡터로 표현돠는 데이터 간의 neighbor structure를 보존하는 2차원의 ebedding vector를 학습함으로써,고차원의 데이터를 2차원의 지도로 표현합니다.t-SNE 는 벡터 시각화를 위한 다른 알고리즘들보다 안정적인 임베딩 학습결과를 보여줍니다.이는 t-SNE가 데이터간 거리를 stocastic probability로 변환하여 임베딩에 이용하기 때문입니다.그리고 이 stocastic probability는 perplex..

Oversampling하는 올바른 방법
개발/ML+ Data Science 2019. 8. 21. 22:52

https://beckernick.github.io/oversampling-modeling/ Imbalance한 데이터셋이 많아지고 있습니다. 아마존은 가짜 리뷰를 식별해내기를 원하고, 은행은 가짜 신용카드를 구별해내기를 원합니다.그리고 이번 11월에 페이스북 연구진들은 현실적으로 어떤 기사가 가짜인지 예측할수 있는가에 대한 궁금증을 가지게 되었습니다. 이런 케이스들은 오직 적은 관측량 만이 실제로 참입니다. 제가 알기로는 거의 10000개중 1개만 가짜 신용카드입니다.최근에 oversampling은 적은 class들을 이용하여 예측모델을 향상시키는 것에 사용됩니다.oversampling은 때때로 각기다른 패턴인식에 좋은 영향을 줍니다. 하지만 이 글은 모델의 예측향상을 어떻게 할것이냐가 아닙니다. 대신..

Outlier 결정 및 trade off사항
개발/ML+ Data Science 2019. 8. 21. 13:56

Anomaly Detection:Our main aim in this section is to remove "extreme outliers" from features that have a high correlation with our classes. This will have a positive impact on the accuracy of our models. Interquartile Range Method:Interquartile Range (IQR): We calculate this by the difference between the 75th percentile and 25th percentile. Our aim is to create a threshold beyond the 75th and 25..

Random Oversampling 방법
개발/ML+ Data Science 2019. 8. 21. 11:56

https://www.kaggle.com/janiobachmann/credit-fraud-dealing-with-imbalanced-datasets Random Under-Sampling: In this phase of the project we will implement "Random Under Sampling" which basically consists of removing data in order to have a more balanced dataset and thus avoiding our models to overfitting.Steps:The first thing we have to do is determine how imbalanced is our class (use "value_count..

Scaler 의 종류
개발/ML+ Data Science 2019. 8. 21. 10:29

https://mkjjo.github.io/python/2019/01/10/scaler.html 스케일링의 종류Scikit-Learn에서는 다양한 종류의 스케일러를 제공하고 있다. 그중 대표적인 기법들이다. 종류설명1StandardScaler기본 스케일. 평균과 표준편차 사용2MinMaxScaler최대/최소값이 각각 1, 0이 되도록 스케일링3MaxAbsScaler최대절대값과 0이 각각 1, 0이 되도록 스케일링4RobustScaler중앙값(median)과 IQR(interquartile range) 사용. 아웃라이어의 영향을 최소화 1. StandardScaler평균을 제거하고 데이터를 단위 분산으로 조정한다. 그러나 이상치가 있다면 평균과 표준편차에 영향을 미쳐 변환된 데이터의 확산은 매우 달라지게 ..

Imbalance 한 dataset에서의 실수 및 방법
개발/ML+ Data Science 2019. 8. 20. 13:36

Correcting Previous Mistakes from Imbalanced Datasets: - Never test on the oversampled or undersampled dataset.(일단 오버샘플링 또는 언더샘플링된 dataset에 test하지마라.) - If we want to implement cross validation, remember to oversample or undersample your training data during cross-validation, not bofore!(cross validation하고 싶다면 오버/언더 샘플링 이후에 해라) - Don't use accuracy score as a metric with imbalanced datasets (wil..

머신러닝 분석에 필요한 단계들 (수정중)
개발/ML+ Data Science 2019. 8. 20. 11:43

특성 둘러보기 (데이터타입) 특성 이해하기 (이해할 수 없는것은 넘어가기) 히스토그램으로 분포 살펴보기 중복 제거하기 분산체크하기 ( 타겟별 분포, 각 feature별 분포 ). 필요하다면 스케일링 outlier값 탐지해내서 제거하기. (min, max) 체크 특성가공하기 (알기쉬운 이름으로 바꾼다던지, 연산하기 쉬운 걸로 바꾼다던지(date_time) ) 데이터타입 숫자형, 문자형 잘 결정하기 (1인데 '1'일수도있음) LabelEncoding, One-hot Encoding, Mean Encoding등을 사용해서 인코딩하기 모델 결정하기 앙상블할것인지 결정하기 GridSeach도 고려하기. 제출 =================== ### Outline :1. Understanding our data...

profile on loading

Loading...