아래와 같이 train과 test를 합해서 스케일링과 인코딩을 모두 진행할 경우, 각각 진행하는 것과 차이가 있나요? 그리고 스케일링과 인코딩에 추천하는 함수가 있으신가요? df= pd.concat([x_train, x_test], axis=0) num = df.select _dtypes(exclude='object').columns from sklearn.preprocessing import RobustScaler scaler = RobustScaler() df[num] = scaler.fit _transform(df[num]) objs = df.select _dtypes(include='object').columns from sklearn.preprocessing import LabelEncoder for obj in objs : encoder = LabelEncoder() df[obj] = encoder.fit _transform(df[obj]) x_train2 = df[:len(x_train)] x_test2 = df[len(x_train):]
학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! 질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요 먼저 유사한 질문이 있었는지 검색해보세요 아래처럼 코드 짜도 되는지? m = df.loc[2000] > df.loc[2000].mean() print(sum(m))
따라하기로 강의를 수강중에 있습니다. 강의 환경을 구성하려고 하는데, ova 등 관련링크가 모두 옛날자료라서 유효하지가 않아 다운로드가 불가능합니다. 보유하고 있는 파일 공유 또는 다운로드 사이트를 업데이트 하면 좋을것 같습니다. 강의 내용 구성이 좋아서 끝까지 수강해야 하는데, 중간에 관련자료 확보 불가로 따라하기가 어려워 수강에 어려움을 겪고 있습니다. 이점 충분히 검토 바랍니다.
Junit4 org.junt.Test 어노테이션을 사용하면 작동하지 않는 것 같습니다. 아래는 에러입니다. No matching tests found in any candidate test task. Requested tests: Test pattern jpabook.jpashop.service.MemberServiceTest in task :test * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.11.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. BUILD FAILED in 493ms 5 actionable tasks: 1 executed, 4 up-to-date
학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! 질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요 먼저 유사한 질문이 있었는지 검색해보세요 실기체험하는대서 아래처럼 쓰고 실행했더니 import pandas as pd df = pd.DataFrame({ '키': [150, 160, 170, 175, 165, 155, 172, 168, 174, 158, 162, 173, 156, 159, 167, 163, 171, 169, 176, 161], '몸무게': [74, 50, 70, 64, 56, 48, 68, 60, 65, 52, 54, 67, 49, 51, 58, 55, 69, 61, 66, 53] }) from statsmodels.formula.api import ols model = ols('키 ~ 몸무게', data=df).fit() print(model.summary()) 아래처럼 나오는데, 왜 그런건가요? Notes: [1] Standard Errors assume that the covariance matrix of the errors is correctly specified.
37강 5분 11초에서 "처음에는 null로 되어있지만 값을 한 번 세팅할 수 있게 해주고 싶다."라고 하셨는데 처음부터 null을 할당하지 않으면 lateinit을 사용 안 할 수도 있는 거 아닌가요? 테스트코드에 대한 이해가 하나도 없어서 고른 강의인지라 질문의 깊이가 너무 없지만 답변주시면 감사합니다!!
학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! 질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요 먼저 유사한 질문이 있었는지 검색해보세요 아래 예시로 적혀있는 코드들도 시험 때 주어지는지 아니면 암기해야하는지 문의드립니다. from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score, roc_auc_score # 정확도 print(accuracy_score(y_test, pred)) # 정밀도 print(precision_score(y_test, pred)) # 재현율 (민감도) print(recall_score(y_test, pred)) # F1 print(f1_score(y_test , pred)) # roc-auc print(roc_auc_score(y_test, pred_proba))
해당 코드의 실패 예시가 결과 값이 5 999999999 1000000000 가 출력 되야 되는데 5만 출력 됩니다. 위의 코드에서 flist, slist를 ArrayList로 선언 했는데 이를 int[]로 변경 후 동작을 하면 정상적으로 동작이 됩니다. int[]로 선언 했을 때랑 ArrayList로 선언 했을때 차이가 있는건지 제가 while문안에 비교를 잘못한건지 모르겠어서 질문드립니다..
질문은 동영상 강의에 들어가서 오른쪽에 커뮤니티 버튼을 통해 해주세요. 그래야 어떤 강좌에서 질문하셨는지 알 수 있습니다. 영상에서 몇 분 몇 초 대를 알려주셔야 제가 한 번에 질문 내용 확인이 가능합니다. 이미 다른 누군가가 질문을 한 이력 이 있을 수 있습니다. 질문 게시판을 한 번 확인 부탁드립니다. 학교의 과제나 타 강사의 코드 등 외부 수업 자료에 대해서는 답변하지 않습니다. 제가 다루는 커리큘럼 외의 이론이나, 너무 디테일한 컴퓨터 이론에 대해서는 답변 드리지 않습니다. 시험에 안 나오는 경우가 많고, 나와 봤자 1문제 나오는데 외워야 할 부분이 많은 것 등 (예시: 서브넷 마스크 계산) 질문을 올릴 때 이 글은 모두 지우고 내용을 입력해주세요.
train_target=train.pop('TotalCharges') # 3. 분할 from sklearn.model_selection import train_test_split tr_x, val_x, tr_y, val_y =train_test_split(train,train_target, test_size=0.2, random_state=0) # 3. 분할 from sklearn.model_selection import train_test_split tr_x, val_x, tr_y, val_y =train_test_split(train,train['TotalCharges'], test_size=0.2, random_state=0) tr_x.head(), tr_y.head(), val_x.head(), val_y.head() 위 두가지 경우로 모델링 하여 MAE값을 산출했습니다. 아래꺼는 Linear Regression : 0.0000000000012394228 RandomForest Regressor : 1.9100924757282742306 XGB Regressor : 10.5623083675717790442 위에꺼는 Linear Regression : 914.6725879047844500747 RandomForest Regressor : 941.4584990860494144727 XGB Regressor : 1033.3863728784358499979 왜 이렇게 다른 결론이 나올까요? 해당 내용만 변경하고, 나머지 코드는 모두 동일한 상태에서 구동했습니다.