안녕하세요. 강의 정말 잘 듣고 있습니다. 다름이 아니라 XGBoost 실습 시에 사이킷런 wrapper XGBClassifier.fit ()파라미터가 바뀐 것 같아서 건의 드립니다. 공식 python API를 들어가보면 xgboost.XGBClassifier parameter에 early_stopping_rounds와 eval_metrics가 포함된 것 같습니다. .fit()메소드가 아닌 xgb 객체에 들어가는 파라미터로 바뀐 것 같습니다. 아마 버전이 바뀌면서 파라미터 위치도 바뀐 것 같습니다. 이 부분은 소스코드가 수정되어야 할 것 같습니다.
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을 다운로드 할때 아래의 오류가 발생하는데 해결법이 있을까요? 감사합니다. (base) C:\Windows\system32>pip install scikit-learn==1.0.2 Collecting 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 = build backend() ^^^^^^^^^^^^^^^^ File "C:\Users\Admin\anaconda3\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 77, in build backend 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 gcd import File "<frozen importlib._bootstrap>", line 1360, in find and_load File "<frozen importlib._bootstrap>", line 1310, in find and_load_unlocked File "<frozen importlib._bootstrap>", line 488, in call with_frames_removed File "<frozen importlib._bootstrap>", line 1387, in gcd import File "<frozen importlib._bootstrap>", line 1360, in find and_load File "<frozen importlib._bootstrap>", line 1331, in find and_load_unlocked File "<frozen importlib._bootstrap>", line 935, in load unlocked File "<frozen importlib._bootstrap_external>", line 995, in exec_module File "<frozen importlib._bootstrap>", line 488, in call with_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>
안녕하세요 강사님 강의 모두 결제해서 듣고 있는 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 lightgbm pip install lightgbm==3.3.2 ~ 끝 ~ 강사님 항상 업데이트 잘해주셔서 저도 도움이 되고자 올립니다.
안녕하세요 선생님 구글에 graphviz 다운로드 후 pip install을 해야하나 모르고 pip install 먼저하고 구글 다운로드 후 다시 pip install 하니 중복되서 프롬프트에서 graphviz가 중복됬다고 실행이 안됩니다 ㅠㅠ 혹시 해결방법이 있을까요 ?
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 강의 내용을 질문할 경우 몇분 몇초의 내용에 대한 것인지 반드시 기재 부탁드립니다. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.
안녕하세요 선생님 다름이 아니라, 머신러닝 수강중 궁금한게 있어 질문드립니다 X1, X2 ,X3 ,X4 ~... Y가 있을 때 회귀예측을 진행한다고 하면 만약 타겟 Y값 목표가 100이라고 가정 했을 때 X1,X2,X3,X4들이 어느정도 값에 있는걸 추천한다 ? , 권장한다 ? 라는 분석기법도 있을까요 ? Q1) Y가 목표값이 있을 때, 각 X1~X4 범위 , 그에 따른 Y값의 신뢰구간 ㅠ 그냥 이 질문은 ML이 아니고 회귀분석 일까요 ??
소스코드: 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 검증하는거에 대해 궁금한게 있습니다 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값 등... 구하는 공식 등을 그냥 엑셀에서의 매크로를 통해 보여주기만 하네요.. 혹 이런 값들의 계산식들을 알 수가 있을까요?
grid_dtree = GridSearchCV(dtree, param_grid=parameters, cv=3, refit=True, return_train_score=True) grid_ dtree.fit (X_train, y_train) 강의에서는 지금까지 정확도를 도출할때 이미 훈련 데이터로 학습된 모델을 통해 X_test 데이터의 예측값을 구하고 이를 실제 y_test 값과 비교하여 일치도를 구하는 방식으로 하였습니다. 하지만 위의 코드에서는 test 데이터 없이 train 데이터만 grid_dtree에 넣었는데 어떻게 파라미터별 정확도를 평가할 수 있는건지 이해가 안갑니다!! GridSearchCV를 통한 파라미터별 정확도는 어떻게 도출되는것인가요?
섹션2의 Grid Search 예제에서 학습/테스트 데이터 분리시 train_test_split()함수에서 stratify옵션없이 사용되었는데요, 계층 분할을 위해 stratify=iris _data.targe t 옵션을 넣어야 하는거 아닌가요? stratify옵션 넣고 테스트해보니 학습데이터 score는 강의동영상의 점수보다 낮았는데, test data에 대한 스코어는 강의 동영상과 동일하게 나왔습니다.