만 아니라 선형, 비선형 회귀에도 사용할 수 있습니다. 회귀에 적용하는 방법은 목표를 반대
로 하는 것입니다. 일정한 마진 오류 안에서 두 클래스 간의 도로 폭이 가능한 한 최대가 되도
록 하는 대신,
SVM
회귀는 제한된 마진 오류(즉, 도로 밖의 샘플) 안에서 도로 안에 가능한 한
많은 샘플이 들어가도록 학습합니다. 도로의 폭은 하이퍼파라미터
ε
으로 조절합니다.
16
[그림
5
-
10
]은 무작위로 생성한 선형 데이터셋에 훈련시킨 두 개의 선형
SVM
회귀 모델을 보여줍니
다. 하나는 마진을 크게(
ε
=
1
.
5
) 하고 다른 하나는 마진을 작게(
ε
=
0
.
5
) 하여 만들었습니다.
그림
5-10
SVM
회귀
마진 안에서는 훈련 샘플이 추가되어도 모델의 예측에는 영향이 없습니다. 그래서 이 모델을
ε
에 민감하지 않다
ε
-
insensitive
고 말합니다.
사이킷런의
LinearSVR
을 사용해 선형
SVM
회귀를 적용해보겠습니다. 다음 코드는 [그림
5
-
10
]의 왼쪽 그래프에 해당하는 모델을 만듭니다(먼저 훈련 데이터의 스케일을 맞추고 평균
을
0
으로 맞춰야 합니다).
16
옮긴이_ 허용오차를 설명할 때 나온 하이퍼파라미터
ε
과 혼동하지 마세요 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.