작업형1 모의문제 3 문제7번
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
인덱스 값이 2001인 데이터(행)을 선택할 때 df.loc[2001] df.loc[2001].mean() loc 대신 df.iloc[1,:].mean() 위처럼 iloc 함수를 사용해도 되나요?
- python
- 머신러닝
- 빅데이터
- pandas
- 빅데이터분석기사
172만명의 커뮤니티!! 함께 토론해봐요.
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
인덱스 값이 2001인 데이터(행)을 선택할 때 df.loc[2001] df.loc[2001].mean() loc 대신 df.iloc[1,:].mean() 위처럼 iloc 함수를 사용해도 되나요?
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! 질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요 먼저 유사한 질문이 있었는지 검색해보세 위와 같이 실행했는데 baseline roc_auc가 높게 나옵니다 그리고 y_test 실행결과 label과 점수가 비슷합니다. 어떤 이유일때문일까요?
미해결
Flutter 중급 2편 - 실전 앱 개발 - 미국 주식 앱 (with 클린 아키텍처)
이전 강의에서 freezed 3.0 변경점으로 default 사용시 일반 생성자 초기화하듯 사용하는 방법으로 진행해도 된다고 하셨는데 @JsonKey 사용법도 기존 생성자 작성과 동일하기 하고 아래 *참고소스1과 동일하게 진행해도 되는지 문의드립니다. 참고소스1 import 'package:freezed_annotation/freezed_annotation.dart'; part 'company_info_dto.freezed.dart'; part 'company_info_dto.g.dart'; // ignore_for_file: annotate_overrides @freezed @JsonSerializable() class CompanyInfoDto with _$CompanyInfoDto { @JsonKey(name: 'Symbol') final String? symbol; @JsonKey(name: 'Name') final String? name; @JsonKey(name: 'Description') final String? description; @JsonKey(name: 'Industry') final String? country; @JsonKey(name: 'Country') final String? industry; const CompanyInfoDto({ this.symbol, this.name, this.description, this.industry, this.country, }); factory CompanyInfoDto.fromJson(Map<String, dynamic> json) => _$CompanyInfoDtoFromJson(json); Map<String, dynamic> toJson() => _$CompanyInfoDtoToJson(this); } - 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
선생님 9회 기출유형 원본파일은 깃허브상에 없던데 업데이트 예정인가요?
미해결
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
강의를 보면서 강사님과 똑같이 진행을 하는데 값이 다릅니다. 그리고 영상에서는 max_depth를 설정했을 때가 설정하지 않았을 때 보다 값이 더 올라갔는데 저 같은 경우는 설정한 후 값이 더 내려갔습니다. 정상적인 건가요? #rf from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import roc_auc_score, f1_score, accuracy_score rf = RandomForestClassifier(random_state=2025,max_depth=3) rf.fit(X_tr,y_tr) pred = rf.predict(X_val) pred_proba = rf.predict_proba(X_val) print(roc_auc_score(y_val,pred_proba[:,1])) print(f1_score(y_val,pred)) print(accuracy_score(y_val,pred)) # 0.9227272727272727 # 0.8571428571428571 # 0.8378378378378378 # max_depth = 3 # 0.9242424242424243 # 0.8 # 0.7837837837837838
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
roc_auc_score, f1_score, accuracy_score를 구할때 print문의 y_val,pred를 넣는데 왜 저 2가지를 넣는건가요? 그리고 proba는 뭔가요? print(roc_auc_score(y_val,pred_proba[:,1])) print(f1_score(y_val,pred)) print(accuracy_score(y_val,pred))
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
<모델&평가>에서 fit(학습)을 시킬때는 왜 X_tr,y_tr을 넣고 예측을 할때는 왜 X_val를 넣나요 ? 그냥 아무거나 넣어도 되나요 ? #rf from sklearn.ensemble import RandomForestClassifier rf = RandomForestClassifier(random_state=2025) rf.fit(X_tr,y_tr) pred = rf.predict(X_val)
미해결
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
교재도 같이보고있는데요 교재 p.164쪽 'type1_data1.csv'파일은어디에 있나요? (교재 작업형 1 연습문제 파일 어디서 다운받나요?)
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
<데이터 전처리 &피처엔지니어링>에서 왜 id를 drop 하나요? 그리고 <검증 데이터 분리>에서 는 왜 output을 drop 하나요? train = train.drop('id',axis=1) test_id = test.pop('id') test.head() 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=2025)
미해결
[플러터플로우] 실전! 앱 출시를 위한 끝장 노하우!
안녕하세요! 카카오 로그인 강의를 보고 많은 도움을 받은 개발자 입니다! 현재 플러터 플로우에서 기본으로 제공하는 구글 로그인은 구현을 완료하였습니다. 다만 구글에서 제공되는 기본 사용자정보에서 제가 개발하는 앱에서는 성별,출생연도 등을 추가로 받아오고 싶은데, 구글 클라우드에서 Oauth 동의화면이 안들어가지네요... 혹시 구글 oauth로그인으로 추가 사용자 정보를 받아오려면 봐야하는 문서나 정보가 있으시면 알려주시면 감사하겠습니다!
미해결
[개정판] 파이썬 머신러닝 완벽 가이드
알파값을 릿지는 0.05,0.1,1,5,8,10,12,15,20 라소는 0.001,0.005------ 이렇게 잡는 이유와 기준이 무엇인지? 그냥 경험치인건지
미해결
[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
코드팩토리 디스코드에 질문하면 더욱 빠르게 질문을 받아 볼 수 있습니다! [코드팩토리 디스코드] https://bit.ly/3HzRzUM geolocator 가 import 가 안되는데 어떡하죠? 오류는 아래와 같이 나오구요. Target of URI doesn't exist: 'package:geolocator/geolocator.dart'. 소스는 아래와 같습니다. import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:geolocator/geolocator.dart'; class HomeScreen extends StatefulWidget { const HomeScreen({super.key}); @override State<HomeScreen> createState() => _HomeScreenState(); } class _HomeScreenState extends State<HomeScreen> { final CameraPosition initialPosition = CameraPosition( target: LatLng( 37.5214, 126.9246 ), zoom: 15, ); checkPermission() async{ final isLocationEnabled = await Geolocator.isLocationServiceEnabled(); } @override Widget build(BuildContext context) { return Scaffold( body: Column( children: [Expanded(child: GoogleMap(initialCameraPosition: initialPosition))], ), ); } } pubspec.yaml 은 아래와 같이 되어 있습니다. name: chool_check description: "A new Flutter project." # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 # followed by an optional build number separated by a +. # Both the version and the builder number may be overridden in flutter # build by specifying --build-name and --build-number, respectively. # In Android, build-name is used as versionName while build-number used as versionCode. # Read more about Android versioning at https://developer.android.com/studio/publish/versioning # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. version: 1.0.0+1 environment: sdk: ^3.7.2 # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions # consider running `flutter pub upgrade --major-versions`. Alternatively, # dependencies can be manually updated by changing the version numbers below to # the latest version available on pub.dev. To see which dependencies have newer # versions available, run `flutter pub outdated`. dependencies: flutter: sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.8 google_maps_flutter: ^2.6.0 geolocator: ^14.0.0 dev_dependencies: flutter_test: sdk: flutter # The "flutter_lints" package below contains a set of recommended lints to # encourage good coding practices. The lint set provided by the package is # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. flutter_lints: ^5.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter packages. flutter: # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. uses-material-design: true # To add assets to your application, add an assets section, like this: # assets: # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/to/resolution-aware-images # For details regarding adding assets from package dependencies, see # https://flutter.dev/to/asset-from-package # To add custom fonts to your application, add a fonts section here, # in this "flutter" section. Each entry in this list should have a # "family" key with the font family name, and a "fonts" key with a # list giving the asset and other descriptors for the font. For # example: # fonts: # - family: Schyler # fonts: # - asset: fonts/Schyler-Regular.ttf # - asset: fonts/Schyler-Italic.ttf # style: italic # - family: Trajan Pro # fonts: # - asset: fonts/TrajanPro.ttf # - asset: fonts/TrajanPro_Bold.ttf # weight: 700 # # For details regarding fonts from package dependencies, # see https://flutter.dev/to/font-from-package
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
# your code import pandas as pd df = pd.read_csv("members.csv") df.head() #views 컬럼에 결측치가 있는 데이터(행)을 삭제하고 df.isnull().sum() #views에 결측치 4개 # print(df.shape) df = df.dropna(subset = ['views']) # print(df.shape) #f3 컬럼의 결측치는 0, silver는 1, gold는 2, vip는 3 으로 변환한 후 총 합을 정수형으로 출력하시오 df['f3'] = df['f3'].fillna(0) df['f3'] = df['f3'].replace('silver', 1) df['f3'] = df['f3'].replace('gold', 2) df['f3'] = df['f3'].replace('vip', 3) # print(df.head(20)) print(int(df['f3'].sum())) numpy 안 쓰고 이렇게 작성해도 되나요?
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
3사분위수 - 1사분위 수 값을 구할 때 선생님 처럼 r2, r1 변수 안 만들고 df = df[:int(len(df) * 0.7)] #70% 데이터 선택 IOQ = df['views'].quantile(.75) - df['views'].quantile(.25) print(IOQ) 이렇게 구해도 되나요?
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
제가 푼 내용을 보면 pred = rf.predict(test) : 질문자 pred = rf.predict(x_val) : 해설 위 두가지가 다릅니다. 해당 건 때문에 pred 했을 때, 값 차이가 많이 나는건가요? ㅜ_ㅠ 챗gpt에 물어보니 어떨때는 test고 어떨대는 x_val인지 아직도 모르겠습니다. # 라이브러리 및 데이터 불러오기 import pandas as pd train = pd.read_csv("https://raw.githubusercontent.com/lovedlim/inf/refs/heads/main/p4/8_2/churn_train.csv") test = pd.read_csv("https://raw.githubusercontent.com/lovedlim/inf/refs/heads/main/p4/8_2/churn_test.csv") # train.info() # test.info() target = train.pop('TotalCharges') 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 RandomForestRegressor rf = RandomForestRegressor(random_state=0) rf.fit(x_tr, y_tr) pred = rf.predict(test) submit = pd.DataFrame({'pred' : pred}) submit.to_csv('result.csv', index=False) ans = pd.read_csv('result.csv') print(ans)
미해결
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
'age' 컬럼의 이상치(소수점 나이와 음수나이, 0포함)를 제거하고 제거 전 후의 views 컬럼 표준편차를 더하시오 (최종 결과 값은 소수 둘째자리까지 출력, 셋째자리에서 반올림) 제가 생각한 이상치 제거는 1. 사분위수를 이용해서 1차적으로 이상치를 제거하고 1번을 통해 필터링 된 데이터에서 0, 음수, 소수 데이터를 제거 라고 생각했는데 아닌가요? 답은 우연인지 의도인지 둘다 8420.69 이 나오긴 했습니다 import pandas as pd df = pd.read _csv( " https://raw.githubusercontent.com/lovedlim/inf/main/p1/members.csv " ) bef = df[ 'views' ].std() #1 #0, 음수 제거 -> 소수 제거 # opt6_1 = df['age'] <= 0 # df= df[~opt6_1] # opt6_2 = df['age'] % 1 == 0 # df = df[opt6_2] # aft = df['views'].std() # print(round(bef+aft, 2)) ###### 8420.69 출력 #2 # 이상치 제거 -> 0,음수 제거 -> 소수제거 Q1 = df[ 'age' ].quantile( 0.25 ) Q3 = df[ 'age' ].quantile( 0.75 ) IQR = Q3 - Q1 cond1 = df[ 'age' ] > Q3 + ( 1.5 * IQR) df = df[~cond1] cond2 = df[ 'age' ] < Q1 - ( 1.5 * IQR) df = df[~cond2] cond3 = df[ 'age' ] <= 0 df = df[~cond3] cond4 = df[ 'age' ] % 1 == 0 df = df[cond4] aft = df[ 'views' ].std() print ( round (aft + bef, 2 )) ###### 8420.69 출력
해결됨
[AI] 프롬프트만으로 아이디어 구현하기_바이브코딩 입문
아래 질문 대댓글로 올렸는데, 잘 못보실것같아 이곳에 정식으로 올립니다. 모든 프로그램 설치 후, 재부팅, 커서 재실행등은 다 해봤습니다. ============================= 처음 코드를 만들고 gtts에서 에러가 나네요. 선생님의 코드 요청과 똑같이 요청을 했고, 그래서 아래와 같은 코드가 생성되었습니다. 그래서 pip install -r requirements.txt 를 터미널에 입력 시켜주었으며 위와 같이 제대로 설치가 된것 같습니다. requirements.txt 내용 -> gTTS==2.3.2 그랬는데 아래와 같이 Python cmd창에서 에러가 납니다. (대소문자 에러인줄알고 그마저도 고쳤는데도) gtts가 설치가 된것 같은데 왜 불러오질 못하는지 모르겠네요 ㅠㅠ(참고로 코알못입니다) 커서도 여러번 껐다가 재실행했는데도 꼭 저러네요.. 이것저것 만져보기도 겁다고한데... 해결 방법 좀 알려주시면 감사하겠습니다.! ======= 혹시 추가 정보가 필요하신게 있으면 알려주시면 바로 확인해서 올리겠습니다.
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
len함수로 세서 나누기 2를 하는 코드로 알려주셨는데 len(df)*0.5) 이렇게 작성해도 될까요?
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
시험환경에서는 문제가 최소 최대 척도인데 강의에서 보이는 문제랑 다른데요.. 제가 잘 못들어간 것일까요?
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
풀이과정에서 iloc로 views가 세번째로 큰 도시를 출력해내는데 실제 시험에서는 정답만 기입하면 되는데 혹시 iloc로 구하지않고 육안으로 답을 알아보면 굳이 저렇게 까지 진행하지 않아도 될까요? 아니면 출력하는 마지막 코드까지 완성을 해둬야 하는걸까요?