전체 글 - Table of Contents332

One-Hot encoding ≫ ML 데이터 전처리 part에서 model이 이해할 수 있는 data로 변환하기 위해 여러 encoding 기법들이 적용된다고 하였고, 오늘은 그 중 하나인 'One-Hot encoding' 기법에 대해서 배우려고 한다 intro. Machine Learning 1. 개론 → ML은 빅데이터를 분석할 수 있는 강력한 tool의 일종이다. 기존 통계학 및 시각화로는 해결할 수 없는 한계를 보완함! 👏 데이터를 기반으로 앞으로의 미래를 예측하는 기법 👋 주어진 sh-avid-learner.tistory.com concepts 'One hot encoding can be defined as the essential process of converting the categorical data variable.. Machine Learning/Fundamentals 2022. 4. 17.
Cross-Validation (concepts + w/code) * 머신러닝을 위해서 무.조.건. 알아야 하는 CROSS-VALIDATION! 간단히 개념만 알아보ZA * * concepts> - 2번 과정 - model selection에서 주로 많이 쓰이는 cross-validation 기법 - 🧐 PURPOSE? 'The purpose of cross–validation is to test the ability of a machine learning model to predict new data. Q. 그러면 CV(Cross-Validation)에서는 무엇을 가지고 여러 모델의 성능을 평가할 수 있을까? A. 두 가지 필요 - train data & test data (from the dataset) 1) estimate the parameters for ML .. Machine Learning/Fundamentals 2022. 4. 17.
Overfitting/Underfitting & Bias/Variance Tradeoff 1. 일반화(generalization) "In machine learning, generalization is a definition to demonstrate how well is a trained model to classify or forecast unseen data. Training a generalized machine learning model means, in general, it works for all subset of unseen data. An example is when we train a model to classify between dogs and cats. If the model is provided with dogs images dataset with only two br.. Machine Learning/Fundamentals 2022. 4. 17.
All About Evaluation Metrics(1/2) → MSE, MAE, RMSE, R^2 ** ML 모델의 성능을 최종적으로 평가할 때 다양한 evaluation metrics를 사용할 수 있다고 했음! ** (supervised learning - regression problem에서 많이 쓰이는 평가지표들) - 과정 (5) - 😙 그러면 차근차근! 각 평가지표에 대해서 자세히 알아보려고 함! 😙 - ①MSE ②MAE ③RMSE ④R-Squared - 1. MSE(Mean-Squared Error) 🤔 linear regression model concept에 대해서 배울 때 관측치와 예측치의 차이들의 합인 SSE를 최소로 하는 'least squares method'를 기반으로 선형회귀모델을 결정한다고 배웠다 ≫ 이 SSE를 전체 데이터 개수 n으로 나눈 값, 즉 '관측치와 예측치의 차이.. Machine Learning/Fundamentals 2022. 4. 16.
Simple Linear Regression Model (w/scikit-learn) ** 저번 포스팅에서 단순선형회귀 '개념'에 대해 자세히 공부했었다! 😚 Simple Linear Regression (concepts) ** 우리는 저번시간에 Supervised Learning - Regression - Linear Regression까지 concepts에 대해 배웠다 (↓↓↓↓↓↓ 하단 포스팅 참조 ↓↓↓↓↓↓) ML Supervised Learning → Regression → Linear Regr.. sh-avid-learner.tistory.com ** 이젠 직접 scikit-learn을 사용하여 직접 단순선형회귀모델을 만들어보자. 코드구현! 1. - feature matrix & label vector - 👆 먼저 scikit-learn library를 활용한 모델에 집어넣기.. Machine Learning/Models (with codes) 2022. 4. 16.
intro. Machine Learning 1. 개론 → ML은 빅데이터를 분석할 수 있는 강력한 tool의 일종이다. 기존 통계학 및 시각화로는 해결할 수 없는 한계를 보완함! 👏 데이터를 기반으로 앞으로의 미래를 예측하는 기법 👋 주어진 데이터가 있으면 이 데이터의 패턴을 파악 🖐 주어진 데이터를 활용한 추천 시스템 개발! → 위 세 가지의 여러 활동들을 ML을 통해서 구현할 수 있다. 기계가 이런 활동을 알아서 학습하게끔 스스로 그런 능력을 갖게 하는 것! → ①지도학습은 정답이 주어져있고, ②비지도학습은 정답이 주어져 있지 않다. → ③강화학습을 통해 기계가 스스로 학습이 가능하게 함. (학습을 수행하기 위한 데이터 x - 알아서 데이터를 생성) 2. ML을 위한 data (+EDA) 간단 정리 즉, data type을 자세히 위와 같이 .. Machine Learning/Fundamentals 2022. 4. 15.
descriptive statistics & inferential statistics statistics 통계학을 배운다면 반드시(?) 구분해서 알아야 할 '기술통계치' & '추론통계치'!! 1. descriptive statistics(기술통계치) 'summarizes the characteristic of a data set' ≫ 주어진 data를 'descriptive(묘사하는) 관련 통계수치'라고 뜻하는 걸로 data를 설명하는 통계치들을 뜻함! ≫ 다시 크게 두 가지로 나눌 수 있는데, 1> 수집한 data를 집중적으로 나타내 주는 평균, 중앙값, 최빈값 등인 '데이터 집중화' → central tendency 2> 수집한 data가 어느 정도 퍼져 있는 지를 나타내 주는 '분산도'로 표준편차, 사분위 등이 있다. → variability ≫ 우리가 저번에 배운 box plot .. Statistics/Concepts(+codes) 2022. 4. 15.
<추정과 검정> - 점 & 구간 추정 - confidence interval (w/python code) 1. 개요 → 모수 θ의 추정에 사용되는 통계량을 θ의 추정량(θhat으로 표기)이라고 함 → 추정을 목적으로 하는 표본통계량 모수(θ) 👉 추정량(=표본통계량; θhat) - 추정치(관찰값) Q) 그렇다면 모수를 추정하는 방법은? 1> 점추정(point estimation) = 하나의 모수를 '한 개의 값'으로 추정 2> 구간추정(interval estimation) = '모수가 포함되리라 기대되는 구간으로 모수 추정' (점추정을 보완한 것) ※ 점 추정은 표본정보를 하나의 값으로 요약하여 모수를 추정하지만, 구간 추정은 모수가 포함될 것으로 예상되는 구간을 이용하여 모수 추정 → 점추정을 하면 얼마만큼의 신뢰도로 해당 모수를 추정해서 맞힐 수 있는 지 모르기에 구간추정을 통해 점추정의 한계를 보완 2.. Statistics/Concepts(+codes) 2022. 4. 15.
pandas Tricks_12👉🏻 'pivot_table()' (Kevin by DataSchool) 👆 tidy data 포스팅에서 우리는 tidy한 data를 만들기 위해 기존 dataframe을 melt한다고 하였고, 다시 원위치 시키기 위해 pivot_table()을 활용한다고 배웠다. Python/Pandas&Numpy 2022. 4. 14.
pandas Tricks_11👉🏻 'Reshaping → stack() & unstack()' (Kevin by DataSchool) Q. 데이터를 재구조화하는 방법? A. stack() & unstack() 사용! 🙂 ¶ stack() docu https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.stack.html DataFrame.stack(level=- 1, dropna=True) 'Stack the prescribed level(s) from columns to index. Return a reshaped DataFrame or Series having a multi-level index with one or more new inner-most levels compared to the current DataFrame. The new inner-most levels are.. Python/Pandas&Numpy 2022. 4. 14.
Simple Linear Regression (concepts) ** 우리는 저번시간에 Supervised Learning - Regression - Linear Regression까지 concepts에 대해 배웠다 (↓↓↓↓↓↓ 하단 포스팅 참조 ↓↓↓↓↓↓) ML Supervised Learning → Regression → Linear Regression 1. ML 기법 구분 💆🏽‍♂️ 답이 주어져 있는 Supervised Learning 🙅🏽 답이 주어져 있지 않은 UnSupervised Learning → Simple Linear Regression(단순선형회귀)은 답이 주어져 있는 Dependent variable & In.. sh-avid-learner.tistory.com 1. HOW? - Simple Linear Regression (step-by-s.. Machine Learning/Models (with codes) 2022. 4. 14.
pandas Tricks_09&10👉🏻 'EXPANDING → a string & a series of lists - into a DF' (Kevin by DataSchool) 😌 dataframe내의 data를 자유자재로 나누어 갖다 붙이고, 들어 있는 게 list면 따로 뽑아내서 갖다 붙이고 싶다면..? → 즉, dataframe 자체를 자유자재로 추가 정보를 붙여 확대하고 싶을 때 사용! ← 1. EXPANDING(1) - splitting a string into MULTIPLE COLUMNS Q) column 내의 string 문자열을 일정 기준으로 나누어 기존 dataframe에 갖다 붙이고 싶으면? A) .column_name.str method를 활용하여 split 적용 → expand = True df = pd.DataFrame({'name': ['Ryan Murphy Kim', 'Jane Doe Rhondall'], 'location': ['Los Angele.. Python/Pandas&Numpy 2022. 4. 14.