묻고 답해요
158만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결초보자도 가능한 고급 데이터 분석, Orange 단계별 마스터 팩
에드온 위젯 설치 관련
안녕하세요Orange3 > Options > Add-ons 를 클릭하면 아래와 같은 '경고' 와 '에러'가 뜹니다.강의에서처럼 다양한 에드온도 없이 빈 공란입니다. [1]Warning "There's an issue with your Internet connection ..." [2]Error "An error occurred while running a subprocess..."[2] 에러에 대한 세부 내용equirement already satisfied: orange3-explain in c:\users\mypc\appdata\local\programs\orange\lib\site-packages (0.6.10)ERROR: Could not find a version that satisfies the requirement text==1.0.0 (from versions: none)ERROR: No matching distribution found for text==1.0.0[1] 경고에 대한 세부 내용Traceback (most recent call last):File "C:\Users\MyPC\AppData\Local\Programs\Orange\Lib\site-packages\urllib3\connectionpool.py", line 467, in makerequestself._validate_conn(conn)File "C:\Users\MyPC\AppData\Local\Programs\Orange\Lib\site-packages\urllib3\connectionpool.py", line 1099, in validateconnconn.connect()File "C:\Users\MyPC\AppData\Local\Programs\Orange\Lib\site-packages\urllib3\connection.py", line 653, in connectsock_and_verified = sslwrap_socket_and_match_hostname(^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "C:\Users\MyPC\AppData\Local\Programs\Orange\Lib\site-packages\urllib3\connection.py", line 806, in sslwrap_socket_and_match_hostnamessl_sock = ssl_wrap_socket(^^^^^^^^^^^^^^^^File "C:\Users\MyPC\AppData\Local\Programs\Orange\Lib\site-packages\urllib3\util\ssl_.py", line 465, in ssl_wrap_socketssl_sock = sslwrap_socket_impl(sock, context, tls_in_tls, server_hostname)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "C:\Users\MyPC\AppData\Local\Programs\Orange\Lib\site-packages\urllib3\util\ssl_.py", line 509, in sslwrap_socket_implreturn ssl_context.wrap_socket(sock, server_hostname=server_hostname)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "C:\Users\MyPC\AppData\Local\Programs\Orange\Lib\ssl.py", line 517, in wrap_socketreturn self.sslsocket_class._create(^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "C:\Users\MyPC\AppData\Local\Programs\Orange\Lib\ssl.py", line 1104, in _createself.do_handshake()File "C:\Users\MyPC\AppData\Local\Programs\Orange\Lib\ssl.py", line 1382, in do_handshakeself._sslobj.do_handshake()ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006) During handling of the above exception, another exception occurred: Traceback (most recent call last):File "C:\Users\MyPC\AppData\Local\Programs\Orange\Lib\site-packages\urllib3\connectionpool.py", line 793, in urlopenresponse = self._make_request(^^^^^^^^^^^^^^^^^^^File "C:\Users\MyPC\AppData\Local\Programs\Orange\Lib\site-packages\urllib3\connectionpool.py", line 491, in makerequestraise new_eurllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006) The above exception was the direct cause of the following exception: Traceback (most recent call last):File "C:\Users\MyPC\AppData\Local\Programs\Orange\Lib\site-packages\requests\adapters.py", line 667, in sendresp = conn.urlopen(^^^^^^^^^^^^^File "C:\Users\MyPC\AppData\Local\Programs\Orange\Lib\site-packages\urllib3\connectionpool.py", line 847, in urlopenretries = retries.increment(^^^^^^^^^^^^^^^^^^File "C:\Users\MyPC\AppData\Local\Programs\Orange\Lib\site-packages\urllib3\util\retry.py", line 515, in incrementraise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='orange.biolab.si', port=443): Max retries exceeded with url: /addons/list (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))) During handling of the above exception, another exception occurred: Traceback (most recent call last):File "C:\Users\MyPC\AppData\Local\Programs\Orange\Lib\site-packages\orangecanvas\application\utils\addons.py", line 350, in list_available_versionsdefaults = config.addon_defaults_list()^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "C:\Users\MyPC\AppData\Local\Programs\Orange\Lib\site-packages\Orange\canvas\config.py", line 166, in addon_defaults_listreturn session.get(OFFICIAL_ADDON_LIST).json()^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "C:\Users\MyPC\AppData\Local\Programs\Orange\Lib\site-packages\requests\sessions.py", line 602, in getreturn self.request("GET", url, **kwargs)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "C:\Users\MyPC\AppData\Local\Programs\Orange\Lib\site-packages\requests\sessions.py", line 589, in requestresp = self.send(prep, **send_kwargs)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "C:\Users\MyPC\AppData\Local\Programs\Orange\Lib\site-packages\requests\sessions.py", line 703, in sendr = adapter.send(request, **kwargs)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "C:\Users\MyPC\AppData\Local\Programs\Orange\Lib\site-packages\requests\adapters.py", line 698, in sendraise SSLError(e, request=request)requests.exceptions.SSLError: HTTPSConnectionPool(host='orange.biolab.si', port=443): Max retries exceeded with url: /addons/list (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)')))
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
LGBMClassifier 로 plot_importance() 실행시 오류 발생합니다.
LightGBM을 이용한 위스콘신 유방암 예측 10:54 LGBMClassifier 로 plot_importance() 실행시 오류 발생합니다.lightgbm 3.3.2 버전으로 다운그레이드했습니다.그래도 오류가 발생합니다.code 는 fig, ax = plt.subplots(figsize=(10, 12))plot_importance(lgbm_wrapper, ax=ax)plt.show()입니다 tree must be Booster, XGBModel or dict instance라는 메세지 입니다.
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
ML Model Sqauence에 대한 이해
안녕하세요 교수님교수님의 머신러닝 강의가 정말 많은 도움이 되고 있어 감사하고 있습니다.저는 통계를 우선 공부를 한 후 교수님 강의를 통해 머신러닝을 공부중인 연구개발 직장인입니다.지도학습, 비지도학습 각각의 모델에 대한 개요와 내용들은 정말 자세하게 설명해주시는 것 같습니다.다만, 예측 모델을 만든다 라고 했을 때, 저는 다음 과정으로 머신 러닝을 이해했습니다.틀린 게 있거나, 부족하면 말씀부탁드립니다.1. Teat data set EDA2. Data pre-processing3. Input feature select, extract4. Model training5. Model validation6. new input feature prediction연속 데이터로 이루어진 실험데이터로 선형 회귀 예측 모델을 구현한다라고 했을 때 하기 내용에 대해 궁금합니다.step 2. 과정에서 standardization scaling 했을 때 정규성 검증은 필요가 없나요?? (e.g. shaprio-wilks test, 각 feature 별 QQ plot)step 3. 과정에서 교수님 강의에서는 data scaling 이후 바로 모델 학습/예측/평가를 진행하고, feature 별 회귀 계수를 구하십니다.(경사 하강법)저는 해당 과정에서 다중 공선성 방지를 위해 PCA, ICA를 통한 features extraction으로 training 으로 진행하는 것으로 이해했는데 해당 방식이 틀린 것인지 여쭙고 싶습니다.추가로, n개 feature에 대해 몇 개로 차원 축소하는 기준이 있는지 궁금합니다또, 지도 학습 모델인 선형 회귀 모델을 진행하는데 있어 비지도 학습 기법이 사용이 되는 것이 소개가 안된 것 같은데 이부분에 대해서 어떻게 생각하시는지도 궁금합니다.(정확히는 예측 모델을 구현하는 일련의 과정)마지막으로 step 5. 과정에서 선형 회귀 모델이 통계적으로 유의한가에 대해 P-value 를 측정하곤 하던데, 이부분에 대해서 간단히 설명해주시면 정말 감사하겠습니다.상기 질문들을 하는 이유는, 저는 단순히 어떤 연속 데이터 셋에서 ML 모델을 통해 추정하고 싶은데, 여러 분야에서 ML을 사용하다보니 예를 들어 통계 분야 에서는 가설과 함께 설명하고 또 어떤 분야에서는 또 다르게 설명을 하다보니 혼동이 되어서 해당 질문을 드리게 되는 것입니다.답변 주시면 정말 감사합겠습니다!
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
강의에서 배운 코드
안녕하세요!강의에서 배운 것을 바탕으로 데이터 분석 프로젝트를 진행하고,분석 내용 및 코드를 노션 포트폴리오에 올리려 합니다. (개인 구직용으로만 사용합니다!) 배운 것을 바탕으로 하다 보니, 강의에서 배운 코드와 같은 부분이 있을 수밖에 없는데포트폴리오에 사용해도 괜찮을까요?
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
early_stopping 에러 발생
안녕하십니까 선생님, 사진과 같이 강의 자료에서 에러가 발생하여 해결방법을 여쭤보고자 글남깁니다..!
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
lightgbm 3.3.2가 설치되지 않습니다.
맥북m2 사용중입니다. venv환경에서 pip install lightgbm==3.3.2를 했지만 아래와 같은 오류가 나옵니다.3.3.2없이 가장 최신 버젼이 4.5.0은 아주 쉽게 잘 설치가 됩니다. 혹시 강의를 수강할 때 3.3.2가 꼭필요한가요? conda 환경으로 설치를 진행해도 3.3.2는 설치가 안되더라구요ㅠㅠ 구글링을 해서 하라는 것은 다 했는데 해결이 안나와서 문의 드립니다..==========================================pip install lightgbm==3.3.2Collecting lightgbm==3.3.2 Using cached lightgbm-3.3.2.tar.gz (1.5 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... doneCollecting wheel (from lightgbm==3.3.2) Using cached wheel-0.44.0-py3-none-any.whl.metadata (2.3 kB)Requirement already satisfied: numpy in ./study/lib/python3.9/site-packages (from lightgbm==3.3.2) (1.24.3)Requirement already satisfied: scipy in ./study/lib/python3.9/site-packages (from lightgbm==3.3.2) (1.13.1)Requirement already satisfied: scikit-learn!=0.22.0 in ./study/lib/python3.9/site-packages (from lightgbm==3.3.2) (1.0.2)Requirement already satisfied: joblib>=0.11 in ./study/lib/python3.9/site-packages (from scikit-learn!=0.22.0->lightgbm==3.3.2) (1.4.2)Requirement already satisfied: threadpoolctl>=2.0.0 in ./study/lib/python3.9/site-packages (from scikit-learn!=0.22.0->lightgbm==3.3.2) (3.5.0)Using cached wheel-0.44.0-py3-none-any.whl (67 kB)Building wheels for collected packages: lightgbm Building wheel for lightgbm (pyproject.toml) ... error error: subprocess-exited-with-error × Building wheel for lightgbm (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [83 lines of output] INFO:root:running bdist_wheel INFO:root:running build INFO:root:running build_py INFO:root:creating build/lib/lightgbm INFO:root:copying lightgbm/callback.py -> build/lib/lightgbm INFO:root:copying lightgbm/compat.py -> build/lib/lightgbm INFO:root:copying lightgbm/plotting.py -> build/lib/lightgbm INFO:root:copying lightgbm/__init__.py -> build/lib/lightgbm INFO:root:copying lightgbm/engine.py -> build/lib/lightgbm INFO:root:copying lightgbm/dask.py -> build/lib/lightgbm INFO:root:copying lightgbm/basic.py -> build/lib/lightgbm INFO:root:copying lightgbm/libpath.py -> build/lib/lightgbm INFO:root:copying lightgbm/sklearn.py -> build/lib/lightgbm INFO:root:running egg_info INFO:root:writing lightgbm.egg-info/PKG-INFO INFO:root:writing dependency_links to lightgbm.egg-info/dependency_links.txt INFO:root:writing requirements to lightgbm.egg-info/requires.txt INFO:root:writing top-level names to lightgbm.egg-info/top_level.txt INFO:root:reading manifest file 'lightgbm.egg-info/SOURCES.txt' INFO:root:reading manifest template 'MANIFEST.in' WARNING:root:no previously-included directories found matching 'build' WARNING:root:warning: no files found matching '*.so' under directory 'lightgbm' WARNING:root:warning: no files found matching '*.so' under directory 'compile' WARNING:root:warning: no files found matching '*.dll' under directory 'compile/Release' WARNING:root:warning: no files found matching '*.dll' under directory 'compile/windows/x64/DLL' WARNING:root:warning: no previously-included files matching '*.py[co]' found anywhere in distribution WARNING:root:warning: no previously-included files found matching 'compile/external_libs/compute/.git' INFO:root:adding license file 'LICENSE' INFO:root:writing manifest file 'lightgbm.egg-info/SOURCES.txt' INFO:root:copying lightgbm/VERSION.txt -> build/lib/lightgbm INFO:wheel:installing to build/bdist.macosx-10.9-universal2/wheel INFO:root:running install INFO:LightGBM:Starting to compile the library. INFO:LightGBM:Starting to compile with CMake. Traceback (most recent call last): File "<string>", line 95, in silent_call File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 373, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/q_/cgds3zcd57z43n2hc_mfsklr0000gn/T/pip-install-_35mq2ue/lightgbm_4b238c34e6dd4d93979880ebb06cf41d/compile']' returned non-zero exit status 1. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/ike/py3-9/study/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module> main() File "/Users/ike/py3-9/study/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/Users/ike/py3-9/study/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel return buildbackend().build_wheel(wheel_directory, config_settings, File "/private/var/folders/q_/cgds3zcd57z43n2hc_mfsklr0000gn/T/pip-build-env-nmcdsyxm/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 421, in build_wheel return self._build_with_temp_dir( File "/private/var/folders/q_/cgds3zcd57z43n2hc_mfsklr0000gn/T/pip-build-env-nmcdsyxm/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 403, in buildwith_temp_dir self.run_setup() File "/private/var/folders/q_/cgds3zcd57z43n2hc_mfsklr0000gn/T/pip-build-env-nmcdsyxm/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 503, in run_setup super().run_setup(setup_script=setup_script) File "/private/var/folders/q_/cgds3zcd57z43n2hc_mfsklr0000gn/T/pip-build-env-nmcdsyxm/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 318, in run_setup exec(code, locals()) File "<string>", line 334, in <module> File "/private/var/folders/q_/cgds3zcd57z43n2hc_mfsklr0000gn/T/pip-build-env-nmcdsyxm/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 117, in setup return distutils.core.setup(**attrs) File "/private/var/folders/q_/cgds3zcd57z43n2hc_mfsklr0000gn/T/pip-build-env-nmcdsyxm/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 183, in setup return run_commands(dist) File "/private/var/folders/q_/cgds3zcd57z43n2hc_mfsklr0000gn/T/pip-build-env-nmcdsyxm/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 199, in run_commands dist.run_commands() File "/private/var/folders/q_/cgds3zcd57z43n2hc_mfsklr0000gn/T/pip-build-env-nmcdsyxm/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands self.run_command(cmd) File "/private/var/folders/q_/cgds3zcd57z43n2hc_mfsklr0000gn/T/pip-build-env-nmcdsyxm/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 950, in run_command super().run_command(command) File "/private/var/folders/q_/cgds3zcd57z43n2hc_mfsklr0000gn/T/pip-build-env-nmcdsyxm/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 973, in run_command cmd_obj.run() File "/private/var/folders/q_/cgds3zcd57z43n2hc_mfsklr0000gn/T/pip-build-env-nmcdsyxm/overlay/lib/python3.9/site-packages/setuptools/_vendor/wheel/bdist_wheel.py", line 403, in run self.run_command("install") File "/private/var/folders/q_/cgds3zcd57z43n2hc_mfsklr0000gn/T/pip-build-env-nmcdsyxm/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command self.distribution.run_command(command) File "/private/var/folders/q_/cgds3zcd57z43n2hc_mfsklr0000gn/T/pip-build-env-nmcdsyxm/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 950, in run_command super().run_command(command) File "/private/var/folders/q_/cgds3zcd57z43n2hc_mfsklr0000gn/T/pip-build-env-nmcdsyxm/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 973, in run_command cmd_obj.run() File "<string>", line 248, in run File "<string>", line 198, in compile_cpp File "<string>", line 99, in silent_call Exception: Please install CMake and all required dependencies first The full version of error log was saved into /Users/ike/LightGBM_compilation.log [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for lightgbmFailed to build lightgbmERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (lightgbm)==========================================
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
XGBoost.fit() 파라미터 질문입니다.
안녕하세요. 강의 정말 잘 듣고 있습니다.다름이 아니라 XGBoost 실습 시에 사이킷런 wrapper XGBClassifier.fit()파라미터가 바뀐 것 같아서 건의 드립니다.공식 python API를 들어가보면 xgboost.XGBClassifier parameter에 early_stopping_rounds와 eval_metrics가 포함된 것 같습니다..fit()메소드가 아닌 xgb 객체에 들어가는 파라미터로 바뀐 것 같습니다.아마 버전이 바뀌면서 파라미터 위치도 바뀐 것 같습니다.이 부분은 소스코드가 수정되어야 할 것 같습니다.
-
미해결확률과 통계 기초
bernoulli RV의 합으로 Hypergeometric RV를 나타내는 과정 질문있습니다.
P(X_k = 1)= p = b / (b + r) 이라고 하셨는데,각각의 시행에서 독립적이 아니라 확률이 변하지 않나요?예를 들어, P(X_1 = 1) = b / (b + r)가 맞지만P(X_2 = 1)은 X_1의 결과에 따라 달라지지 않나요? X_1, X_2 ... 는 독립적이지 않은 베르누이 확률변수 아닌가 하는 의문이 들었습니다.
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
scikit learn 1.0.2 version 다운로드 진행 오류
안녕하세요! 항상 수고많으십니다.다름이 아니라 scikit learn 1.0.2 version을 다운로드 할때 아래의 오류가 발생하는데 해결법이 있을까요?감사합니다. (base) C:\Windows\system32>pip install scikit-learn==1.0.2Collecting scikit-learn==1.0.2 Using cached scikit-learn-1.0.2.tar.gz (6.7 MB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [33 lines of output] Traceback (most recent call last): File "C:\Users\Admin\anaconda3\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module> main() File "C:\Users\Admin\anaconda3\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\anaconda3\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 112, in get_requires_for_build_wheel backend = buildbackend() ^^^^^^^^^^^^^^^^ File "C:\Users\Admin\anaconda3\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 77, in buildbackend obj = import_module(mod_path) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\anaconda3\Lib\importlib\__init__.py", line 90, in import_module return bootstrap.gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1387, in gcdimport File "<frozen importlib._bootstrap>", line 1360, in findand_load File "<frozen importlib._bootstrap>", line 1310, in findand_load_unlocked File "<frozen importlib._bootstrap>", line 488, in callwith_frames_removed File "<frozen importlib._bootstrap>", line 1387, in gcdimport File "<frozen importlib._bootstrap>", line 1360, in findand_load File "<frozen importlib._bootstrap>", line 1331, in findand_load_unlocked File "<frozen importlib._bootstrap>", line 935, in loadunlocked File "<frozen importlib._bootstrap_external>", line 995, in exec_module File "<frozen importlib._bootstrap>", line 488, in callwith_frames_removed File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-7t2zd14d\overlay\Lib\site-packages\setuptools\__init__.py", line 16, in <module> import setuptools.version File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-7t2zd14d\overlay\Lib\site-packages\setuptools\version.py", line 1, in <module> import pkg_resources File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-7t2zd14d\overlay\Lib\site-packages\pkg_resources\__init__.py", line 2172, in <module> register_finder(pkgutil.ImpImporter, find_on_path) ^^^^^^^^^^^^^^^^^^^ AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'? [end of output] note: This error originates from a subprocess, and is likely not a problem with pip.error: subprocess-exited-with-error× Getting requirements to build wheel did not run successfully.│ exit code: 1╰─> See above for output.note: This error originates from a subprocess, and is likely not a problem with pip.(base) C:\Windows\system32>
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
anconda 에서 LightGBM 3.3.2 이 Setup 후 OpenMP 라이브러리에 의존하는데, 해당 라이브러리가 MacOS에 설치되지 않았기 때문에 발생하는 문제
안녕하세요 강사님 강의 모두 결제해서 듣고 있는 13년차 직장인 겸 학생입니다. MAC OS 아나콘다 환경에서 현재 4.4.5가 기본으로 깔리는데 처음문제는 early_stopping_rounds=50 였습니다. 그래서 3.3.2로 버전을 맞춰서 import lightgbm 하는데 문제가 생겨서 몇시간동안 헤매대가 결국 해결책을 찾아서 공유합니다.1. . MacOS에서 OpenMP를 설치하고 LightGBM이 이를 참조할 수 있도록 설정해야 합니다.1. Homebrew 설치먼저 Homebrew가 설치되어 있는지 확인하세요. Homebrew는 Mac에서 패키지를 관리하는 도구입니다. Homebrew가 설치되지 않았다면, 아래 명령어로 설치할 수 있습니다/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 2. libomp 설치libomp는 OpenMP 라이브러리입니다. Homebrew를 통해 쉽게 설치할 수 있습니다. brew install libomp이 명령어는 libomp를 설치하여, LightGBM이 OpenMP에 접근할 수 있게 만듭니다.3. Anaconda 환경에서 환경 변수 설정설치된 libomp 경로를 Anaconda 환경에서 참조하도록 설정해야 합니다. ~/.bash_profile 또는 ~/.zshrc 파일에 다음을 추가하세요. export PATH="/usr/local/opt/libomp/bin:$PATH"export LDFLAGS="-L/usr/local/opt/libomp/lib"export CPPFLAGS="-I/usr/local/opt/libomp/include"**팁Homebrew를 통해 설치된 libomp의 경로를 확인하려면 다음 명령어를 터미널에 입력하세요:brew --prefix libomp그 후 터미널에서 다음 명령어를 실행해 환경 변수를 적용하세요: source ~/.bash_profile # 또는 ~/.zshrc 4. LightGBM 재설치pip uninstall lightgbmpip install lightgbm==3.3.2~ 끝 ~ 강사님 항상 업데이트 잘해주셔서 저도 도움이 되고자 올립니다.
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
graphviz 오류
안녕하세요 선생님구글에 graphviz 다운로드 후 pip install을 해야하나모르고 pip install 먼저하고 구글 다운로드 후 다시 pip install 하니 중복되서 프롬프트에서 graphviz가 중복됬다고 실행이 안됩니다 ㅠㅠ혹시 해결방법이 있을까요 ?
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
5.9 Regression실습-Bike Sharing Demand _nameError
안녕하세요.. 질문 자주 올리네요^^버전 numpy==1.22.5 pandas==1.3.4 다운그레이했어요..사이킷런 1.0.2 파이썬 3.9.18 입니다.
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
안녕하세요 교수님.. 로그 변환, 피처 인코딩, 모델 학습/예측/평가_ 에러메시지가 납니다.
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 강의 내용을 질문할 경우 몇분 몇초의 내용에 대한 것인지 반드시 기재 부탁드립니다. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
LinearRegression() 에러입니다^^
안녕하세요. 교수님 너무 좋은 강의 잘 듣고 있습니다.바쁘실텐데 바로바로 답변해주셔서 너무 감사드려요^^Bike Sharing Demend 예제소스 에러 질문이 있어서요..최근에 설치했는데.. 에러가 많이나서 사이킷런 1.0.2 파이썬 3.9.18으로 다운그레이했습니다. 넘파이는 몇버전으로 해야 할까요?아래는 에러내용입니다.[ 로그 변환, 피처 인코딩, 모델 학습/예측/평가 ] from sklearn.model_selection import train_test_split , GridSearchCV from sklearn.linear_model import LinearRegression , Ridge , Lasso y_target = bike_df['count'] X_features = bike_df.drop(['count'],axis=1,inplace=False) X_train, X_test, y_train, y_test = train_test_split(X_features, y_target, test_size=0.3, random_state=0) lr_reg = LinearRegression() lr_reg.fit(X_train, y_train) pred = lr_reg.predict(X_test) evaluate_regr(y_test ,pred)에러 --------------------------------------------------------------------------- DTypePromotionError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_19124\3974685920.py in <module> 11 lr_reg = LinearRegression() 12 ---> 13 lr_reg.fit(X_train, y_train) 14 pred = lr_reg.predict(X_test) 15 D:\dev03\anaconda\lib\site-packages\sklearn\linear_model\_base.py in fit(self, X, y, sample_weight) 660 accept_sparse = False if self.positive else ["csr", "csc", "coo"] 661 --> 662 X, y = self._validate_data( 663 X, y, accept_sparse=accept_sparse, y_numeric=True, multi_output=True 664 ) D:\dev03\anaconda\lib\site-packages\sklearn\base.py in _validate_data(self, X, y, reset, validate_separately, **check_params) 579 y = check_array(y, **check_y_params) 580 else: --> 581 X, y = check_X_y(X, y, **check_params) 582 out = X, y 583 D:\dev03\anaconda\lib\site-packages\sklearn\utils\validation.py in check_X_y(X, y, accept_sparse, accept_large_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, multi_output, ensure_min_samples, ensure_min_features, y_numeric, estimator) 962 raise ValueError("y cannot be None") 963 --> 964 X = check_array( 965 X, 966 accept_sparse=accept_sparse, D:\dev03\anaconda\lib\site-packages\sklearn\utils\validation.py in check_array(array, accept_sparse, accept_large_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, ensure_min_samples, ensure_min_features, estimator) 663 664 if all(isinstance(dtype, np.dtype) for dtype in dtypes_orig): --> 665 dtype_orig = np.result_type(*dtypes_orig) 666 667 if dtype_numeric: DTypePromotionError: The DType <class 'numpy.dtypes.
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
LinearRegression() 에러
안녕하세요. 너무 좋은 강의 잘 듣고 있습니다.Bike Sharing Demend 예제소스 에러 질문이 있어서요..[ 로그 변환, 피처 인코딩, 모델 학습/예측/평가 ]from sklearn.model_selection import train_test_split , GridSearchCVfrom sklearn.linear_model import LinearRegression , Ridge , Lassoy_target = bike_df['count']X_features = bike_df.drop(['count'],axis=1,inplace=False)X_train, X_test, y_train, y_test = train_test_split(X_features, y_target, test_size=0.3, random_state=0)lr_reg = LinearRegression()lr_reg.fit(X_train, y_train)pred = lr_reg.predict(X_test)evaluate_regr(y_test ,pred)에러--------------------------------------------------------------------------- DTypePromotionError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_19124\3974685920.py in <module> 11 lr_reg = LinearRegression() 12 ---> 13 lr_reg.fit(X_train, y_train) 14 pred = lr_reg.predict(X_test) 15 D:\dev03\anaconda\lib\site-packages\sklearn\linear_model\_base.py in fit(self, X, y, sample_weight) 660 accept_sparse = False if self.positive else ["csr", "csc", "coo"] 661 --> 662 X, y = self._validate_data( 663 X, y, accept_sparse=accept_sparse, y_numeric=True, multi_output=True 664 ) D:\dev03\anaconda\lib\site-packages\sklearn\base.py in _validate_data(self, X, y, reset, validate_separately, **check_params) 579 y = check_array(y, **check_y_params) 580 else: --> 581 X, y = check_X_y(X, y, **check_params) 582 out = X, y 583 D:\dev03\anaconda\lib\site-packages\sklearn\utils\validation.py in check_X_y(X, y, accept_sparse, accept_large_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, multi_output, ensure_min_samples, ensure_min_features, y_numeric, estimator) 962 raise ValueError("y cannot be None") 963 --> 964 X = check_array( 965 X, 966 accept_sparse=accept_sparse, D:\dev03\anaconda\lib\site-packages\sklearn\utils\validation.py in check_array(array, accept_sparse, accept_large_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, ensure_min_samples, ensure_min_features, estimator) 663 664 if all(isinstance(dtype, np.dtype) for dtype in dtypes_orig): --> 665 dtype_orig = np.result_type(*dtypes_orig) 666 667 if dtype_numeric: DTypePromotionError: The DType <class 'numpy.dtypes.
-
해결됨[개정판] 파이썬 머신러닝 완벽 가이드
안녕하세요(머린이 질문)
안녕하세요 선생님다름이 아니라, 머신러닝 수강중 궁금한게 있어 질문드립니다X1, X2 ,X3 ,X4 ~... Y가 있을 때 회귀예측을 진행한다고 하면만약 타겟 Y값 목표가 100이라고 가정 했을 때X1,X2,X3,X4들이 어느정도 값에 있는걸 추천한다 ? , 권장한다 ? 라는 분석기법도 있을까요 ? Q1) Y가 목표값이 있을 때, 각 X1~X4 범위 , 그에 따른 Y값의 신뢰구간 ㅠ 그냥 이 질문은 ML이 아니고 회귀분석 일까요 ??
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
안녕하세요. 9장 질문입니다. 아래와 같은 에러가 발생했어요..
소스코드:movies_df['genres_literal'] = movies_df['genres'].apply(lambda x : (' ').join(x))count_vect = CountVectorizer(min_df=0, ngram_range=(1,2))genre_mat = count_vect.fit_transform(movies_df['genres_literal'])print(genre_mat.shape)에러 코드:InvalidParameterError Traceback (most recent call last) Cell In[99], line 10 8 count_vect = CountVectorizer(min_df=0, ngram_range=(1,2)) 9 # print(movies_df['genres_literal']) ---> 10 genre_mat = count_vect.fit_transform(movies_df['genres_literal']) File D:\dev03\anaconda\Lib\site-packages\sklearn\base.py:1467, in _fit_context.<locals>.decorator.<locals>.wrapper(estimator, *args, **kwargs) 1462 partial_fit_and_fitted = ( 1463 fit_method.__name__ == "partial_fit" and _is_fitted(estimator) 1464 ) 1466 if not global_skip_validation and not partial_fit_and_fitted: -> 1467 estimator._validate_params() 1469 with config_context( 1470 skip_parameter_validation=( 1471 prefer_skip_nested_validation or global_skip_validation 1472 ) 1473 ): 1474 return fit_method(estimator, *args, **kwargs) File D:\dev03\anaconda\Lib\site-packages\sklearn\base.py:666, in BaseEstimator._validate_params(self) 658 def _validate_params(self): 659 """Validate types and values of constructor parameters 660 661 The expected type and values must be defined in the `_parameter_constraints` (...) 664 accepted constraints. 665 """ --> 666 validate_parameter_constraints( 667 self._parameter_constraints, 668 self.get_params(deep=False), 669 caller_name=self.__class__.__name__, 670 ) File D:\dev03\anaconda\Lib\site-packages\sklearn\utils\_param_validation.py:95, in validate_parameter_constraints(parameter_constraints, params, caller_name) 89 else: 90 constraints_str = ( 91 f"{', '.join([str(c) for c in constraints[:-1]])} or" 92 f" {constraints[-1]}" 93 ) ---> 95 raise InvalidParameterError( 96 f"The {param_name!r} parameter of {caller_name} must be" 97 f" {constraints_str}. Got {param_val!r} instead." 98 ) InvalidParameterError: The 'min_df' parameter of CountVectorizer must be a float in the range [0.0, 1.0] or an int in the range [1, inf). Got 0 instea
-
해결됨[개정판] 파이썬 머신러닝 완벽 가이드
머린이 (k-fold) 질문
안녕하세요 선생님 머린이 질문드립니다 ㅠk-fold 검증하는거에 대해 궁금한게 있습니다X_train, X_val, y_train, y_test = train_test_split(x,y,test_size= 0.3) 으로 햇을 때만약 100개 데이터가 있으면 30개 데이터를 가지고 질문1) fit -> x_train, y_train : 30개 데이터를 가지고훈련한다. )70개 데이터에 대해 pred : x_val 후 -> accuracy (y_val, pred) 맞춰본다(모의고사를 푼다)-> 이제 fit한 데이터를 가지고 실제 수능을 푼다 (real test data)가 맞을까요 ??질문2) 이게 맞다면 k-폴드 교차검증은 (k=5일떄)fit 활동 -> 30개 데이터 셋 fit을 5번 수행 실시 후70개의 pred : x_val 활동을 한다 가 맞을까요 ? '^',,
-
해결됨[개정판] 파이썬 머신러닝 완벽 가이드
머린이(머신러닝 어린이) 질문
안녕하세요 선생님 ㅎ ㅠ 강의중2.4 model selection 모듈소개에서 from sklearn.datasets import load_iris 내장된데이터셋을 불러온 후 head()랑 shape을 바로 파악하고싶은데예를들어 df = pd.read_csv("~~.csv")df.head() 하면 x1, x2 , x3, target (물론 본인이 x,y 파악) 데이터 셋을바로 파악할 수 있는데 내장 데이터는iris_df = pd.DataFrame(iris_data.data, columns=iris_data.feature_names)iris_df['target']=iris_data.target이런 작업이 필요한걸까요 ㅠㅠ?..
-
해결됨통계 분석 마스터 클래스
다중 선형회귀 분석 등
안녕하세요 해당 관련 강의를 듣고 있는 수강생입니다.수업을 듣고 있는 중에.. 엑셀로 회귀 분석을 진행하는데매크로를 사용해서 진행하는 것만 나오네요?각각의 분석값을 어떻게 계산하는지는 설명이 없는 거 같아서요.. 예를 들면 2차회귀에서의 결정계수, 상관계수, P값(분산분석)아니면 중회귀에서의 P값 등... 구하는 공식 등을 그냥 엑셀에서의 매크로를 통해 보여주기만 하네요.. 혹 이런 값들의 계산식들을 알 수가 있을까요?