inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

172만명의 커뮤니티!! 함께 토론해봐요.

라벨 인코딩에서 오류가 납니다..

해결됨

[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)

마지막 강의 영상 <정리>부분에서 데이터 불러오기 X_train = pd.read _csv(" https://raw.githubusercontent.com/lovedlim/inf/main/p2/data_atype/X_train.csv ") y_train = pd.read _csv(" https://raw.githubusercontent.com/lovedlim/inf/main/p2/data_atype/y_train.csv ") X_test = pd.read _csv(" https://raw.githubusercontent.com/lovedlim/inf/main/p2/data_atype/X_test.csv ") 데이터 분리 n_train = X_ train.select _dtypes(exclude='object').copy() n_test = X_ test.select _dtypes(exclude='object').copy() c_train = X_ train.select _dtypes(include='object').copy() c_test = X_ test.select _dtypes(include='object').copy() 수치형 민맥스 스케일 cols = ['age', 'fnlwgt', 'education.num', 'capital.gain', 'capital.loss', 'hours.per.week'] from sklearn.preprocessing import MinMaxScaler scaler = MinMaxScaler() n_train[cols] = scaler.fit _transform(n_train[cols]) n_test[cols] = scaler.transform(n_test[cols]) 라벨인코딩 cols = ['workclass', 'education', 'marital.status', 'occupation', 'relationship', 'race', 'sex', ' native.country '] from sklearn.preprocessing import LabelEncoder le = LabelEncoder() for col in cols: le = LabelEncoder() c_train[col] = le.fit _transform(c_train[col]) c_test[col] = le.transform(c_test[col]) 이 부분에서 이러한 에러가 납니다.. --------------------------------------------------------------------------- TypeError Traceback (most recent call last) ~\anaconda3\lib\site-packages\sklearn\preprocessing\_label.py in _encode(values, uniques, encode, check_unknown) 112 try: --> 113 res = _encode_python(values, uniques, encode) 114 except TypeError: ~\anaconda3\lib\site-packages\sklearn\preprocessing\_label.py in _encode_python(values, uniques, encode) 60 if uniques is None: ---> 61 uniques = sorted(set(values)) 62 uniques = np.array(uniques, dtype=values.dtype) TypeError: '<' not supported between instances of 'str' and 'float' During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) <ipython-input-95-295cc9604042> in <module> 7 for col in cols: 8 le = LabelEncoder() ----> 9 c_train[col] = le.fit_transform(c_train[col]) 10 c_test[col] = le.transform(c_test[col]) ~\anaconda3\lib\site-packages\sklearn\preprocessing\_label.py in fit_transform(self, y) 254 """ 255 y = column_or_1d(y, warn=True) --> 256 self.classes_, y = _encode(y, encode=True) 257 return y 258 ~\anaconda3\lib\site-packages\sklearn\preprocessing\_label.py in _encode(values, uniques, encode, check_unknown) 115 types = sorted(t.__qualname__ 116 for t in set(type(v) for v in values)) --> 117 raise TypeError("Encoders require their input to be uniformly " 118 f"strings or numbers. Got {types}") 119 return res TypeError: Encoders require their input to be uniformly strings or numbers. Got ['float', 'str']

  • python
  • 머신러닝
  • 빅데이터
  • pandas
  • 빅데이터분석기사
보리과자 댓글 1 좋아요 0 조회수 77

메타태그 삽입 자동화

해결됨

직장인에게 꼭 필요한 파이썬-아래아한글 자동화 레시피

일코님 안녕하세요. 한글에서 메타 태그를 활용해 보려고 합니다. 문서 정보에서 태그 넣기 자동화 할 수 있는 방법이 있을까요?

  • python
  • 한컴오피스
kun 댓글 1 좋아요 0 조회수 222

작업형2 모의문제2

해결됨

[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)

노트북 빈칸으로 먼저 문제를 풀이하는 중에 결측값 처리를 행을 삭제하는 방식으로 처리하였습니다. 맨 마지막 y_test와 r2계수를 구하는 과정에서 삭제된 행만큼의 데이터가 맞지 않아 오류가 났는데 실제 실기 시험에서도 결측치가 있는 행을 삭제하면 안되는 것인가요?? 결측치는 반드시 다른 값으로 대체 해야 하는 것 인가요?

  • python
  • 머신러닝
  • 빅데이터
  • pandas
  • 빅데이터분석기사
hara0203 댓글 1 좋아요 0 조회수 68

제 에디터에선 notepad가 안나와요

미해결

Next.js 완벽 마스터 (v15): 노션 기반 개발자 블로그 만들기 (with 커서AI)

저는 왜 notepad가 안뜰까요?

  • react
  • 블로그
  • next.js
  • cursor
  • cursorai
타겟토 댓글 2 좋아요 0 조회수 244

작업형 2번 관련 질문드립니다.

해결됨

[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)

학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! 질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요 먼저 유사한 질문이 있었는지 검색해보세요 안녕하세요 작업형2번 문제를 풀때 라벨인코딩하기 전이 정확도가 더 높으면 라벨인코딩이랑 one-hot 인코딩하기 전 baseline만 처리 한 후에 결과물을 제출하면되는걸까요? 실제 시험에서도 baseline만 처리하고 다른 라벨링을 안해도 되는지 문의드립니다!

  • python
  • 머신러닝
  • 빅데이터
  • pandas
  • 빅데이터분석기사
hi 댓글 2 좋아요 0 조회수 85

서버/클라이언트 컴포넌트를 나누는 기준이 궁금합니다.

미해결

Next.js 완벽 마스터 (v15): 노션 기반 개발자 블로그 만들기 (with 커서AI)

안녕하세요! 학습 중, 궁금한게 있어 질문 드립니다! 이번 무한 스크롤 과정에서는 클라이언트 컴포넌트가 사용되었는데, 순수 서버 컴포넌트로는 개발하기는 거의 불가능에 가깝다고 느껴졌습니다. 가정을 하면, "사용자의 동작 혹은 이벤트에 따라서 랜더링 요소가 변경되어야 한다" 면, 클라이언트 컴포넌트를 거의 사용해야 될 것 같다라고 생각이 됩니다. 이러한 케이스가 아니라면, 대부분 서버 컴포넌트로 하는것이 좋다(?) 라고 느껴집니다. 보안성...? 응답 성능적으로도, SEO 관점으로도... 혹시 위의 내용이 틀리거나, 또 다르게 판단을 해야될 기준? 같은게 있을까요?

  • react
  • 블로그
  • next.js
  • cursor
  • cursorai
BeakGwa 댓글 2 좋아요 0 조회수 152

빅분기 실기 제3유형 점수배분

해결됨

[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)

빅분기 실기 제3유형 점수배분 문의드립니다. 제가 알기로는 제3유형이 30점인데 1-1, 1-2, 1-3 이렇게 있으면 각 1문제당 5점씩으로 반영되나요? 확인 해주시면 감사하겠습니다.

  • python
  • 머신러닝
  • 빅데이터
  • pandas
  • 빅데이터분석기사
wlysh999 댓글 2 좋아요 0 조회수 322

4주차 숙제 질문

해결됨

38군데 합격 비법, 2026 코딩테스트 필수 알고리즘

4-9 숙제 질문 안녕하세요! 청소 관련 문제에서 아래처럼 했는데 무한루프에 빠집니다.. 어디가 잘못된건지 모르겠어서 질문드려요! 감사합니다! def get_count_of_departments_cleaned_by_robot_vacuum(r, c, d, room_map): r_real = r c_real = c dr = [-1,0,1,0] dc = [0,1,0,-1] d_real = d count = 1 room_map[r][c] = 2 while True : stop = 0 while stop < 4: for i in range(4): d_real = (d_real+3)%4 r_fake = r_real + dr[d_real] c_fake = c_real + dc[d_real] if room_map[r_fake][c_fake] == 0 : count +=1 r_real = r_fake c_real = c_fake room_map[r_fake][c_fake] = 2 stop = 0 break else: stop += 1 d_real = (d_real+6)%4 r_real = r_real + dr[d_real] c_real = c_real + dc[d_real] if room_map[r_real][c_real] == 1: break return count

  • python
  • 코딩-테스트
  • 알고리즘
  • data-structure
snoapple3 댓글 1 좋아요 0 조회수 119

print 에러 질문드립니다

미해결

[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)

강의와 동일한 코드에서 이렇게 에러가 발생하는데 원인 알 수 있을까요? . 이 아니라 , 로 제대로 입력하고 아무리 해봐도 에러가 납니다. 혹시나 해서 print(a)로 해봐도 동일합니다

  • python
  • 머신러닝
  • 빅데이터
  • pandas
  • 빅데이터분석기사
buzil12 댓글 2 좋아요 0 조회수 77

listbox 예제 관련

해결됨

[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)

안녕하세요 listbox 예제 관련해서 마지막 앞 단어 할 때 listbox[-2]만 해도 나오는데 이렇게 해도 상관없을까요?

  • python
  • 머신러닝
  • 빅데이터
  • pandas
  • 빅데이터분석기사
수석 댓글 2 좋아요 0 조회수 77

7회 작업형3 문제 1-3 질문

해결됨

[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)

문제에는 gender가 1인 확률이라고 명시하지 않았는데 왜 model.predict(test)<0.5하면 왜 틀리나요?

  • python
  • 머신러닝
  • 빅데이터
  • pandas
  • 빅데이터분석기사
김대현 댓글 2 좋아요 0 조회수 75

스크랩핑 실습 중 Mac OS 인증서 문제

미해결

우리를 위한 프로그래밍 : 파이썬 중급 (Inflearn Original)

asyncIO 스크랩핑 실습 중 macOS에서 SSL인증서 문제로 인해 추가적으로 인증서 설치 등을 진행해야 하더라구요. 아래와 같이 수정하여, 코드 실행에는 문제가 없었는데 비동기 예제이다보니 추가적으로 선언한 get_request를 사용 시 동기화 문제에서 자유로운지 궁금합니다. 제가 한 것은 아래와 같이 SSL 인증서 설치 (Python 3.13 ver) /Applications/Python\ 3.13/Install\ Certificates.command 일부 코드 수정 import ssl import certifi # 인증서 설정 ssl_context = ssl.create_default_context(cafile=cerfiti.where()) # 추가적으로 추가한 함수 def get_request(url): headers = {'User-Agent' : 'Mozila/5.0'} req = Request(url, headers=headers) return urlopen(req, context=ssl_context) async def fetch(url, executor): res = await loop.run_in_executor(executor, lambda: get_request(rul)) return res.read()

  • python
  • django
육칠팔구십 댓글 1 좋아요 0 조회수 150

logit()안에 들어가는 독립변수 관련 질문

해결됨

[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)

7회 작업형 3문제를 보면 glm('종소변수 ~ 독립변수1 + 독립변수2 + 독립변수3', data=df).fit() 이런식으로 작성하던데 분산분석에서는 ols('종속변수 ~ 독립변수1*독립변수2') 이렇게 하던데 어떨 때 독립변수를 +만 하는지, 어떨 때 독립변수를 *하는지 헷갈립니다.

  • python
  • 머신러닝
  • 빅데이터
  • pandas
  • 빅데이터분석기사
김대현 댓글 2 좋아요 0 조회수 72

기출6회 제2유형

해결됨

[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)

아래 문제해설을 보니 pred = rf.predict(X_val) 로 반영 pred = rf.predict(test) 로 반영해도 문제없나요? # 랜덤포레스트 from sklearn.ensemble import RandomForestClassifier rf = RandomForestClassifier(random_state=0) rf.fit(X_tr, y_tr) pred = rf.predict(X_val) f1_score(y_val, pred, average='macro')

  • python
  • 머신러닝
  • 빅데이터
  • pandas
  • 빅데이터분석기사
wlysh999 댓글 2 좋아요 0 조회수 97

4회기출, 제2유형

해결됨

[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)

안녕하세요. 마지막에 저희 행/열 확인하잖아요. 거기에서 2154 , 1이 나오는데 답변 행 : 2154 test 행 : 2154 동일하다는 걸 검증하는거죠? <class 'pandas.core.frame.DataFrame'> RangeIndex: 2154 entries, 0 to 2153 Data columns (total 10 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 ID 2154 non-null int64 1 Gender 2154 non-null object 2 Ever_Married 2154 non-null object 3 Age 2154 non-null int64 4 Graduated 2154 non-null object 5 Profession 2154 non-null object 6 Work_Experience 2154 non-null float64 7 Spending_Score 2154 non-null object 8 Family_Size 2154 non-null float64 9 Var_1 2154 non-null object dtypes: float64(2), int64(2), object(6) memory usage: 168.4+ KB ID pred 0 458989 2 1 458994 3 2 459000 3 3 459003 3 4 459005 1 ... ... ... 2149 467950 4 2150 467954 4 2151 467958 2 2152 467961 2 2153 467968 4 [2154 rows x 2 columns]

  • python
  • 머신러닝
  • 빅데이터
  • pandas
  • 빅데이터분석기사
wlysh999 댓글 2 좋아요 0 조회수 59

제2회 기출, 제2유형

미해결

[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)

안녕하세요. 제2회 기출, 제2유형 아래와같이 풀어봤는데 확인 부탁드립니다. 랜포활용 검증안함 검증은 어차피 시험에 반영안되고, 랜포밖에 할 줄 몰라서 이것만 암기했어요. 도저히 다른거 풀 자신이 없어서 시험 제2유형의 모든문제는 아래 패턴으로 진행하려합니다. 혹시 이렇게 진행해도되는지 문의드립니다. # 데이터 불러오기 import pandas as pd test = pd.read_csv("X_test.csv") train = pd.read_csv("X_train.csv") y_train = pd.read_csv("y_train.csv") X_train.shape, y_train.shape, X_test.shape # train.info() # test.info() # y_train.info() target = y_train.pop('Reached.on.Time_Y.N') train = pd.get_dummies(train) test = pd.get_dummies(test) train, test = train.align(test, join='left', axis = 1) 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 rf = RandomForestClassifier(random_state = 0) rf.fit(x_tr, y_tr) pred = rf.predict_proba(test) test_ID = test.pop('ID') submit = pd.DataFrame({'ID' : test_ID, 'Reached.on.Time_Y.N' : pred[:,1]}) submit.to_csv('result.csv', index=False)

  • python
  • 머신러닝
  • 빅데이터
  • pandas
  • 빅데이터분석기사
wlysh999 댓글 1 좋아요 0 조회수 77

2회기출, 제2유형

해결됨

[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)

기출2회, 제2유형의 해설 관련 저는 아래 랜포사용해서 진행했는데, 아래와 같이 predic_proba 사용했으므로 1차원 배열로 바꿔줘야하나요? DataFrame 'pred' : pred[:,1] 해줘야 1차원으로 변경되는지 문의드립니다. from sklearn.ensemble import RandomForestClassifier rf = RandomForestClassifier(random_state = 0) rf.fit(x_tr, y_tr) pred = rf.predict_proba(test) test_ID = test.pop('ID') submit = pd.DataFrame({'ID' : test_ID, 'Reached.on.Time_Y.N' : pred[:,1]}) submit.to_csv('result.csv', index=False) # 랜덤포레스트 model = RandomForestClassifier(random_state=2022) model.fit(X_tr, y_tr) pred = model.predict_proba(X_val) print(roc_auc_score(y_val, pred[:,1]))

  • python
  • 머신러닝
  • 빅데이터
  • pandas
  • 빅데이터분석기사
wlysh999 댓글 2 좋아요 0 조회수 77

[30-01] 웹 에디터와 폼 라이브러리

해결됨

[코드캠프] 부트캠프에서 만든 '완벽한' 프론트엔드 코스

안녕하세요 해당수업중 강의 내용대로 했는데 실행시 아래와 같이 에러 뜨고 정상 실행이 안됩니다. TypeError: react_dom_1.default.findDOMNode is not a function at ReactQuill.getEditingArea ( http://localhost:3000/_next/static/chunks/node_modules_5754136c._.js:16760:43 ) at ReactQuill.instantiateEditor ( http://localhost:3000/_next/static/chunks/node_modules_5754136c._.js:16631:50 ) at ReactQuill.componentDidMount ( http://localhost:3000/_next/static/chunks/node_modules_5754136c._.js:16590:14 ) at LoadableComponent ( http://localhost:3000/_next/static/chunks/_2df4111c._.js:296:57 ) at WebEditorPage ( http://localhost:3000/_next/static/chunks/_2df4111c._.js:81:215 ) at ClientPageRoot ( http://localhost:3000/_next/static/chunks/node_modules_next_dist_1a6ee436._.js:2053:50 )

  • react
  • react-native
  • 하이브리드-앱
  • graphql
  • next.js
Lia 댓글 3 좋아요 0 조회수 223

requests 관련 질문

미해결

[신규 개정판] 이것이 진짜 크롤링이다 - 기본편

25년 5월 시점에서 하다보니깐, requests 강의를 들을때 클래스 파싱 하는 과정이 작동이 안되서 확인해보니, requests는 javascript 로 만들어진 동적 내용을 긁을 수 없다고 하더라구요. 그래서 selenium의 webdriver를 사용했는데, 작동은 되는데 불편한 점이 각 실행시마다 크롬 창이 떠요. 혹시 javascript도 requests로 파싱할 수 있는 방법 이 있을까요?

  • python
  • 웹-크롤링
최다니엘 댓글 2 좋아요 1 조회수 170

api폴더 하위의 api.ts들은 언제사용하나요?

해결됨

한 입 크기로 잘라먹는 Next.js

백엔드서버와 통신할 때, service폴더를 만들고 하위에 api 정리를 자주 하였는데요,(fetch, axios instance등) 현재 강의에서 언급하고있는 이 api폴더는 next로 풀스택 개발외에는 딱히 사용되지 않는편인가요?

  • react
  • typescript
  • next.js
  • api
이윤재입니다. 댓글 1 좋아요 0 조회수 192

인기 태그

인프런 TOP Writers

주간 인기글