Skip to Content
핸즈온 머신러닝(2판): 사이킷런, 케라스, 텐서플로 2를 활용한 머신러닝, 딥러닝 완벽 실무
book

핸즈온 머신러닝(2판): 사이킷런, 케라스, 텐서플로 2를 활용한 머신러닝, 딥러닝 완벽 실무

by 박해선, 오렐리앙 제롱
May 2020
Beginner to intermediate
952 pages
24h 11m
Korean
Hanbit Media, Inc.
Content preview from 핸즈온 머신러닝(2판): 사이킷런, 케라스, 텐서플로 2를 활용한 머신러닝, 딥러닝 완벽 실무
239
6
결정 트리
6.8
회귀
결정 트리는 회귀 문제에도 사용할 수 있습니다. 사이킷런의
DecisionTreeRegressor
를 사용
해 잡음이 섞인
2
차 함수 형태의 데이터셋에서
max
_
depth
=
2
설정으로 회귀 트리를 만들어보
겠습니다.
13
from sklearn.tree import DecisionTreeRegressor
tree_reg = DecisionTreeRegressor(max_depth=2)
tree_reg.fit(X, y)
만들어진 트리는 [그림
6
-
4
]와 같습니다.
그림
6-4
회귀 결정 트리
앞서 만든 분류 트리와 매우 비슷해 보입니다. 주요한 차이는 각 노드에서 클래스를 예측하는 대
신 어떤 값을 예측한다는 점입니다. 예를 들어
x
1
=
0
.
6
인 샘플의 타깃값을 예측한다고 가정해보
겠습니다. 루트 노드부터 시작해서 트리를 순회하면 결국
value
=
0
.
111
인 리프 노드에 도달하
게 됩니다. 이 리프 노드에 있는
110
개 훈련 샘플의 평균 타깃값이 예측값이 됩니다. 이 예측값
을 사용해
110
개 샘플에 대한 평균제곱오차 (
MSE
)를 계산하면
0
.
015
가 됩니다.
13
옮긴이_ 이 코드에 있는 훈련 데이터는
y
=
4
(
x
-
0
.
5
)
2
을 사용하여 만들었으며
y
값에 랜덤한 잡음을 섞었습니다.
240
1
머신러닝
이 모델의 예측은 [그림
6
-
5
]의 왼쪽에 나타나 ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’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
QuotationMarkI 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
QuotationMarkI’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
QuotationMarkI'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.
Mark W.
Embedded Software Engineer

You might also like

만들면서 배우는 프로그레시브 웹 앱: 사용자 경험을 극대화하는 차세대 웹 앱 기술

만들면서 배우는 프로그레시브 웹 앱: 사용자 경험을 극대화하는 차세대 웹 앱 기술

한민주, 양찬석, 탈 아터

Publisher Resources

ISBN: 9791162242964