로지스틱회귀
-
[기계학습] 로지스틱 회귀(분류 Classification)(Logistic Regression) (Part 2/2)코딩(Coding)/기계학습 2022. 1. 25. 22:17
이전 포스팅의 개념적인 부분을 python의 pytorch 패키지를 통해 구현하는 포스팅입니다. 이전 포스팅을 보고오세요~ :D (https://jsy-coding-blog.tistory.com/47) 포스팅에서 사용하는 PPT 자료는 제 Github에서 pdf 형식으로 받을 수 있습니다. (https://github.com/JoSangYeon/Machine_Learning_Project/blob/master/PPT/01.%20Machine%20Learning.pdf) Logistic Regression 분류 문제 지난 포스팅 복습 코드 실습(With Pytorch) 패키지 Import import numpy as np import pandas as pd import torch import torch.n..
-
[기계학습] 로지스틱 회귀(분류 Classification)(Logistic Regression) (Part 1/2)코딩(Coding)/기계학습 2022. 1. 21. 11:29
로지스틱 회귀(분류) 앞서 포스팅했던 선형회귀는 학습한 데이터를 기반으로 새로운 데이터에 대한 Output을 예측하는 문제라고 설명할 수 있겠다. 하지만, 로지스틱 회귀는 반대로 좌표평면상의 데이터를 각 그룹(class)으로 분류(classification)하는 것이다. 다음과 같은 데이터에 대해서 선형회귀를 적용한다고 가정한다면, 위 그림처럼 직선이 그려질 것이다. 이 직선을 토대로 x가 5를 기준으로 성공/실패를 분류 할 수 있을 것이다. 하지만, 문제는 아래에서 발생한다. 만약 새로운 데이터 (20, 성공)이 있다면, x가 10을 기준으로 성공/실패를 분류할 것인데, 예외로 (9, 성공)이 분류에 실패하게 될 것이다. 따라서 해결방법으로 새로운 함수를 도입한다. 바로 시그모이드(Sigmoid) 함수..
-
[기계학습] 선형회귀(Linear Regression) (Part 2/2)코딩(Coding)/기계학습 2022. 1. 18. 12:49
이전 포스팅의 개념적인 부분을 python의 pytorch 패키지를 통해 구현하는 포스팅입니다. 이전 포스팅을 보고오세요~ :D (https://jsy-coding-blog.tistory.com/45) 포스팅에서 사용하는 PPT 자료는 제 Github에서 pdf 형식으로 받을 수 있습니다. (https://github.com/JoSangYeon/Machine_Learning_Project/blob/master/PPT/01.%20Machine%20Learning.pdf) 선형회귀 구현(with Pytorch) 이전 포스팅에서 다뤘던 선형회귀의 개념을 Pytorch를 통해 구현해보자! 사용할 라이브러리를 import 한다. import numpy as np import pandas as pd import m..