Python

Python

[python] density plot에서 Peak 값(max or min value) 구하고 표시하기

#1. kdeplot #2. get x, y #3. get max or min #4. marking import seaborn as sns import numpy as np #1. ax = sns.kdeplot(th_box_sub2, label='sub2') #2. x = ax.lines[0].get_xdata() # Get the x data of the distribution y = ax.lines[0].get_ydata() # Get the y data of the distribution #3. maxid1 = np.argmax(y) # get max in all maxid2 = np.argmax(y[x0.56) & (x0.56) & (x0.56) & (x0.56) & (x

Python

[python] NumPy where,Multiple conditions

output = array[np.where((array condition2))] output = array[np.where((array > condition1) & (array < condition2))] ref:https://www.kite.com/python/answers/how-to-use-numpy-where-with-multiple-conditions-in-python Kite - Free AI Coding Assistant and Code Auto-Complete Plugin Code faster with Kite’s AI-powered autocomplete plugin for over 16 programming languages and 16 ID..

Python

[linux] [Streamlit] streamlit을 이용해서간단한 머신러닝 사용 앱 구현하기

index 1. data scientist life cycle 2. install streamlit 3. edit config file 4. run .py file 1. data scientist life cycle 데이터 사이언스를 한다면 프로젝트 단위로 위 사이클에서 크게 벗어나지 않을 것임. 그 중에서 Model Deployment 부분에 대한 글임 2. install streamlit - streamlit은 머신러닝 및 데이터 사이언스를 위한 맞춤 웹 앱을 쉽게 만들고 공유할 수 있는 오픈소스 python 라이브러리임. - pip install 가능 pip install streamlit 3. edit config file 예제 참고 예제 1. https://www.geeksforgeeks.org..

Python

[python] XGBoost : Dimension Reduction,Feature selection using Feature importance or BorutaShap

XGBoost : Dimension Reduction (feature selection) 1. Feature importance 2. BorutaShap XGBoost 알고리즘으로 모델을 만들고 최대한 input variables을 줄여 경제적인 모델을 만들기 위해 두 가지 방법을 사용해 봄. 1. Feature importance - XGBoost의 기본 내장된 feature_importance를 이용하는 방법. - importance가 가장 작은 변수를 차례대로 제거 해주고 train에서 성능을 비교 - 본인의 기준에 맞게 제거할 변수를 선택 - 논리적이긴 하나 특별한 이론이 개입된 방법은 아니기 떄문에 신뢰성에 대한 이슈는 있음. #1.1 XGBoost의 내장되어 있는 기능으로 importance를..

Python

[python] StandardScaler와 machine learning 모델 공유

standardscaler, machine learning 모델 공유 0. background 1. scaler (standardscaler) 2. machine learning model (XGBoost) 0. background - machine learning 모델을 재현가능하게 공유할 때 모델을 저장하고 불러와야함. - 그전에 standardization을 진행한 scaler도 포함되어야 완벽한 재현이 가능함. - fit된 scaler와 machine learning 모델을 저장하고 불러와야 기존 결과를 완벽히 재현할 수 있음. - 핵심은 reproducible ! 참고: https://machinelearningmastery.com/reproducible-machine-learning-resul..

Python

[python][mljar] automated machine learning - Part2 : mljar

순서 1. mljar : automated machine learning 2. install - pip 3. run code 4. report 1. mljar : automated machine learning - 머신러닝 자동화 프레임 워크 그림참고 참고 : https://mljar.com/automated-machine-learning/ What is Automated Machine Learning? The MLJAR Automated Machine Learning (AutoML) Framework mljar.com 2. install - pip, conda 설치는 pip로만 가능 아직 conda 불가능 pip install mljar-supervised 참고 : https://pypi.org/pro..

Python

[python][TPOT] automated machine learning - Part1 : TPOT(GPU)

- XGBoost 환경 셋팅 #0. tpot and xgboost #1. cpu : conda install #2. single gpu : cuml #3. multi gpu : rapids, conda install tpot and dask_ml #0 TPOT and XGBoost #0.0 TPOT for Automated Machine Learning Automated Machine Learning (AutoML) 사용자 개입이 거의없이 예측 모델링 작업을 위해 성능이 우수한 모델을 자동으로 검색하는 기술 TPOT - Python에서 AutoML을 수행하기위한 오픈 소스 라이브러리 - 데이터 변환 및 기계 학습 알고리즘에 인기있는 Scikit-Learn 기계 학습 라이브러리를 사용 - 유전 프로그래밍 ..

Python

[python] 결측치, outlier 제거하기

결측치 제거 df = Q1 - 1.5 * IQR) & (y_train_pd['pred-true']

Chandler.j
'Python' 카테고리의 글 목록 (3 Page)