분류 전체보기
-
로지스틱회귀(Logistic_Linear_Regression)Math for data science 2019. 11. 21. 17:58
Classifier Logistic Regression(LR)은 대표적인 binary classification 알고리즘이다. 일단 회귀분석의 첫번째 목적은 일반회귀모델(Ordinary Linear Model : OLM)을 만드는 것이다. 일반회귀모델은 최소제곱법을 이용하여 가장 이상적인 직선을 만든다. 하지만! Logistic Regression(LR)은 그 회귀에다가 특정 x를 집어 넣었을 때 특정 y를 도출하는데 의미가 있다. 근데 그 결과값은 이항분포를 따르게 된다. 이항분포를 따른다는 것은 1이냐 0이냐에 관한 것. 즉 Classification이다. 예를 들어 사망 or 생존, 성공 or 실패 와 같이 두개로 나눠지는 것을 말한다. 그런데 만약 데이터의 분포가 이런식으로 구성돼 있다면 직선으로..
-
텍스트마이닝_pLSA란 무엇일까?Text Mining 2019. 11. 21. 13:42
pLSA pLSA는 probabilistic Latent Semantic Analysis의 준말이다. 그냥 딱 보면 LSA에 확률을 적용시킨 모델 같아 보인다. 그러나 pLSA는 LSA와는 연관이 없다. 아예 다른 algorithm이라 보면 된다. pLSA는 단어와 문서 사이를 잇는, 우리 눈에 보이지 않는 잠재구조가 있다는 가정 하에 단어와 문서 출현 확률을 모델링한 확률모형이다. 위 그림에서 d는 Document를 의미하고 z는 특정 주제,토픽(Latent Concepts)을 의미한다. w는 특정 단어를 의미한다. P(z|d)는 문서에서 특정 토픽이 나타날 확률이고, P(w|z)는 특정 토픽에서 특정 단어가 나타날 확률이다. Documents에서 위에서 네번째 문서는 TRADE라는 특정 토픽으로 나타..
-
텍스트마이닝_LSA란 무엇일까?Text Mining 2019. 11. 20. 21:49
LSA LSA는 Latent Semantic Analysis의 준말이다. 한글로 그대로 번역하면 잠재, 의미, 분석이다. 잠재되어 있는 의미를 찾아내 분석한다는 말인 것 같다. 잠재되어 있는 의미를 찾기 위해 LSA는 SVD를 사용한다. SVD는 따로 설명하지 않으므로 SVD 포스트를 먼저 읽고 이 글을 읽는 것이 좋을 것이다. SVD를 하게 되면 Singular Values가 생긴다. 이 특이 값의 크기에 따라 원래 행렬의 정보량이 결정된다. 그래서 값이 큰 몇 개의 특이 값들을 가지고도 유용한 정보를 만들 수 있다. 위 그림을 보면, A행렬은 n개의 행과 d개의 열이 있다. n은 단어들을 나타내고 d는 문서를 나타낸다. A행렬은 각 d_n문서에서 n개의 단어들의 빈도를 나타낸다고 볼 수 있다. A행렬..
-
텍스트마이닝_TF-IDF란 무엇일까?Text Mining 2019. 11. 20. 17:08
TF_IDF TF는 Term Frequency의 준말이다. 어떤 단어가 특정 문서에 얼마나 많이 쓰였는지를 말한다. 우리가 어떤 문서를 볼 때 많이 등장하는 단어는 자연스레 중요하다고 생각한다. 텍스트 마이닝에서 TF는 아주 기초적으로 단어에 대한 가중치를 할당하는 방법이다. BOW(Bag Of Words)란 무엇일까? TF의 개념과도 비슷한데 단순히 문서 안에서 단어가 존재하는지에 대한 여부를 binary value로 부여하는 것을 의미한다. 그리고 개수를 세는 것이다. 예를 들어, I have a pen, I have a apple pen. 이란 문장이 있으면 I : 2, have : 2, a : 2, apple : 1, pen : 2 이렇게 표현 할 수 있다. 그렇다면 IDF는 무엇일까? IDF는 ..
-
Pyspark로 머신러닝 하기(2)_환경구축_hadoop설치Bigdata Management System 2019. 11. 19. 22:18
Hadoop과 Spark는 Linux 환경에서 구동하기에 적합하다. Linux는 크게 Redhat 계열과 Debian 계열이 있다. 보통 서버용으로 Redhat 계열의 CentOS를 많이 사용하는데 빅데이터관리시스템 과목에서 CentOS 6를 계속 써왔기에 우리는 CentOS 7버전을 선택했다. Ubuntu도 다루기 쉽고 인기있는 OS이지만 앞으로 현업에서 사용 가능성이 높은 CentOS를 쓰기로 결정했다. 분석환경은 이렇다. 1. OS : CentOS Linux 7 2. Java : 3. Python : 3.6 (Anaconda 5.2) 4. Apache Spark : 2.3.2 5. Hadoop : 2.7 5. Hadoop 설치 원래는 hadoop user를 따로 만들어서 hadoop을 설치하는게 좋..
-
Pyspark로 머신러닝 하기(1)_Project 소개Bigdata Management System 2019. 11. 19. 20:26
Pyspark로 머신러닝을 한다는 것은 쉽지 않은 일이다. 수업 시간에 Spark를 배웠고 실제 RDD를 사용해 데이터를 만져봤지만 머신러닝을 하는 것은 또다른 문제다. 리눅스 위에서 하둡과 스파크를 사용해 머신러닝을 한다는 것은 도전적인 일이 될 것이다. 하지만 데이터 사이언스 커리어를 놓고 봤을 때 큰 도움이 될 것이라 생각한다. 우리 팀의 project 목적은 1) review data 감성분석 2) 로컬 or 분산환경의 속도 비교 이다. 1) Review data는 Kaggle competition에서 사용됐던 Airbnb review data이다. 우리는 데이터를 살펴보고 2)
-
(머신러닝)Kaggle의 Santander Customer Satisfaction 데이터 분석Machine Learning 2019. 11. 18. 12:14
Santander Bank Customer Satisfaction Analysis 1. If target is 1, it represents customers who had unsatisfaction with service. 2. If target is 0, it represents customers who had satisfaction for service. 3. I will use ROC-AUC because unsatisfaction outcomes would be much smaller. 4. XGBoost and LightGBM will be used from sklearn.model_selection import train_test_split, GridSearchCV from sklearn.m..