안녕하세요 교수님 교수님의 머신러닝 강의가 정말 많은 도움이 되고 있어 감사하고 있습니다. 저는 통계를 우선 공부를 한 후 교수님 강의를 통해 머신러닝을 공부중인 연구개발 직장인입니다. 지도학습, 비지도학습 각각의 모델에 대한 개요와 내용들은 정말 자세하게 설명해주시는 것 같습니다. 다만, 예측 모델을 만든다 라고 했을 때, 저는 다음 과정으로 머신 러닝을 이해했습니다. 틀린 게 있거나, 부족하면 말씀부탁드립니다. 1. Teat data set EDA 2. Data pre-processing 3. Input feature select, extract 4. Model training 5. Model validation 6. new input feature prediction 연속 데이터로 이루어진 실험데이터로 선형 회귀 예측 모델을 구현한다라고 했을 때 하기 내용에 대해 궁금합니다. step 2. 과정에서 standardization scaling 했을 때 정규성 검증은 필요가 없나요?? (e.g. shaprio-wilks test, 각 feature 별 QQ plot) step 3. 과정에서 교수님 강의에서는 data scaling 이후 바로 모델 학습/예측/평가를 진행하고, feature 별 회귀 계수를 구하십니다.(경사 하강법) 저는 해당 과정에서 다중 공선성 방지를 위해 PCA, ICA를 통한 features extraction으로 training 으로 진행하는 것으로 이해했는데 해당 방식이 틀린 것인지 여쭙고 싶습니다. 추가로, n개 feature에 대해 몇 개로 차원 축소하는 기준이 있는지 궁금합니다 또, 지도 학습 모델인 선형 회귀 모델을 진행하는데 있어 비지도 학습 기법이 사용이 되는 것이 소개가 안된 것 같은데 이부분에 대해서 어떻게 생각하시는지도 궁금합니다.(정확히는 예측 모델을 구현하는 일련의 과정) 마지막으로 step 5. 과정에서 선형 회귀 모델이 통계적으로 유의한가에 대해 P-value 를 측정하곤 하던데, 이부분에 대해서 간단히 설명해주시면 정말 감사하겠습니다. 상기 질문들을 하는 이유는, 저는 단순히 어떤 연속 데이터 셋에서 ML 모델을 통해 추정하고 싶은데, 여러 분야에서 ML을 사용하다보니 예를 들어 통계 분야 에서는 가설과 함께 설명하고 또 어떤 분야에서는 또 다르게 설명을 하다보니 혼동이 되어서 해당 질문을 드리게 되는 것입니다. 답변 주시면 정말 감사합겠습니다!
강의에서 제공된 코드는 영화 개봉 날짜, 평점을 가져오지 못하고 있는데 아래 코드 사용하시면 됩니다. 그리고 태그가 단일 요소일 경우 contents 속성을 사용하기 보다는 string 속성을 사용하면 리스트가 아닌 문자형으로 바로 출력할 수 있습니다. for dt, dd in zip(c_dt, c_dd): if dd.select_one('c-star'): rating = dd.select_one('c-star').next_element.strip() c_data[dt.string] = rating elif dd.select_one('span'): days = dd.select_one('span').string c_data[dt.string] = days else: c_data[dt.string] = dd.string
s = list(input()) n = len(s) choose = [] check = [False] * len(s) ans = [] def check_ad(s): for i in range(len(s)-1): if s[i] == s[i+1]: return False return True def make(level): if level == n and check_ad(choose): result = ''.join(choose) if result not in ans: ans.append(result) for i in range(n): if check[i]: continue choose.append(s[i]) check[i] = True make(level + 1) choose.pop() check[i] = False make(0) print(len(ans)) 안녕하세요 강사님! 위 코드는 시간 초과가 나는데 순열 강의 알고리즘을 그대로 사용한 것입니다! 강사님의 순열 코드는 시간 초과가 안나는데 왜 이거는 시간초과가 날까요? 내장된 permutation이 효율적으로 구현된 것일까요?
now = datetime(year=2023, month=3, day=30) print('현재시간:' + str(now)) print('-----------------월 연산 --------------------') print(now + relativedelta.relativedelta(months=1)) print(now.replace(month=1)) 위의 코드 실행 결과가 다르게 나오는 것 같은데요..1개월 후면 4월30일이 맞는 것 아닌가요? 현재시간:2023-03-30 00:00:00 -----------------월 연산 -------------------- 2023-04-30 00:00:00 2023-01-30 00:00:00 감사합니다.
cv2.imread() 함수를 통해 이미지를 읽어 들일 때, 한글을 읽어오지 못해 오류가 발생하는 경우가 있습니다. 아래의 코드로 해결하시면 됩니다. 참고로, 아래 코드 사용 시 cvtColor() 함수를 사용해서 색상을 변경하지 않아도 됩니다. import numpy as np img_path = "이미지 파일 경로" img_file= np.fromfile(img_path, np.uint8) cv_decode = cv2.imdecode(img_file, cv2.IMREAD_COLOR) qr_reader = pyzbar.decode(cv_decode) print(qr_reader)
강의 보면서 '퍼널별 유저 수 집계' 쿼리 작성했는데 결과값이 올바르게 나오지 않아요... 어디서 잘못 되었을까요? WITH base AS( SELECT event_date, event_name, DATETIME(TIMESTAMP_MICROS(event_timestamp),'Asia/Seoul') as event_timestamp, event_param, user_id, user_pseudo_id, platform, -- event_parma.key PIVOT MAX(IF(event_param.key='firebase_screen',event_param.value.string_value,null)) AS firebase_screen, -- MAX(IF(event_param.key='food_id',event_param.value.int_value,null)) AS food_id, MAX(IF(event_param.key='session_id',event_param.value.string_value,null)) AS session_id FROM advanced.app_logs CROSS JOIN UNNEST(event_params) as event_param GROUP BY ALL) -- event_name + screen (필요한 이벤트만 where 조건에 걸어서 사용) ,filter_event as( SELECT * except(event_name,firebase_screen), concat(event_name,'-',firebase_screen) AS event_name_with_screen FROM base WHERE event_name in ('screen_view','click_payment')) SELECT event_name_with_screen, -- step_number case when event_name_with_screen='screen_view-welcome' then 1 when event_name_with_screen='screen_view-home' then 2 when event_name_with_screen='screen_view-food_category' then 3 when event_name_with_screen='screen_view-restaurant' then 4 when event_name_with_screen='screen_view-cart' then 5 when event_name_with_screen='click_pavement-cart' then 6 else null end AS Step_number, count(DISTINCT user_pseudo_id) as cnt FROM filter_event GROUP BY ALL HAVING step_number IS NOT NULL
섹션8에서 게시글 정보 가져오기에서16:00 WidgetsBinding.instance.addPostFrameCallback(callback) 나봅니다. 강의처럼 timeStamp가 나오지 않고, 그래서 그냥 진행했습니다. WidgetsBinding.instance.addPostFrameCallback((_) async { 그런데 다음과 같이 에러가 뜨네요. 이런 메세지가 뜨는 이유가 뭔가요
강의에서 보면 예를 들어 goog의 연평균 주식 구하실때, pct_change() 구한값에 mean()을 취하셔서 working day 252를 곱하셨는데, 복리 개념을 생각해보면 (df_daily['goog'].pct_change() + 1).prod() ** (252/len(df_daily)) - 1 이렇게 되야 하는게 아닌가 궁금하여 문의드립니다! 값이 거의 비슷하다고 가정하시고 그냥 복리 개념은 생략하신건지요! 감사합니다
안녕하세요! 2분 쯤에 구조체 선언하는 2가지 형태에 대해서 비교해 주실때 오른쪽에서 구조체 선언할때 (왼쪽과는 달리)그냥 struct 라고만 되어있는데 struct Person {//내용}person1 ; 이렇게 Person(구조체명)이 들어가야 하는데 실수로 빠진 건지 아니면 이 경우에는 구조체명을 쓰지 않아도 되는 건지 궁금합니다! 그리고 왼쪽 케이스 아랫부분 사용시 용례에 struct 구조체명 타입명; 이라고 되어있는데 여기서 타입명을 변수명이라고 이해해도 될까요? 뒷 강의에서 typedef를 다루면서 타입명이 나오기는 하는데 여기서도 typedef 키워드가 있을때를 의미하는 건지 헷갈려서요ㅜㅜ
# base 쿼리 작성 전 생각 흐름 ---------------------------------------------------- ## 1. 테이블 내 데이터 구조 파악 -- select -- * -- from advanced.app_logs -- where -- event_date = '2022-08-01' -- 목적에 맞는 쿼리를 기존 데이터로 구현할 수 있는지 여부 확인 -- 연습문제 결과물 컬럼인 'event_name_with_screen', 'step_number', 'cnt'는 기존 컬럼에 없음. -- 기존 컬럼에 없기 때문에 해당 컬럼을 어떻게 구현해내야 할 지 생각해보기 ## 2. event_name_with_screen 컬럼 구현 순서 및 방법 -- event_name_with_screen는 다음과 같은 value를 가짐 -- 1. screen_view-welcome -- 2. screen_view-home -- 3. screen_view-food_vategory -- 4. screen_view-restaurant -- 5. screen_view-cart -- 6. click_payment-cart -- 위 6가지 value가 기존 컬럼에 있는지 확인해보기 -- 있는 경우 -- 기존 컬럼 활용 -- 없는 경우 -- concat 등으로 새롭게 구현 -- 연습문제에서는 event_name과 event_params.key에 있는 value를 concat 했음. -- event_params.key는 데이터타입이 struct이기 때문에 unnest 필요. -- select -- event_name, -- unnest_event_params -- from advanced.app_logs -- cross join unnest(event_params) as unnest_event_params -- where -- event_date = '2022-08-01' -- unnest 결과물에 피봇테이블 적용하기 -- 피봇테이블로 만들면 직관적으로 event_name과 concat 하기가 용이해서. -- select -- event_name, -- event_date, -- event_timestamp, -- user_pseudo_id, -- max(if(unnest_event_params.key = 'firebase_screen', unnest_event_params.value.string_value, null)) as firebase_screen, -- max(if(unnest_event_params.key = 'food_id', unnest_event_params.value.int_value, null)) as food_id, -- max(if(unnest_event_params.key = 'session_id', unnest_event_params.value.string_value, null)) as session_id -- from advanced.app_logs -- cross join unnest(event_params) as unnest_event_params -- where event_date between '2022-08-01' and '2022-08-18' -- group by 1, 2, 3, 4 ---------------------------------------------------- with base as ( select event_name, event_date, event_timestamp, user_pseudo_id, max(if(unnest_event_params.key = 'firebase_screen', unnest_event_params.value.string_value, null)) as firebase_screen, max(if(unnest_event_params.key = 'food_id', unnest_event_params.value.int_value, null)) as food_id, max(if(unnest_event_params.key = 'session_id', unnest_event_params.value.string_value, null)) as session_id from advanced.app_logs cross join unnest(event_params) as unnest_event_params where event_date between '2022-08-01' and '2022-08-18' group by 1, 2, 3, 4 ), base2 as ( select *, concat(event_name, '-', firebase_screen) as event_name_with_screen from base ) ## 일자별 퍼널 쿼리 , base3 as (select event_date, event_name_with_screen, # 2개 이상 조건을 한 개 컬럼에 적용해야 하기 때문에 case when 사용 case when event_name_with_screen = 'screen_view-welcome' then 1 when event_name_with_screen = 'screen_view-home' then 2 when event_name_with_screen = 'screen_view-food_category' then 3 when event_name_with_screen = 'screen_view-restaurant' then 4 when event_name_with_screen = 'screen_view-cart' then 5 when event_name_with_screen = 'click_payment-cart' then 6 else null end as step_number, # 중복되지 않은 사용자수(비로그인 이용자까지)를 파악하기 위해서 count(distinct 컬럼명) 사용 count(distinct user_pseudo_id) as cnt from base2 group by all # null 값 제외하기 위해서 그룹에 필터링 거는 having 사용 having step_number is not null # 1일부터 보고 싶기 때문에 오름차순(asc) 적용 order by 1 asc) ## 일자별 쿼리 (피벗테이블 적용) select event_date, max(if(event_name_with_screen = 'screen_view-welcome', cnt, 0)) as screen_view_welcome, max(if(event_name_with_screen = 'screen_view-home', cnt, 0)) as screen_view_home, max(if(event_name_with_screen = 'screen_view-food_category', cnt, 0)) as screen_view_food_category, max(if(event_name_with_screen = 'screen_view-restaurant', cnt, 0)) as screen_view_restaurant, from base3 group by all order by 1 asc
패키지 매니저를 pnpm으로 사용하고 pnpm i 후 pnpm run build && pnpm run start 시 validator 모듈이 없다고 나와서 rm -rf node_modules pnpm-lock.yaml 후 npm으로 모듈들 설치 및 빌드, 서버 실행이 됩니다. npm이 유령 의존성 이슈가 있다고 들어서 pnpm 또는 yarn을 이용하려 한 건데, 오히려 npm을 사용해야만 문제없이 돌아가는 상황에 대해, 이게 어떤 상황인지 알 수 있을까요?