스트가 실패하는 것을 볼 수 있습니다. 첫 번째 작업은 이 테스트를 통과시키기 위해 가능한
한 가장 간단한 작업을 수행하는 것이며,
IDE
의 ‘메서드 추출’을 활용하여 이를 수행합니다.
1
.
IDE
에서
import
문장 다음의 스크립트 내 모든 코드 줄을 선택합니다.
2
.
‘메서드 추출’
IDE
단축키를 누릅니다. 파이참(맥:
⌘
+
⌥
+
M
, 윈도우/리눅스:
Ctrl
+
Alt
+
M
) 또
는
VS
Code
(
Ctrl
+
.
)의 편리한 단축키를 사용할 수 있습니다. 함수 이름은 테스트에서 지정한 것
(
prepare
_
data
_
and
_
train
_
model
()
)과 같이 정할 수 있습니다.
3
.
테스트를 실행하고, 함수가 모델 지표 테스트에서 기대한 값들을 반환하지 않아 실패하는 것을 확인합니다.
4
.
prepare
_
data
_
and
_
train
_
model
()
의 마지막 줄에서, 함수가 모델의 인스턴스, 검증셋(
X
_
test
), 검증셋 레
이블(
y
_
test
)을 반환하도록 만듭니다.
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.
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.