프로그래밍
-
MongoDB 문제 예제 1데이터베이스/MongoDB 2023. 12. 14. 14:58
/* 1. test1DB의 Student 컬렉션에서 name: 'Greg Powell', _id 포함, Score 제외하는 결과 출력 */ db.Student.find({name:'Greg Powell'}, {_id:true, score:false}); /* 출력 */ { _id: ObjectId("65558957872dd38face7b3b6"), name: 'Greg Powell', email: 'greg powell@fake-mail.com', version: 1, scores: [ 65, 75, 80 ], dateCreated: 1999-02-10T00:00:00.000Z } /* 2. student_id, type과 score를 갖는 임의의 5개 document를 json 파일로 작성 후 'tes..
-
-
머신러닝 프로젝트머신러닝 2023. 12. 5. 17:20
1. 큰 그림 보기(목적 파악: 뭘 위해서 데이터를 찾는 것인지) 2. 데이터 구하기 3. 데이터로부터 인사이트를 얻기 위해 탐색, 시각화 4. 머신러닝 알고리즘을 위해 데이터 준비 5. 모델을 선택하고 훈련시키기 6. 모델을 미세 튜닝 7. 솔루션 제시 8. 시스템을 론칭하고, 모니터링하고, 유지 보수 실제 데이터로 작업 · 유명한 공개 데이터 저장소 - OpenML(https://openml.org) - 캐글(https://kaggle.com/datasets) - PapersWithCode(https://paperswithcode.com/datasets) - UC 어바인 머신러닝 저장소(https://archive.ics.uci.edu/ml) - 아마존 AWS 데이터셋(https://registry...
-
-
그래프와 시각화Python 2023. 11. 28. 17:19
맷플롯립 API 간단하게 살펴보기 주피터 노트북 환경에서 %matplotlib notebook 실행한 다음(IPYTHON인 경우 %matplotlib) 간단한 그래프 그리기 In [3]: import matplotlib.pyplot as plt In [4]: %matplotlib Installed qt5 event loop hook. Shell is already running a gui event loop for qt5. Call with no arguments to disable the current loop. Using matplotlib backend: QtAgg In [5]: data = np.arange(10) In [6]: data Out[6]: array([0, 1, 2, 3, 4, 5, ..
-
-
데이터 준비: 조인, 병합, 변형Python 2023. 11. 27. 17:12
계층적 색인 계층적인 색인(hierarchical indexing)은 축에 대해 둘 이상의 인덱스 단계를 지정할 수 있도록 함 > 고차원 데이터를 낮은 차원의 형식으로 다룰 수 있게 해주는 기능 In [43]: data = pd.Series(np.random.uniform(size=9), ...: index=[['a', 'a', 'a', 'b', 'b', 'c', 'c', 'd', 'd'], ...: [1, 2, 3, 1, 3, 1, 2, 2, 3]]) In [44]: data Out[44]: a 1 0.317961 2 0.034492 3 0.213850 b 1 0.604714 3 0.786766 c 1 0.564637 2 0.672718 d 2 0.159659 3 0.301101 dtype: float..
-
데이터 정제 및 준비Python 2023. 11. 21. 12:21
누락된 데이터 처리 float64 dtype을 가지는 데이터의 경우 판다스는 실숫값인 NaN으로 누락된 데이터 표시 이런 값을 감싯값(sentinel value)이라 부르며 누락된(혹은 null) 값임을 나타내기 위해 등장 In [24]: float_data = pd.Series([1.2, -3.5, np.nan, 0]) In [25]: float_data Out[25]: 0 1.2 1 -3.5 2 NaN 3 0.0 dtype: float64 # isna 메서드는 값이 null인 경우 True를 가지는 불리언 Series 반환 In [26]: float_data.isna() Out[26]: 0 False 1 False 2 True 3 False dtype: bool 파이썬의 내장 None 값 또한 NA ..