안녕하세요. 오징어게임 관련해서 문의사항이 있어 남깁니다. 5/12 미션 [2-a 도서] 작업형1 연습문제 - 섹션1, 섹션2 (p.164~165)의 경우 시나공 2026 버전으로 작성해주신 것 같은데 제가 갖고 있는 2025 버전의 경우는, 섹션을 기준으로 풀면 되는지 문의드립니다! 답변해주시면 감사하겠습니다^^
(node:49559) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. (Use `node --trace-deprecation ...` to show where the warning was created) 설치할 때 터미널에 이러한 오류가 발생해서 시키는대로 node --trace-deprecation 를 입력했더니 아래 처럼 뜹니다. 그냥 무시해도 되겠죠? ➜ threads git:(master) ✗ node --trace-deprecation Welcome to Node.js v22.9.0. Type ".help" for more information. > punycode { version: '2.1.0', ucs2: { decode: [Function: ucs2decode], encode: [Function: ucs2encode] }, decode: [Function: decode], encode: [Function: encode], toASCII: [Function: toASCII], toUnicode: [Function: toUnicode] } > (node:51239) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. at node:punycode:3:9 at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:399:7) at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:338:10) at loadBuiltinModule (node:internal/modules/helpers:108:7) at Module._load (node:internal/modules/cjs/loader:1099:17) at TracingChannel.traceSync (node:diagnostics_channel:315:14) at wrapModuleLoad (node:internal/modules/cjs/loader:217:24) at Module.require (node:internal/modules/cjs/loader:1339:12) at get (node:internal/modules/helpers:223:33) at REPL1:1:1
# test 예측 pred = rf.predict_proba(test) ValueError Traceback (most recent call last) <ipython-input-221-192ffa211ac4> in <cell line: 0>() 1 # test 예측 ----> 2 pred = rf.predict_proba(test) 3 3 frames /usr/local/lib/python3.11/dist-packages/sklearn/utils/validation.py in _check_feature_names(estimator, X, reset) 2775 message += "Feature names must be in the same order as they were in fit.\n" 2776 -> 2777 raise ValueError(message) 2778 2779 ValueError: The feature names should match those that were passed during fit. Feature names unseen at fit time: - TravelInsurance 이런 오류가 뜹니다 test가 예측값이니까 TravelInsurance 컬럼이 없어야 하는게 맞는건가요? 샘플 찍어봤을 때 train,test 둘 다 TravelInsurance 이 컬럼이 있었습니다. 코드 작성은 선생님과 동일하게 했는데 자꾸 저런 오류가 뜨네요 ㅠㅠ 검증 데이터 분리할 때 train.drop만 해줘서 그런건가요..?
PS C:\Users\user\Documents\prepare\front> npm init This utility will walk you through creating a package.json file. It only covers the most common items, and tries to guess sensible defaults. See npm help init for definitive documentation on these fields and exactly what they do. Use npm install <pkg> afterwards to install a package and save it as a dependency in the package.json file. Press ^C at any time to quit. package name: (front) PS C:\Users\user\Documents\prepare\front> 터미널을열고 저도 패키지 네임 다음 react-nodebird-front를 작성하고 싶은데 어떤방법이 있을까요?
만든파일을 배포하는 과정에 대해 질문이 있습니다. 배운기술들로 다른것을 만들어서 ngrok에 배포하는것이 아닌 다른방법으로 배포하고 싶습니다. 상황은 이렇습니다. ・2대의 데스크톱이있습니다. ・한대의 데스크톱이 서버의 역할을합니다. ・또다른 데스크톱은 클라이언트 역할을합니다. vite와 node.js로 만든경우 vscode로 npm run dev하는것이 아닌 java에서 war파일을 만들어서 war파일만 교체하면되는것처럼 배포 가능한 하나의 번들형태로 만드는방법이 있나요? 아니면 vite와 node.js만의 배포하는방법이있나요? 제가 배포를 경험해본 방법이 java에서 Maven으로 war파일을 만들어서 tomcat에 넣어서 사용하는방법밖에 몰라서 node.js는 어떤방법으로 로컬데스크톱에서 실행하게 하는지 궁금합니다. frontend폴더와 backend폴더가 따로 있는데 하나로 로컬데스크톱에 배포하는 방법이 있나요?
2유형 학습중 이해를 잘 못한 부분이 있습니다. 먼저 수치형 변수 스케일러의 경우 스케일러함수(train) 이렇게만 사용하거나 스케일러함수(train['수치형변수'] 이렇게 사용할 때가 있고 동일하게 변수형 변수 인코딩의 경우 라벨인코딩(train) 이렇게는 사용 안하고 항상 라벨인코딩(train[cols]) 이렇게 사용하시는데 원핫인코딩(train) 이런식으로 사용하시는 부분에 있어서 어떤 함수가 파이썬에서 자동으로 수치형과 범주형을 구분해서 변환해주는지 궁금합니다. GPT에도 확인했지만 물어볼 때마다 답이 다르네요...
문제에서 평가지표가 ROC-AUC, 정확도, F1 세가지가 있고 모델&평가할 때 이 지표 세가지를 다 구해서 확인을 했는데 마지막에 test데이터를 활용해서 실제 예측을 할 때는 왜 pred_proba를 사용한건가요? ROC-AUC를 기준으로 선택해서 그런건가요? 그럼 정확도 기준으로 선택하면 pred 사용해도 되는건가요? <문제> ## 심장마비 확률이 높은사람? - 성별, 나이, 혈압, 콜레스테롤, 공복혈당, 최대 심박수 등의 컬럼이 있음 - 평가: ROC-AUC, 정확도(Accuracy), F1 을 구하시오 - target : output (1:심장마비 확률 높음, 0:심장마비 확률 낮음) - csv파일 생성 : 수험번호.csv (예시 아래 참조) <모델&평가> # xgb from xgboost import XGBClassifier from sklearn.metrics import roc_auc_score, f1_score, accuracy_score xgb = XGBClassifier(random_state=2022) xgb.fit (X_tr, y_tr) pred = xgb.predict(X_val) pred_proba = xgb.predict_proba(X_val) print(roc_auc_score(y_val, pred_proba[:,1])) print(f1_score(y_val, pred)) print(accuracy_score(y_val, pred)) <예측 및 csv 제출> pred_proba = xgb.predict_proba(test)