검증데이터 분할을 할 때 왜 gender를 drop하나요? from sklearn.model_selection import train_test_split X_train,X_val,y_train,y_val =train_test_split( train.drop('gender',axis=1),train['gender'] ,test_size=0.2,random_state=0) print(X_train.shape,X_val.shape,y_train.shape,y_val.shape)
pred 컬럼 명이 0또는1이 아니라 문자일 때 컬럼을 선택해주기 위해서 pos_label을 사용해준다고 하셨는데 모든 평가지표에서 pos_label을 사용해야 하는지와 pos_label을 써서 컬럼을 선택해줬는데, 실제 값을 예측할 때 {'pred':pred[:,1]}을 해주는게 맞는지 궁금합니다 이미 한 컬럼이 선택됐는데 범위를 지정할 경우 이상이 없을까요?
혼자 드디어 처음으로 외워서 작성해본 2유형코드입니다~ 평가점수가 저정도 나오는데 아무래도 수치형을 스케일링하지않아서 일까요? 아니면 원핫인코딩이 더 적절한거였을까요? 아니면 저정도 점수여도 안전한 구역일까요? import pandas as pd train=pd.read_csv("train.csv") test=pd.read_csv("test.csv") print(train.shape) print(test.shape) train.info() cols=train.select_dtypes(include="O").columns cols from sklearn.preprocessing import LabelEncoder le = LabelEncoder() for col in cols: train[col] = le.fit_transform(train[col]) test[col] = le.transform(test[col]) target=train.pop("TravelInsurance") #데이터분할하기 from sklearn.model_selection import train_test_split X_tr, X_val, y_tr, y_val = train_test_split(train, target, test_size=0.2, random_state=2022) from sklearn.ensemble import RandomForestClassifier model = RandomForestClassifier() model.fit(X_tr,y_tr) pred=model.predict_proba(X_val) from sklearn.metrics import roc_auc_score print(roc_auc_score(y_val,pred[:,1])) #0.7486363636363635
Broken DAG: [/opt/airflow/dags/dags_bash_ operator.py ] Traceback (most recent call last): File "<frozen importlib._bootstrap_external>", line 1063, in source_to_code File "<frozen importlib._bootstrap>", line 488, in call with_frames_removed File "/opt/airflow/dags/dags_bash_ operator.py ", line 24 bash_t1 >> bash_t2 ^ IndentationError: unindent does not match any outer indentation level 이런 에러가 났는데요 소스에서 확인해보니 from airflow.operators.bash import BashOperator ㅇ airflow.operators.bash 에 ~~~~~~ 이렇게 되어 있네요. 강사님 따라 그대로 했는데 에러가 왜 난걸까요?
강의 정말 잘 듣고있습니다. DFS 너무 어려웠는데 저에게 한 줄기 빛 같은 존재십니다..! 원본 문제가 바뀐것같기도 한데, 13565번 백준 원본을 보면 M, N 순서대로 입력을 받는 것 같습니다. M이 행에 해당되고, N이 열에 해당이 되어서 전반적으로 반대가 되어야하고, 강의에서 말씀 주신 이 부분도 def dfs (y, x): global visited, map_, answer, N if y == N: answer = True return y == M 으로 바뀌어야할 것 같은데 맞을까요?
다른 문제들에서는 train과 test데이터 두개만 주어진채로 계속 들은거같은데 이 문제는 주어진 데이터가 3개인건지.. 제가 앞서 이해했던 문제들의 데이터는 train데이터를 가지고 분할하고 모델링을 한후 validation한 데이터로 pred값을 구하고 실제값과 비교해서 지표로 매겨본후에 최종 test데이터를 넣어서 csv파일로 만드는 순서인데.. 지금 이 문제처럼 데이터가 3개인것은 어떤 차이가있는 것일까요 ㅠㅠ
문제풀이에 방해되어서 코랩 자동완성 기능을 끄고 싶은데요. 알려주신 [도구>설정>편집기>‘컨텍스트 기반 코드 완성 표시‘ 해제 > 저장] 진행 했음에도 불구하고, 계속해서 자동완성이 되어서 학습에 방해가 되고 있습니다.ㅠㅠ 자동완성 끄는 다른 설정 방법이 있는지 알려주세요.
안녕하세요, 강의들으면서 도움 많이 받고 있습니다. Pinecone API를 .env에 적었지만 인식을 못해서 하기와 같이 직접적으로 입력해주었습니다. 그런데 하기 부분에서 또 다시 정의가 안 되었다고 에러가 뜹니다. 어디를 수정해야할까요? 커널?을 껐다켰다하면 되는 분도 있다고 해서 따라해봤는데 잘 안 되는 것 같습니다.ㅠ