172만명의 커뮤니티!! 함께 토론해봐요.
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
안녕하세요. 작업형 2 한가지 방법으로 풀기의 내용으로 예시문제 작업형 2를 푸는데 개수가 맞지 않아서 질문 드립니다.. ValueError: X has 73 features, but DecisionTreeClassifier is expecting 74 features as input. import pandas as pd train = pd.read_csv("data/customer_train.csv") test = pd.read_csv("data/customer_test.csv") # 사용자 코딩 # print(train.shape, test.shape) # print(train.head(1), test.head(1)) # print(train['성별'].value_counts()) # print(train.isnull().sum(), test.isnull().sum()) train['환불금액'] = train['환불금액'].fillna(0) test['환불금액'] = test['환불금액'].fillna(0) target = train.pop('성별') print(train.shape, test.shape) train = pd.get_dummies(train) test = pd.get_dummies(test) print(train.shape, test.shape) 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=0) print(X_tr.shape, X_val.shape, y_tr.shape, y_val.shape) from sklearn.ensemble import RandomForestClassifier rf = RandomForestClassifier(random_state=0) rf.fit(X_tr, y_tr) pred = rf.predict_proba(X_val) from sklearn.metrics import roc_auc_score roc_auc = roc_auc_score(y_val, pred[:,1]) print('\n roc_auc:', roc_auc) pred = rf.predict_proba(test) print(pred[:3]) submit = pd.DataFrame({'pred':pred[:,1]}) submit.to_csv("result.csv", index=False)
python 머신러닝 빅데이터 pandas 빅데이터분석기사
이태경
2024-06-20T13:22:10.151Z
댓글 2
좋아요 0
조회수 332
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
섹션 13 기출 4회 풀이때는 train ,test데이터의 id값을 drop 해주셨는데 한가지 방법으로 풀이 때는 원핫인코딩을 해주셔서 drop을 안해주신건가요?
python 머신러닝 빅데이터 pandas 빅데이터분석기사
hj2930hj
2024-06-20T13:07:03.954Z
댓글 1
좋아요 0
조회수 178
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
검증 데이터 분할을 해서 일반적으로 모델에 rf.fit (X_tr_y_tr)을 진행하고 예측하다가 마지막에 바로 pred =rf.predict(test)로 테스트 데이터를 집어 넣는데요, rf.fit (train,target) 으로 다시 학습하고 집어 넣지 않아도 상관이 없나요 ? 두개가 굳이 차이가 없기떄문에 분할로 생성된 모델을 넣는건지 이유가 있는건지 궁금합니다
python 머신러닝 빅데이터 pandas 빅데이터분석기사
xxx0rud
2024-06-20T12:59:02.520Z
댓글 1
좋아요 0
조회수 184
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
train = train.drop('CLIENTNUM', axis=1) test_id = test.pop('CLIENTNUM') 왜 이전 회차에는 drop을 통해 빼줬는데,,, 왜 이후에는 pop만 해주나요??
python 머신러닝 빅데이터 pandas 빅데이터분석기사
lovelove567
2024-06-20T12:37:57.718Z
댓글 5
좋아요 0
조회수 426
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! 질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요 먼저 유사한 질문이 있었는지 검색해보세요 안녕하세요 영상 잘 보고 있습니다. 다름이 아니라 ols나 logit 후 summary로 나왔을 때, 답을 이걸 적으면 된다. 라고 하시면서 그냥 숫자를 적어주시던데. 그래도 되나요? 예) summary 값으로 p_value값이 가장 높은것은? 나왔을때, 따로 model.pvalues.max() 이런방식으로 맥스값을 불러오는게 아니라, 그냥 보고 아 이게 가장 크다 해서 큰 값을 손으로 적어도 되나요? model이후 이름?들 외우기도 힘들어서요 ㅠ 된다고 하면 그 값들은 안외워도 되니까요
python 머신러닝 빅데이터 pandas 빅데이터분석기사
limokokpk2
2024-06-20T12:27:29.484Z
댓글 2
좋아요 0
조회수 281
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! 질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요 먼저 유사한 질문이 있었는지 검색해보세요 선생님 작업형2유형의 경우 데이터가 train,test(2개)로 주거나 X_train, X_test, y_train으로 주는 경우가 있는데 제가 이해한 방향이 맞는지 확인해주시면 감사합니다. #2개일 경우(train, test) train 데이터에서 id 분리or 드랍, 타겟값 분리 test 데이터에서 id 분리 or 드랍 train값과 타겟값으로 검증 test 값으로 학습 #3개일 경우(X_train, X_test, y_train) X_train 데이터와 y_train 값(타겟 값)으로 검증, X_test 데이터로 학습 후 제출
python 머신러닝 빅데이터 pandas 빅데이터분석기사
sangjunla6
2024-06-20T12:03:38.862Z
댓글 2
좋아요 0
조회수 199
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
from sklearn.model_selection import train_test_split X_tr, X_val, y_tr, y_val = train_test_split(train.drop('output', axis=1), train['output'], test_size=0.15, random_state=2022) 작업형 예시 문제 풀떄는 drop을 통해서, 데이터 삭제하고, 분리했는데,, 여기서는 왜 바로 train이라고 넣나요??,, 그리고 test_id = test.pop으로 데이터 넣어줬는데,, 왜 안넣어요??,,,,,
python 머신러닝 빅데이터 pandas 빅데이터분석기사
lovelove567
2024-06-20T11:53:19.910Z
댓글 2
좋아요 0
조회수 203
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
작업형 2유형에서 코드 전체를 실행을 여러번 하면 파일이 저장이 여러번 되잖아요. 맨 마지막 버전 1개만 저장되는게 맞을까요?? 파일이 여러개 생성되는지... 걱정이 돼서 문의 드립니다
python 머신러닝 빅데이터 pandas 빅데이터분석기사
조성희
2024-06-20T11:38:57.310Z
댓글 1
좋아요 0
조회수 166
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! 질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요 먼저 유사한 질문이 있었는지 검색해보세요 선생님 만약 분류 문제가 나온다면 이러한 측정 지표를 사용해서 한 번에 봐도 괜찮을까요?
python 머신러닝 빅데이터 pandas 빅데이터분석기사
sangjunla6
2024-06-20T11:31:28.208Z
댓글 1
좋아요 0
조회수 151
미해결
[신규 개정판] 이것이 진짜 크롤링이다 - 실전편 (인공지능 수익화)
#클래스명은 주기적으로 바뀔듯 따라서 정규표현식으로 필터링 #광고상품 제거 일반 상품만 products = soup.find_all('div',class_=re.compile('^product_item__')) print(f"Number of products found: {len(products)}") 이런식으로 뒤에 uuid값이 바뀌는 상황을 고려하여 광고 상품 클래스명인 adProduct를 제외하고 일반 상품만 가져오고 싶은데 길이가 자꾸만 13개로 나오는데.. 다른 코드를 작성해야 할까요 ?
hm_stom
2024-06-20T11:04:09.180Z
댓글 1
좋아요 0
조회수 135
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
target이 object, int, float 타입 중 어느 것이어도 원핫 인코딩 전에 target = train.pop('target') 을 사용해도 되는 건가요?
python 머신러닝 빅데이터 pandas 빅데이터분석기사
aady97
2024-06-20T10:48:07.888Z
댓글 1
좋아요 0
조회수 221
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
교차검증 cross_val_score하기 전에 rf.randomforestclassifier 지정하는 거 외 val 분리도 해야 되는 게 맞나요? train_test_split 하고 그다음 분류 모델 선택하고 교차검증 하고 학습하는 순서대로 꼭 가야되는 건지? 아니면 train_test_split은 생략해도 되는건지 문의드립니다.
python 머신러닝 빅데이터 pandas 빅데이터분석기사
yhr581
2024-06-20T10:25:45.040Z
댓글 1
좋아요 0
조회수 176
해결됨
직장인에게 꼭 필요한 파이썬-아래아한글 자동화 레시피
안녕하세요. 궁금한 사항이 있어서 질문 드립니다. 문서에서 모든 수식에 alt + 2( 한글오피스에 저장한 2번째 매크로)를 적용하고 싶습니다. 챗 gpt는 pyautogui.hotkey('alt', '2') 를 이용하라고 하는데 적용이 되지 않아서 질문 드립니다. ctrl = hwp.HeadCtrl while ctrl: if ctrl.CtrlID == "eqed": eqedCtrls.append(ctrl) ctrl = ctrl.Next for ctrl in eqedCtrls: hwp.SetPosBySet(ctrl.GetAnchorPos(0)) hwp.FindCtrl() pyautogui.hotkey('alt', '2') hwp.Run("Cancel")
kun
2024-06-20T09:38:08.616Z
댓글 1
좋아요 1
조회수 448
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
ValueError: could not convert string to float: '기타' 선생님 자꾸 fit이쪽에서 에러가 발생하는데 이유를 알 수 있을까요ㅠㅠ미치곘습니다..
python 머신러닝 빅데이터 pandas 빅데이터분석기사
한정수
2024-06-20T09:23:32.902Z
댓글 2
좋아요 0
조회수 231
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
안녕하세요, 이전에 테스트 데이터를 넣었을 때 오류가 난다고 했던 수강생입니다. 주구매상품과 구매지점을 넣어서 훈련시키는 건 해결했는데(이전 질문은 해결됨), 수치형 데이터로 훈련시킬 때 아래와 같은 오류메세지가 뜹니다. 농산물은 주구매상품에 있는 변수던데 수치형만 넣었는데도 불구하고 어디서 나온건지.. 이해가 안됩니다.. 우선 제가 입력했던 코드는 다음과 같습니다. 바쁘신 와중에 확인해주셔서 감사합니다!! import pandas as pd pd.set_option('display.max_columns',None) train = pd.read_csv("data/customer_train.csv") test = pd.read_csv("data/customer_test.csv") train['환불금액'] = train['환불금액'].fillna(0) test['환불금액'] = test['환불금액'].fillna(0) #cols=['주구매상품','주구매지점']#0.6117 cols=['회원ID','총구매액','최대구매액','환불금액','방문일수','방문당구매건수','주말방문비율','구매주기'] target=train.pop('성별') #from sklearn.preprocessing import LabelEncoder #le=LabelEncoder() #for col in cols: # train[col]=le.fit_transform(train[col]) # test[col]=le.transform(test[col]) 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=0) from sklearn.ensemble import RandomForestClassifier model=RandomForestClassifier() model.fit(x_tr,y_tr) pred=model.predict_proba(x_val) #print(pred) from sklearn.metrics import roc_auc_score print(roc_auc_score(y_val, pred[:,1])) pred = model.predict_proba(test) submit = pd.DataFrame({ 'pred': pred[:,1] }) submit.to_csv('result.csv', index=False) print(pd.read_csv('result.csv'))
python 머신러닝 빅데이터 pandas 빅데이터분석기사
2024-06-20T09:12:35.114Z
댓글 2
좋아요 0
조회수 202
미해결
<M.B.I.T> 테스트 페이지 만들기! with Django
http://mbit.weniv.co.kr/ 사이트 접속이 안돼요
이유정
2024-06-20T08:41:45.729Z
댓글 1
좋아요 0
조회수 256
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
시험환경에서 작업형1, 3 은 따로 결과를 기입하는 부분이 있다고 알고있습니다.결과쓰는 부분에 답을 81 이라고 쓰면 될것 같은데, print() 로 써야 한다고 하는 부분이 이해가 안갑니다.결과 제출을 어떻게 해야하는지요?
python 머신러닝 빅데이터 pandas 빅데이터분석기사
crystal
2024-06-20T08:29:35.371Z
댓글 1
좋아요 0
조회수 147
미해결
반응형 웹사이트 포트폴리오(Architecture Agency)
<!doctype html> <html lang="ko"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>DesignWorks Architecture Agency</title> <script src="js/jquery-2.1.4.js"></script> <!-- Page Scroll Effects JS & CSS --> <script src="js/velocity/modernizr.js"></script> <script src="js/velocity/velocity.min.js"></script> <script src="js/velocity/velocity.ui.min.js"></script> <script src="js/velocity/main.js"></script> <link rel="stylesheet" href="js/velocity/velocity.css"> <!-- Smooth Scrolling --> <script src="js/jquery.scrollTo.min.js"></script> <!-- Custom JS & CSS --> <script src="custom.js"></script> <link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="responsive.css"> </head> <!-- hijacking: on/off - animation: none/scaleDown/rotate/gallery/catch/opacity/fixed/parallax --> <body data-hijacking="on" data-animation="rotate"> <div class="container"> <section class="cd-section visible" id="home"> <div> <div class="content"> <img src="images/temp-section-01.jpg"> </div> </div> </section> <section class="cd-section" id="about"> <div> <div class="content"> <img src="images/temp-section-02.jpg"> </div> </div> </section> <section class="cd-section" id="project"> <div> <div class="content"> <img src="images/temp-section-03.jpg"> </div> </div> </section> <section class="cd-section" id="plan"> <div> <div class="content"> <img src="images/temp-section-04.jpg"> </div> </div> </section> <section class="cd-section" id="awards"> <div> <div class="content"> <div class="awards-inner"> <div class="about-awards"> <div class="about-heading"> <!-- 이런식으로 부모요소로 묶기 --> <h2>2024 <br>Architecture Awards <br>Winner</h2> <hr class="bar"> <p> The mission of the Architecture MasterPrize (AMP) is to advance the appreciation and exposure of quality architectural design worldwide. The AMP architecture award celebrates creativity and innovation in the fields of architectural design, landscape architecture, and interior design. Submissions from architects all around the world are welcome. </p> <!-- 새창에서 띄우기 타겟 블랭크 --> <a href="https://architectureprize.com/" target="_blank">View the awards</a> </div> </div> <div class="victory-jump"> <img src="/images/victory-jump.png"> </div> </div> </div> </div> </div> </section> <section class="cd-section" id="location"> <div> <div class="content"> <div class="location-inner"></div> </div> </div> </section> <section class="cd-section" id="contact"> <div> <div class="content"> <img src="images/temp-section-07.jpg"> </div> </div> </section> <header> <div class="gnb-inner"> <div class="logo"> <a href="#none"><img src="images/logo.png"></a> </div> <div class="gnb"> <div class="menu"> <a href="#home">Home</a> <a href="#about">About</a> <a href="#project">Project</a> <a href="#plan">Plan & History</a> <a href="#awards">Awards</a> <a href="#location">Location</a> <a href="#contact">Contact</a> </div> <div class="slogan">We design places, not projects.</div> </div> <div class="trigger"> <span></span> <span></span> <span></span> </div> </div> </header> </div> <!-- 스크롤 부분 --> <a href="#" class="gototop"><img src="images/gototop.png"></a> <!-- 폰트어썸 아이콘부분 --> <a href="#" class="btn-hiring"><i class="fa fa-commenting"></i> Hiring</a> <nav> <ul class="cd-vertical-nav"> <li><a href="#0" class="cd-prev inactive">Next</a></li> <li><a href="#0" class="cd-next">Prev</a></li> </ul> </nav> </body> </html> * pc버전 */ /* Google Web Font : Montserrat */ @import url('https://fonts.googleapis.com/css?family=Montserrat:200,300,400,500&display=swap'); @import url('https://fonts.googleapis.com/css?family=Manrope:300,400,500,600&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@200;300;400;600;700;900&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Overpass&display=swap'); /* FontAwesome CDN 4.7 */ @import url('https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css'); /* Reset CSS */ * { box-sizing: border-box; } ul { list-style: none; } a { text-decoration: none; } /* Default CSS */ body { font-family: 'Montserrat', sans-serif; color: #222; font-size: 15px; margin: 0; height: 100vh; background-color: #fff; } /* Entire Layout */ .cd-section { height: 100vh; } .cd-section > div { height: 100%; position: relative; } .content { background-color: #ddd; position: absolute; width: calc(100% - 40px); height: calc(100% - 80px); left: 20px; bottom: 20px; overflow: hidden; } /* Header */ header { position: fixed; top: 0; left: 0; width: 100%; } .gnb-inner { /*border: 1px solid #000;*/ width: calc(100% - 40px); margin: auto; height: 60px; line-height: 60px; } .logo { float: left; } .logo img { padding-top: 17px; } .gnb { float: right; } .menu { display: none; } .menu a {} .slogan { font-size: 16px; font-style: italic; } .trigger { display: none; } /* Hiring Button */ .btn-hiring { position: fixed; right: 50px; bottom: 50px; color: #fff; background-color: #000; /* 앞 px상하,뒤 px좌우 */ padding: 10px 20px; border-radius: 20px; /* 가로,세로,퍼짐정도 */ box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.38); transition: 0.5s; } .btn-hiring .fa { transform: rotateY(180deg); margin-right: 5px; } /* 버튼이 눌리는 느낌 */ .btn-hiring:active { transform: scale(0) } /* ################### Section : awards-winner ################### */ .awards-inner { height: 100%; border: 1px solid #ddd; } .awards-inner > div { border: 1px solid #000; float: left; width: 50%; height: 100%; position: relative; } .about-awards { background-color: #1a1f24; color: #fff; } .about-heading { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; width: 70%; } .victory-jump { background-color: #fff; } .victory-jump img { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 80%; } 선생님께서 올려주신 비쥬얼스튜디오 full reload 해결 방법 강의를 듣고 적용시킨 후 작업 중이였는데 갑자기 코딩 시 최상단으로 올라가는 현상이 발생합니다.설정을 다시 확인하고 익스텐션에서 open sever를 재설치하였음에도 해결되지 않아서 질문드립니다!
ckrnckr12
2024-06-20T07:45:22.613Z
댓글 3
좋아요 1
조회수 356
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! 질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요 먼저 유사한 질문이 있었는지 검색해보세요
python 머신러닝 빅데이터 pandas 빅데이터분석기사
조수민
2024-06-20T07:27:09.899Z
댓글 2
좋아요 0
조회수 267
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
#100%가 넘는 접종률 제거 df = df[df['ratio']<100] # print(df.head()) # print(df['country'].value_counts()) df2 = df.groupby('country').max()import pandas as pd df = pd.read_csv("../input/covid-vaccination-vs-death/covid-vaccination-vs-death_ratio.csv") # print(df.head()) df2 = df.groupby('country').max() #시간에 따라 접종률이 점점 올라감 df2 = df2.sort_values(by='ratio', ascending = False) #100%가 넘는 접종률 제거 cond = df2['ratio'] <= 100 df2 = df2[cond] top = df2['ratio'].head(10).mean() bottom = df2['ratio'].tail(10).mean() print(round(top - bottom,1)) 제 코드 입니다. 제가 여기서 여쭤보고싶은 내용은 먼저 100%이상건을 제외하고 작업에 들어가야하지 않나용?
python 머신러닝 빅데이터 pandas 빅데이터분석기사
joy10780
2024-06-20T07:26:04.441Z
댓글 1
좋아요 0
조회수 141