묻고 답해요
130만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
작업형1 모의문제
import numpy as npdf['f3'] = df['f3'].replace(np.nan,0).replace('silver',1).replace('gold',2).replace('vip',3)라고 하셨는데 df['f3'] = df['f3'].fillna(0)df['f3'] = df['f3'].replace("silver", 1).replace("gold", 2).replace("vip", 3) 이렇게 해도 답이 133으로 똑같이 나오더라구요!이렇게 해도 되나용?
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
전체 열을 한번에 주석 # 처리하는 방법이 뭔가요?
3-6. 강의에서모델 최적화를 하는 과정에서스케일러를from sklearn.preprocessing import StandardScalerscaler = StandardScaler()cols = ['age', 'bmi']train[cols] = scaler.fit_transform(train[cols])test[cols] = scaler.transform(test[cols])에서 #from sklearn.preprocessing import StandardScaler#scaler = StandardScaler()#cols = ['age', 'bmi']#train[cols] = scaler.fit_transform(train[cols])#test[cols] = scaler.transform(test[cols]) 이렇게 한번에 주석(#)처리하셨는데,어떻게 하신건가요?alt+#shift+#ctrl+# 했는데 다 안되네요ㅠ
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
원핫인코딩 질문
3-4. 의 원핫인코딩에서는c_train = pd.get_dummies(c_train[cols])c_test = pd.get_dummies(c_test[cols]) 3-6. 의 원핫인코딩에서는train = pd.get_dummies(train, columns=cols)test = pd.get_dummies(test, columns=cols)라고 되어 있네요ㅠ 3-6에서도 3-4처럼train = pd.get_dummies(train[cols])test = pd.get_dummies(test[cols])로 실행해 봤는데 결과가 다르게 나오네요! 왜 3-4에서는 [cols] 라고 하고,3-6에서는 columns=cols라고 하는건가요?ㅠ
-
미해결[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
Ultralytics Yolo v3 pip dependency 오류 재발생 (pillow 버전)
안녕하세요 좋은 강의 감사드립니다.그런데 이번에도!cd yolov3;pip install -qr requirements.txt여기서 오류가 발생합니다. 그 내용은 아래와 같습니다.ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. imageio 2.31.6 requires pillow<10.1.0,>=8.3.2, but you have pillow 10.2.0 which is incompatible.저번과 같이 requirements.txt 에서 해당 내용을 주석 처리하면 되는 걸까요?
-
해결됨[개정판] 파이썬 머신러닝 완벽 가이드
Santander Customer Satisfaction 데이터셋 다운로드 관련 질문입니다.
안녕하세요 !머신러닝 재밌게 수강중인 학생입니다.이번에 분류를 공부하다가 산탄데르 데이터셋을 다운로드 받기위해 캐글에 들어갔으나 선생님의 화면과는 다르게 떠서 어디서 다운로드 받아야하는지 모르겠습니다.사진 첨부하겠습니다.감사합니다
-
해결됨실전 인공지능으로 이어지는 딥러닝 개념 잡기
경우에 따른 최적의 활성화 함수 선정하는 방법
안녕하세요 호형 선생님. 강의 잘 들었습니다. 이번 ' 개념편 4강 활성화 함수 ' 에서 질문이 있습니다. 진행하는 업무에 따라 ( 인공 신경망의 각 층에 적용하는 ) 최적의 활성화 함수가 무엇인지는 다 다를 수 있다고 하셨는데요. 그럼 그 최적의 활성화 함수가 무엇일지 미리 연역적으로 알 수 있는 방법이 있나요?( 예를 들면 , 이 문제는 이런 특징이 있으니 , 이런 특징을 잘 나타내는 어쩌구 함수를 활성화 함수로 쓰면 되겠다 등 ) 아니면 그냥 결과적으로 모든 종류의 활성화 함수를 하나하나 대입해보며 가장 좋은 성능이 나오는 함수를 선택하는 수 밖에 없나요 ? 감사합니다.
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
시계열 데이터 수업 자료 어디에?
시계열 데이터를 다루는 수업을 현재 보고 있는데, 관련 자료가 어디에 있나요?제가 일일히 쳐서 하기가 어려워서 데이터 프레임을 받고싶은데,,, 어디에 있는지 못찾겠어요.
-
미해결모두의 한국어 텍스트 분석과 자연어처리 with 파이썬
kkma() 실행시 kernel dead 현상이 발생합니다.
선생님께서 알려주신대로.java > jpype > konlpy 설치를 마치고그 다음 진도를 진행하려 하는데kkma = Kkma()를 실행하는 순간 kernel dead 메시지가 나면서더이상 실행이 안됩니다. googling을 통해서 여러 해법을찾아 보았지만, 해결이 안되고 있는데요... 도움 부탁드립니다.jupyter_notebook의 config 파일 생성 후... buffer_size 도10000000000 으로 상향 조정하는 등의 방법을 써도 해결되지가 않습니다.
-
미해결[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
yolonas augmentation
안녕하세요.배운 내용을 기반으로 yolonas를 학습해보는 과정에서 질문이 있습니다.nas에서 기본적으로 사용하고 있는 transforms 대신에 albumentations 라이브러리를 사용하고 싶은데 계속해서 image 가 없다는 에러가 뜹니다.코드를 어떻게 수정해야하는지 궁금합니다.############## 기존 학습 코드 from super_gradients.training import Trainer from super_gradients.training import dataloaders from super_gradients.training.dataloaders.dataloaders import ( coco_detection_yolo_format_train, coco_detection_yolo_format_val ) from super_gradients.training import models from super_gradients.training.losses import PPYoloELoss from super_gradients.training.metrics import ( DetectionMetrics_050, DetectionMetrics_050_095 ) from super_gradients.training.models.detection_models.pp_yolo_e import PPYoloEPostPredictionCallback from tqdm.auto import tqdm import os import requests import zipfile import cv2 import matplotlib.pyplot as plt import glob import numpy as np import random ROOT_DIR = '/home/바탕화면/test_data' train_imgs_dir = 'train/images' train_labels_dir = 'train/labels' val_imgs_dir = 'val/images' val_labels_dir = 'val/labels' classes = ['fallen', 'normal'] dataset_params = { 'data_dir':ROOT_DIR, 'train_images_dir':train_imgs_dir, 'train_labels_dir':train_labels_dir, 'val_images_dir':val_imgs_dir, 'val_labels_dir':val_labels_dir, 'classes':classes } EPOCHS = 50 BATCH_SIZE = 16 WORKERS = 8 train_data = coco_detection_yolo_format_train( dataset_params={ 'data_dir': dataset_params['data_dir'], 'images_dir': dataset_params['train_images_dir'], 'labels_dir': dataset_params['train_labels_dir'], 'classes': dataset_params['classes'] }, dataloader_params={ 'batch_size':BATCH_SIZE, 'num_workers':WORKERS } ) val_data = coco_detection_yolo_format_val( dataset_params={ 'data_dir': dataset_params['data_dir'], 'images_dir': dataset_params['val_images_dir'], 'labels_dir': dataset_params['val_labels_dir'], 'classes': dataset_params['classes'] }, dataloader_params={ 'batch_size':BATCH_SIZE, 'num_workers':WORKERS } ) train_params = { 'silent_mode': False, "average_best_models":True, "warmup_mode": "linear_epoch_step", "warmup_initial_lr": 1e-6, "lr_warmup_epochs": 3, "initial_lr": 5e-4, "lr_mode": "cosine", "cosine_final_lr_ratio": 0.1, "optimizer": "Adam", "optimizer_params": {"weight_decay": 0.0001}, "zero_weight_decay_on_bias_and_bn": True, "ema": True, "ema_params": {"decay": 0.9, "decay_type": "threshold"}, "max_epochs": EPOCHS, "mixed_precision": True, "loss": PPYoloELoss( use_static_assigner=False, num_classes=len(dataset_params['classes']), reg_max=16 ), "valid_metrics_list": [ DetectionMetrics_050( score_thres=0.1, top_k_predictions=300, num_cls=len(dataset_params['classes']), normalize_targets=True, post_prediction_callback=PPYoloEPostPredictionCallback( score_threshold=0.01, nms_top_k=1000, max_predictions=300, nms_threshold=0.7 ) ), DetectionMetrics_050_095( score_thres=0.1, top_k_predictions=300, num_cls=len(dataset_params['classes']), normalize_targets=True, post_prediction_callback=PPYoloEPostPredictionCallback( score_threshold=0.01, nms_top_k=1000, max_predictions=300, nms_threshold=0.7 ) ) ], "metric_to_watch": 'mAP@0.50:0.95' } trainer = Trainer( experiment_name='yolo_nas_m', ckpt_root_dir='checkpoints' ) model = models.get( 'yolo_nas_m', num_classes=len(dataset_params['classes']), pretrained_weights="coco" ) trainer.train( model=model, training_params=train_params, train_loader=train_data, valid_loader=val_data ) ############## 기존 학습 코드에서 변경 시킨 부분 train_data = coco_detection_yolo_format_train( dataset_params={ 'data_dir': dataset_params['data_dir'], 'images_dir': dataset_params['train_images_dir'], 'labels_dir': dataset_params['train_labels_dir'], 'classes': dataset_params['classes'], 'transforms' : [ A.CLAHE(p=1.0), A.RandomBrightnessContrast(p=1.0), A.RandomGamma(p=1.0), ] }, dataloader_params={ 'batch_size':BATCH_SIZE, 'num_workers':WORKERS } ) val_data = coco_detection_yolo_format_val( dataset_params={ 'data_dir': dataset_params['data_dir'], 'images_dir': dataset_params['val_images_dir'], 'labels_dir': dataset_params['val_labels_dir'], 'classes': dataset_params['classes'], 'transforms' : [ A.CLAHE(p=1.0), A.RandomBrightnessContrast(p=1.0), A.RandomGamma(p=1.0), ] }, dataloader_params={ 'batch_size':BATCH_SIZE, 'num_workers':WORKERS } )
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
파일 위치를 못찾겠습니다
깃허브에서 실습 예제(perfect guide?)를 다운받았습니다. 강의 영상에서는 user에 집어 넣으면 된다고 하셨지만, scikit learn 설치 이슈 때문에 가상환경을 만들어서 그런가 파일 위치가 다른 것 같습니다. 구글에 검색해보니 evns/new_base가 가상환경 경로 라고 하는데 또 막상 이곳에 파일을 넣으니 jupyter notebook에서는 보이지 않더라구요..어떻게 하면 좋을 까요
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
pandas 오류?
scikitlearn 다운그레이드가 안돼서 커뮤니티에 다른 질문들 보며 new_base 가상환경을 구성하고 가상환경 activate 한후 pandas 포함해서 필요한 패키지들 설치 했습니다.가상환경 활성화된 상태에서 pip install jupyter notebook 으로 주피터 노트북 설치한 후에 jupyter notebook 커맨드로 실행시켰습니다. 그리고 새로운 notebook 열어서 사진철머 실행시켰는데 빨간 박스가 뜨면서 경고 문구가 나오네요. 어떻게 해결하면 좋을까요?
-
미해결처음하는 파이썬 머신러닝 부트캠프 (쉽게! 실제 문제로 개념/활용 익히기) [데이터과학 Part2]
Bayesian Optimization에서 optimizer.maximize()함수를 더이상 지원 안한다고 합니다.
- 본 강의 영상 학습 관련 문의에 대해 답변을 드립니다. (어떤 챕터 몇분 몇초를 꼭 기재부탁드립니다)- 이외의 문의등은 평생강의이므로 양해를 부탁드립니다- 현업과 병행하는 관계로 주말/휴가 제외 최대한 3일내로 답변을 드리려 노력하고 있습니다- 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. import numpy as np from xgboost import XGBClassifier from bayes_opt import BayesianOptimization from sklearn.model_selection import cross_val_score pbounds = { 'learning_rate': (0.01, 0.5), 'n_estimators': (100, 1000), 'max_depth': (3, 10), 'min_child_weight': (0, 10), 'subsample': (0.5, 1.0), 'colsample_bytree': (0.5, 1.0) # 'reg_lambda': (0, 1000), # 'reg_alpha': (0, 1.0) } def lgbm_hyper_param(learning_rate, n_estimators, max_depth, min_child_weight, subsample, colsample_bytree): max_depth = int(max_depth) n_estimators = int(n_estimators) clf = LGBMClassifier( max_depth=max_depth, min_child_weight=min_child_weight, learning_rate=learning_rate, n_estimators=n_estimators, subsample=subsample, colsample_bytree=colsample_bytree, random_state=1 # reg_lambda=reg_lambda, # reg_alpha=reg_alpha ) return np.mean(cross_val_score(clf, train_importance, train_answer, cv=5, scoring='accuracy')) # cv 도 숫자로 작성하여, 내부적으로 (Stratified)KFold 사용함 optimizer = BayesianOptimization( f=lgbm_hyper_param, pbounds=pbounds, verbose=1, random_state=1) optimizer.maximize(init_points=10, n_iter=100, acq='ei', xi=0.01) 위 코드를 실행하면 아래와 같은 에러가 발생합니다.--------------------------------------------------------------------------- Exception Traceback (most recent call last) Cell In[44], line 34 31 return np.mean(cross_val_score(clf, train_importance, train_answer, cv=5, scoring='accuracy')) # cv 도 숫자로 작성하여, 내부적으로 (Stratified)KFold 사용함 33 optimizer = BayesianOptimization( f=lgbm_hyper_param, pbounds=pbounds, verbose=1, random_state=1) ---> 34 optimizer.maximize(init_points=10, n_iter=100, acq='ei', xi=0.01) File ~\miniconda3\Lib\site-packages\bayes_opt\bayesian_optimization.py:288, in BayesianOptimization.maximize(self, init_points, n_iter, acquisition_function, acq, kappa, kappa_decay, kappa_decay_delay, xi, **gp_params) 286 old_params_used = any([param is not None for param in [acq, kappa, kappa_decay, kappa_decay_delay, xi]]) 287 if old_params_used or gp_params: --> 288 raise Exception('\nPassing acquisition function parameters or gaussian process parameters to maximize' 289 '\nis no longer supported. Instead,please use the "set_gp_params" method to set' 290 '\n the gp params, and pass an instance of bayes_opt.util.UtilityFunction' 291 '\n using the acquisition_function argument\n') 293 if acquisition_function is None: 294 util = UtilityFunction(kind='ucb', 295 kappa=2.576, 296 xi=0.0, 297 kappa_decay=1, 298 kappa_decay_delay=0) Exception: Passing acquisition function parameters or gaussian process parameters to maximize is no longer supported. Instead,please use the "set_gp_params" method to set the gp params, and pass an instance of bayes_opt.util.UtilityFunction using the acquisition_function argument "set_gp_params" method을 사용하라고 하는데gpt에 물어봐도 제대로 된 코드를 주지 않아서 어려움이 있습니다. 제가 설치한 라이브러리는 아래 목록과 같습니다..Package Version ---------------------------- ------------ absl-py 2.1.0 anyio 3.5.0 archspec 0.2.1 argon2-cffi 21.3.0 argon2-cffi-bindings 21.2.0 asttokens 2.0.5 astunparse 1.6.3 async-lru 2.0.4 attrs 23.1.0 Babel 2.11.0 bayesian-optimization 1.4.3 beautifulsoup4 4.12.2 bleach 4.1.0 boltons 23.0.0 Brotli 1.0.9 cachetools 5.3.2 certifi 2023.11.17 cffi 1.16.0 charset-normalizer 2.0.4 colorama 0.4.6 comm 0.1.2 conda 23.11.0 conda-content-trust 0.2.0 conda-libmamba-solver 23.12.0 conda-package-handling 2.2.0 conda_package_streaming 0.9.0 contourpy 1.2.0 cryptography 41.0.7 cv 1.0.0 cycler 0.12.1 debugpy 1.6.7 Note: you may need to restart the kernel to use updated packages. decorator 5.1.1 defusedxml 0.7.1 distro 1.8.0 executing 0.8.3 fastjsonschema 2.16.2 flatbuffers 23.5.26 fonttools 4.47.2 gast 0.5.4 google-auth 2.26.2 google-auth-oauthlib 1.2.0 google-pasta 0.2.0 grpcio 1.60.0 h5py 3.10.0 idna 3.4 ipykernel 6.25.0 ipython 8.20.0 ipywidgets 8.0.4 jedi 0.18.1 Jinja2 3.1.2 joblib 1.3.2 json5 0.9.6 jsonpatch 1.32 jsonpointer 2.1 jsonschema 4.19.2 jsonschema-specifications 2023.7.1 jupyter 1.0.0 jupyter_client 8.6.0 jupyter-console 6.6.3 jupyter_core 5.5.0 jupyter-events 0.8.0 jupyter-lsp 2.2.0 jupyter_server 2.10.0 jupyter_server_terminals 0.4.4 jupyterlab 4.0.8 jupyterlab-pygments 0.1.2 jupyterlab_server 2.25.1 jupyterlab-widgets 3.0.9 keras 2.15.0 kiwisolver 1.4.5 libclang 16.0.6 libmambapy 1.5.3 lightgbm 4.3.0 Markdown 3.5.2 MarkupSafe 2.1.3 matplotlib 3.8.2 matplotlib-inline 0.1.6 menuinst 2.0.1 mistune 2.0.4 ml-dtypes 0.2.0 nbclient 0.8.0 nbconvert 7.10.0 nbformat 5.9.2 nest-asyncio 1.5.6 notebook 7.0.6 notebook_shim 0.2.3 numpy 1.26.3 oauthlib 3.2.2 opencv-python 4.9.0.80 opt-einsum 3.3.0 overrides 7.4.0 packaging 23.1 pandas 2.2.0 pandocfilters 1.5.0 parso 0.8.3 pillow 10.2.0 pip 23.3.2 platformdirs 3.10.0 pluggy 1.0.0 ply 3.11 prometheus-client 0.14.1 prompt-toolkit 3.0.43 protobuf 4.23.4 psutil 5.9.0 pure-eval 0.2.2 pyasn1 0.5.1 pyasn1-modules 0.3.0 pycosat 0.6.6 pycparser 2.21 Pygments 2.15.1 pyOpenSSL 23.2.0 pyparsing 3.1.1 PyQt5 5.15.10 PyQt5-sip 12.13.0 PySocks 1.7.1 python-dateutil 2.8.2 python-json-logger 2.0.7 pytz 2023.3.post1 pywin32 305.1 pywinpty 2.0.10 PyYAML 6.0.1 pyzmq 25.1.0 qtconsole 5.5.0 QtPy 2.4.1 referencing 0.30.2 requests 2.31.0 requests-oauthlib 1.3.1 rfc3339-validator 0.1.4 rfc3986-validator 0.1.1 rpds-py 0.10.6 rsa 4.9 ruamel.yaml 0.17.21 scikit-learn 1.4.0 scipy 1.12.0 Send2Trash 1.8.2 setuptools 68.2.2 sip 6.7.12 six 1.16.0 sniffio 1.3.0 soupsieve 2.5 stack-data 0.2.0 tensorboard 2.15.1 tensorboard-data-server 0.7.2 tensorflow 2.15.0 tensorflow-estimator 2.15.0 tensorflow-intel 2.15.0 tensorflow-io-gcs-filesystem 0.31.0 termcolor 2.4.0 terminado 0.17.1 threadpoolctl 3.2.0 tinycss2 1.2.1 tornado 6.3.3 tqdm 4.65.0 traitlets 5.7.1 truststore 0.8.0 typing_extensions 4.7.1 tzdata 2023.4 urllib3 1.26.18 wcwidth 0.2.5 webencodings 0.5.1 websocket-client 0.58.0 Werkzeug 3.0.1 wheel 0.41.2 widgetsnbextension 4.0.5 win-inet-pton 1.1.0 wrapt 1.14.1 xgboost 2.0.3 zstandard 0.19.0 궁극적인 질문은앞으로 파이썬은 계속 업데이트가 될텐데 그때마다어디를 찾아봐야하는지 어떻게 검색해야하는지에 관해서도 알려주시면 감사하겠습니다..
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
상관 Heatmat에서 질문 있습니다.
안녕하세요! 머신러닝 강의 마지막 부분에 히트맵을 표현하는 부분에서 ValueError가 발생하여 질문드립니다. 강의 코드를 따라가는 도중 titanic_df.corr()인 부분이 있는데 숫자형 열이 아닌 부분은 자동으로 제외되어야 하는데 저는 아래와 같은 에러가 발생합니다. ValueError: could not convert string to float: 'Braund, Mr. Owen Harris' 무슨 문제인지 해결이 안되어 질문드렸습니다!답변 부탁드립니다. 감사합니다.
-
미해결모두의 한국어 텍스트 분석과 자연어처리 with 파이썬
설문조사 주관식 데이터 처리방법 문의
이전에 고객 설문데이터를 가지고 보고서를 만들었던 경험이 있습니다.객관식은 전체 응답기준으로 엑셀로 매크로를 이용하여 그래프를 만들면 되는데문제는 주관식입니다.주관식은 요약을 보고서에 담아야 되어서, 전체를 읽어보고 전체 의견요약을 하고,긍정의견, 부정의견을 나누고 그에 대한 요약을 작성을 일일이 사람이 전체를 읽어서 처리를 합니다.건수가 작으면 혼자 하면 되는데 20만건 데이터 처리는 혼자는 하기 힘들고 여러명이 나눠서 해야만 됩니다. 데이터가 많을 경우 ChatGPT로 요약을 해보니 최대 처리할 수 있는 데이터 크기가 32k까지 밖에 처리가 되지 않아 몇%만 샘플링해서 요약하는 방법밖에 없었습니다. 그럼 샘플링에 따라서 고객의견이 정확하게 반영이 되 지않아 결국은 여러명이 수작업으로 진행했습니다. 자연어 처리로 자동으로 긍정, 부정을 분류까지는 가능할것도 같은데 분류된 데이터 가지고 긍정의견의 요약, 부정의견의 요약을 딥러닝으로 해결이 가능할까요?아니면 어떤 좋은 방법이 있을까요?
-
미해결처음하는 파이썬 머신러닝 부트캠프 (쉽게! 실제 문제로 개념/활용 익히기) [데이터과학 Part2]
Bayesian Optimization LightGBM 적용
import numpy as npfrom xgboost import XGBClassifierfrom bayes_opt import BayesianOptimizationfrom sklearn.model_selection import cross_val_scorepbounds = { 'learning_rate': (0.01, 0.5), 'n_estimators': (100, 1000), 'max_depth': (3, 10), 'min_child_weight': (0, 10), 'subsample': (0.5, 1.0), 'colsample_bytree': (0.5, 1.0) # 'reg_lambda': (0, 1000), # 'reg_alpha': (0, 1.0)}def lgbm_hyper_param(learning_rate, n_estimators, max_depth, min_child_weight, subsample, colsample_bytree): max_depth = int(max_depth) n_estimators = int(n_estimators) clf = LGBMClassifier( max_depth=max_depth, min_child_weight=min_child_weight, learning_rate=learning_rate, n_estimators=n_estimators, subsample=subsample, colsample_bytree=colsample_bytree, random_state=1 # reg_lambda=reg_lambda, # reg_alpha=reg_alpha ) return np.mean(cross_val_score(clf, train_importance, train_answer, cv=5, scoring='accuracy')) # cv 도 숫자로 작성하여, 내부적으로 (Stratified)KFold 사용함optimizer = BayesianOptimization( f=lgbm_hyper_param, pbounds=pbounds, verbose=1, random_state=1)optimizer.maximize(init_points=10, n_iter=100, acq='ei', xi=0.01)에서| iter | target | colsam... | learni... | max_depth | min_ch... | n_esti... | subsample | ------------------------------------------------------------------------------------------------- [LightGBM] [Info] Number of positive: 273, number of negative: 439 [LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.000185 seconds. You can set force_row_wise=true to remove the overhead. And if memory is not enough, you can set force_col_wise=true. [LightGBM] [Info] Total Bins 90 [LightGBM] [Info] Number of data points in the train set: 712, number of used features: 45 [LightGBM] [Info] [binary:BoostFromScore]: pavg=0.383427 -> initscore=-0.475028 [LightGBM] [Info] Start training from score -0.475028 [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf같은 오류가 발생합니다...
-
해결됨[개정판] 파이썬 머신러닝 완벽 가이드
k-fold 작동방식에 관한 질문입니다.
dt_clf = DecisionTreeClassifier(random_state=156) skfold = StratifiedKFold(n_splits=3) n_iter=0 cv_accuracy=[] # StratifiedKFold의 split( ) 호출시 반드시 레이블 데이터 셋도 추가 입력 필요 for train_index, test_index in skfold.split(features, label): # split( )으로 반환된 인덱스를 이용하여 학습용, 검증용 테스트 데이터 추출 X_train, X_test = features[train_index], features[test_index] y_train, y_test = label[train_index], label[test_index] #학습 및 예측 dt_clf.fit(X_train , y_train) pred = dt_clf.predict(X_test) # 반복 시 마다 정확도 측정 n_iter += 1 accuracy = np.round(accuracy_score(y_test,pred), 4) train_size = X_train.shape[0] test_size = X_test.shape[0] print('\n#{0} 교차 검증 정확도 :{1}, 학습 데이터 크기: {2}, 검증 데이터 크기: {3}' .format(n_iter, accuracy, train_size, test_size)) print('#{0} 검증 세트 인덱스:{1}'.format(n_iter,test_index)) cv_accuracy.append(accuracy) # 교차 검증별 정확도 및 평균 정확도 계산 print('\n## 교차 검증별 정확도:', np.round(cv_accuracy, 4)) print('## 평균 검증 정확도:', np.mean(cv_accuracy)) 안녕하세요 선생님. k-fold 작동방식에 관한 질문이 있어 글 남깁니다. 전체 데이터셋에서 테스트셋을 제외하고, k개의 데이터셋으로 나누어 학습과 검증을 k번 반복한다. 그리고, 교차 검증 최종 평가는 k번의 학습과 검증에서의 평가지표를 평균낸다. 정도로 이해하였습니다. 여기서 저의 궁금점은 다음과 같습니다.k번의 학습과 검증을 반복하면서 가장 좋았던 iteration의 모델을 최종 모델로 가져가는것인지, 아니면 k번의 학습을 통한 모델의 파라미터들을 평균을 내어 최종 모델을 새로 구하는 것인지 궁금합니다.최종 평가지표는 k번의 학습과 검증에서의 평가지표 평균이 아닌, 테스트셋에 대한 평가지표가 더 적당하지 않은지 궁금합니다.위 코드에서처럼 for문 안에 fit을 통해 모델 학습을 시킬 때, 이전 iteration에서의 모델 학습과는 전혀 연관되지 않게 새로 학습을 시작하는것인지 아니면 이어서 학습하는 것인지 궁금합니다.
-
해결됨[개정판] 파이썬 머신러닝 완벽 가이드
교재 125쪽 minMaxScaler와 가우시안 분포
안녕하세요 선생님덕분에 머신러닝 너무 재밌게 공부중입니다. 데이터의 분포가 가우시안 분포가 아닐 경우에 minMaxScaler을 적용해 볼 수 있습니다.라고 나와있는데, 이유가 무엇인지 알 수 있을까요? 제가 생각해본 이유들은 다음과 같습니다.이미 평균은 0, 표준편차는 1로 정규화되어있어 다시 정규화를 진행할 필요가 없다.정규분포는 양끝값이 없나..? 그래서 min값과 max값이 너무 멀리 떨어져있나?? - 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 강의 내용을 질문할 경우 몇분 몇초의 내용에 대한 것인지 반드시 기재 부탁드립니다. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.
-
미해결[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
코드가 에러가 납니다
for i, img in enumerate(imgs): length = valid_len[i] img = inference.visualize_image( img, boxes[i].numpy()[:length], classes[i].numpy().astype(np.int)[:length], scores[i].numpy()[:length], label_map=config.label_map, min_score_thresh=config.nms_configs.score_thresh, max_boxes_to_draw=config.nms_configs.max_output_size) output_image_path = os.path.join('/content/data_output', str(i) + '.jpg') Image.fromarray(img).save(output_image_path) print('writing annotated image to %s' % output_image_path)AutoML Efficientdet Inference수행 결과 분석 및 시각화 강의입니다. (8분 48초)여기에서 Image.fromarray(img).save(output_image_path) 부분에서 TypeError: function takes at most 14 arguments (17 given) 이라고 뜹니다. (강의에서는 정상적으로 작동하네요...)뭐가 문제일까요?
-
미해결캐글 Advanced 머신러닝 실전 박치기
LightGBM Iteration관련
안녕하세요 LightGBM Iteration관련 문의드립니다. 설명해 주신 코드로 작성하였으나 이터레이션마다 Score가 표시되지 않습니다 verbose를 100으로 설저했는데 다음과 같이만 조회됩니다.이유가 무엇일까요?LightGBM] [Debug] Trained a tree with leaves = 32 and depth = 10 [LightGBM] [Debug] Trained a tree with leaves = 32 and depth = 10 [LightGBM] [Debug] Trained a tree with leaves = 32 and depth = 8 [LightGBM] [Debug] Trained a tree with leaves = 32 and depth = 9 [LightGBM] [Debug] Trained a tree with leaves = 32 and depth = 8 [LightGBM] [Debug] Trained a tree with leaves = 32 and depth = 10 [LightGBM] [Debug] Trained a tree with leaves = 32 and depth = 11 [LightGBM] [Debug] Trained a tree with leaves = 32 and depth = 9 [LightGBM] [Debug] Trained a tree with leaves = 32 and depth = 11 Early stopping, best iteration is: [902] training's binary_logloss: 0.210459 valid_1's binary_logloss: 0.242339from lightgbm import LGBMClassifierclf = LGBMClassifier( n_jobs=-1, # CPU성능 n_estimators=1000, #1000개 tree learning_rate=0.02, #학습률 낮을수록 정교함 num_leaves=32, # 가지치기 수 subsample=0.8, #활용할 sample비중 max_depth=12, #가지깊이 verbose=100, #출력메세지 최소화 early_stopping_rounds= 50, eval_metric= 'auc' )clf.fit(train_X, train_y, eval_set=[(train_X, train_y), (valid_X, valid_y)])
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
데이터 분류과정에서 코드 질문
X_train, X_test,y_train, y_test= train_test_split(iris_data.data, iris_data.target, test_size=0.3, random_state=121) 를 이용해서 데이터를 분류하는데 이때 X_test, X_train이 학습용 피쳐값인지 테스트용 피쳐값인지 구분을 하는 메커니즘이 뭘까요? 위치로 구분을 하는 것인가요??