안녕하세요! 머신러닝 학습 중에 DT,RF,XGBOOST 모두 선생님이 하신 것과 동일하게 코드 작성하고 실행했는데 모두 결과값이 다르게 나와서요. 제가 무언가를 잘못 한 걸까요?? 이게 DT랑 RF는 결과값이 똑같이 나왔습니다. from sklearn.ensemble import RandomForestClassifier rf = RandomForestClassifier() rf.fit(X_tr[cols], y_tr) pred = rf.predict_proba(X_val[cols]) pred[:10] array([[1.], [1.], [1.], [1.], [1.], [1.], [1.], [1.], [1.], [1.]]) 이게 XGB입니다. from xgboost import XGBClassifier xgb = XGBClassifier() xgb.fit(X_tr[cols], y_tr) pred = xgb.predict_proba(X_val[cols]) pred[:10] array([[9.999634e-01, 3.657642e-05], [9.999634e-01, 3.657642e-05], [9.999634e-01, 3.657642e-05], [9.999634e-01, 3.657642e-05], [9.999634e-01, 3.657642e-05], [9.999634e-01, 3.657642e-05], [9.999634e-01, 3.657642e-05], [9.999634e-01, 3.657642e-05], [9.999634e-01, 3.657642e-05], [9.999634e-01, 3.657642e-05]], dtype=float32) 그리고 이 예측데이터로 roc_auc 스코어를 뽑아내려고 하니 이런 오류가 뜨면서 안된다고 해서요. 무엇이 문제인지 궁금합니다ㅠㅠ from sklearn.metrics import roc_auc_score roc_auc_score(y_val,pred[:,1]) /usr/local/lib/python3.10/dist-packages/sklearn/metrics/_ranking.py in _binary_roc_auc_score(y_true, y_score, sample_weight, max_fpr) 337 """Binary roc auc score.""" 338 if len(np.unique(y_true)) != 2: --> 339 raise ValueError( 340 "Only one class present in y_true. ROC AUC score " 341 "is not defined in that case." ValueError: Only one class present in y_true. ROC AUC score is not defined in that case.
제가 코드안되는 부분 찾다가 solve()>fill(visited) 함수에서 전역변수 vector<> v의 크기가 0으로 초기화 되는 문제를 겪었습니다 https://www.acmicpc.net/source/78783272 상세한 문제는 위 코드링크에 주석 달아놓았습니다 무언가 잘못한 거같은데 모르겠네요 // 개요 vector<pair<int, int>> v; int solve(){ // 여기서 visited 아니라 v가 초기화됨 fill(&visited,,) } int main(){ max(ret,solve()); }
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 여기에 질문 내용을 남겨주세요. 본 강좌 커뮤니티의 다른 분들 해결사례처럼 build.gradle의 mybatis 부트스타터 버전을 2.3.2로 다운 그레이드하여 당장의 오류는 해결했습니다. 근데 왜 이런 오류가 터진건지 원인에 대한 궁금증은 남네요. 스프링부트3 이후로 어떤 이유로 더이상 동적 프록시 객체 생성을 해주지 않는건지, 아니면 아직 mybatis-스프링 연동 모듈의 업데이트가 늦어진게 이유인건지, 궁금합니다. @Mapper조회가 잘되지 않은건지 하여, MyBatisConfig에 @MapperScan("hello.itemservice.repository.mybatis") 어노테이션까지 넣어봤는데도 잘 안되었습니다.
[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예) [질문 내용] LinkedHashSet은 HashSet과 같은데 Node를 추가해서 입력 순서를 유지한다 들었습니다.그럼 만약에 HashIndex가 같은 경우(해시 충돌) Node도 HashSet과 같이 List 형식으로 저장이 되는게 맞을까요?
안녕하세요. 강사님 다른 분의 질문에서 확인 colab향 char-rnn 코드를 보다가 질문 사항이 생겼습니다. colab향 코드와 강의에서 설명한 python 코드의 차이를 보면 app.run 과 같은 absl 라이브러리 관련 코드가 colab향 코드에는 없는데, 이게 colab에서는 absl 라이브러리를 import 할 수 없기 때문이지 궁금합니다. 신기한게 강의에서는 구글에서 absl 라이브러리를 만든 것으로 제가 들은 것 같은데, 정작 google의 colab 환경에서는 해당 라이브러리를 사용할 수 없다는 사실이 신기 합니다. P.S 혹시 colab 환경에서 실행 가능한 char-rnn 코드 URL주소 https://colab.research.google.com/drive/1Lr-tdAWh6sJdmAcOCmimHOIaK54idw-t?usp=sharing
안녕하세요, 강의를 듣다가 몇가지 질문이 생겼습니다. 1. Pessimitic Lock와 Optimitic Lock 는 select 구문(@Query("select ...) 나 find 쿼리메서드)에서만 @Lock을 적용하는거라고 이해하면 될까요? 2. Pessimitic Lock 과 Optimitic Lock 의 벌크 수정 쿼리는 어떻게 처리가 되는건가요? 2-1. Pessimitic Lock 은 select 절로 데이터를 가져오지 않는다면 어떻게 벌크 수정이 되는건가요? 2-2. Optimitic Lock 은 벌크 연산에서 직접 버전을 수정하는게 맞을까요? 좋은 강의 감사합니다.
[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core
안녕하세요. 강의: NestJS REST API 백엔드 완전 정복 섹션: 35 모듈 네스팅 동영상: Paginate Comments API 만들기 위에 적은 강의 동영상의 끝부분이, 의도치 않게 잘린 것 같습니다. 마지막인 5:56 시간에서, 말씀하는 도중에 강의가 끝나버립니다. 확인해 주시면 감사하겠습니다.
7:16 Implement members를 하려고 하는데 어떻게 해야되나요? 여담으로 아직 섹션 1 끝내지도 않았는데 옛날 버전이라 그런지 진도 나가기가 너무 힘들어요... 강의 최신 버전으로 업데이트는 안되나요? 프로젝트 생성부터 Gradle 추가까지 지금 7분밖에 못 들었는데 두시간을 넘게 찾고있는거 같습니다.
SQL의 ON절과 QueryDsl의 ON절 간에 차이가 있어보여 질문드립니다. SQL의 ON절에서는 테이블과 테이블 간에 어떤 컬럼을 기준으로 조인될 것인가를 명시하는 기능을 하는데 비해, QueryDsl에서는 join메서드가 그 기능을 포함하고 on메서드가 마치 sql의 where절의 역할을 하는 것(그렇기 때문에 QueryDsl에서는 SQL과 달리 on 메서드와 where 메서드를 함께 사용할 수 없음)으로 보이는데 맞을까요?
k8s-master와 node2 까지는 join.sh 가 잘됩니다만 node1은 -bash: kubeadm: command not found 라고 나오면서 마스터 서버에 조인이 불가능합니다 Xshell에서 node1을 지우고 새로 생성해봐도 똑같이 뜨는데 아무래도 커버네티스가 Node1에서 제대로 설치가 안된것같은데 Vagrant 파일안에 있는 명령문들로 개별적으로 설치중이긴한데 상관없을까요?
import React, {ReactNode} from 'react'; import { Pressable, StyleSheet, Text, PressableProps, Dimensions, View, StyleProp, ViewStyle, TextStyle, } from 'react-native'; import {colors} from '../../constants'; import useThemeStore from '@/store/useThemeStore'; import {ThemeMode} from '@/types/common'; interface CustomButtonProps extends PressableProps { label: string; variant?: 'filled' | 'outlined'; size?: 'large' | 'medium'; inValid?: boolean; style?: StyleProp<ViewStyle>; textStyle?: StyleProp<TextStyle>; icon?: ReactNode; } const deviceHeight = Dimensions.get('screen').height; function CustomButton({ label, variant = 'filled', size = 'large', inValid = false, style = null, textStyle = null, icon = null, ...props }: CustomButtonProps) { const {theme} = useThemeStore(); const styles = styling(theme); // 여기서는 제대로 출력이 됩니다. 값이 제대로 읽힙니다. console.log(colors[theme].PINK_700); return ( <Pressable disabled={inValid} style={({pressed}) => [ styles.container, pressed ? styles[`${variant}Pressed`] : styles[variant], inValid && styles.inValid, style, ]} {...props}> <View style={styles[size]}> {icon} <Text style={[styles.text, styles[`${variant}Text`], textStyle]}> {label} </Text> </View> </Pressable> ); } const styling = (theme: ThemeMode) => StyleSheet.create({ container: { borderRadius: 3, justifyContent: 'center', flexDirection: 'row', }, inValid: { opacity: 0.5, }, filled: { backgroundColor: colors[theme].PINK_700, }, outlined: { borderColor: colors[theme].PINK_700, borderWidth: 1, }, filledPressed: { backgroundColor: colors[theme].PINK_500, }, outlinedPressed: { borderColor: colors[theme].PINK_700, borderWidth: 1, opacity: 0.5, }, large: { width: '100%', paddingVertical: deviceHeight > 700 ? 15 : 10, alignItems: 'center', justifyContent: 'center', flexDirection: 'row', gap: 5, }, medium: { width: '50%', paddingVertical: deviceHeight > 700 ? 12 : 8, alignItems: 'center', justifyContent: 'center', flexDirection: 'row', gap: 5, }, text: { fontSize: 16, fontWeight: '700', }, filledText: { color: colors[theme].WHITE, }, outlinedText: { color: colors[theme].PINK_700, }, }); export default CustomButton; console.log(colors[theme].PINK_700); 이렇게 출력할 경우, 제대로 아래와 같이 출력이 됩니다만 스타일은 제대로 읽어오지 않습니다. 이 부분에 대해서 알고 싶습니다. BUNDLE ./index.js LOG Running "MatzipApp" with {"rootTag":171,"initialProps":{"concurrentRoot":false}} LOG light LOG #C63B64 LOG #C63B64 LOG #C63B64 ERROR TypeError: Cannot read property 'PINK_700' of undefined This error is located at: in CustomButton (created by ErrorBoundary) in RCTView (created by View) in View (created by ErrorBoundary) in ErrorBoundary (created by RetryErrorBoundary) in RetryErrorBoundary (created by RootNavigator) in RootNavigator (created by App) in EnsureSingleNavigator in BaseNavigationContainer in ThemeProvider in NavigationContainerInner (created by App) in _QueryClientProvider (created by App) in App in RCTView (created by View) in View (created by AppContainer) in RCTView (created by View) in View (created by AppContainer) in AppContainer in MatzipApp(RootComponent), js engine: hermes ERROR TypeError: Cannot read property 'WHITE' of undefined This error is located at: in RetryErrorBoundary (created by RootNavigator) in RootNavigator (created by App) in EnsureSingleNavigator in BaseNavigationContainer in ThemeProvider in NavigationContainerInner (created by App) in _QueryClientProvider (created by App) in App in RCTView (created by View) in View (created by AppContainer) in RCTView (created by View) in View (created by AppContainer) in AppContainer in MatzipApp(RootComponent), js engine: hermes ERROR TypeError: Cannot read property 'WHITE' of undefined This error is located at: in RetryErrorBoundary (created by RootNavigator) in RootNavigator (created by App) in EnsureSingleNavigator in BaseNavigationContainer in ThemeProvider in NavigationContainerInner (created by App) in _QueryClientProvider (created by App) in App in RCTView (created by View) in View (created by AppContainer) in RCTView (created by View) in View (created by AppContainer) in AppContainer in MatzipApp(RootComponent), js engine: hermes ERROR TypeError: Cannot read property 'WHITE' of undefined https://github.com/dydals3440/MatZip 좀더 정확히 판단을 위하여 제가 커밋한 레포 남겨드립니다!!!