Skip to Content
精通機器學習|使用Python
book

精通機器學習|使用Python

by Sarah Guido, Andreas C. Mueller
October 2017
Intermediate to advanced
384 pages
7h 29m
Chinese
GoTop Information, Inc.
Content preview from 精通機器學習|使用Python
演算法 Chains Pipelines |
305
6-3 顯示了用於兩個轉換器
T1
T2
,和一個分類器(稱為
Classifier
)的過程。
6-3 pipeline 的訓練和預測過程一覽
pipeline 實際上是比這更一般化。在 pipeline 中的最後一個步驟不需要有
predict
函式,
舉例來說,我們可以建立一個只包含一個縮放器和
PCA
pipeline,然後,因為最後
一個步驟(
PCA
)有
transform
函式,我們可以在 pipeline 上呼叫
transform
,應用由上一
步驟處理的資料到
PCA.transform
以獲得的輸出。pipeline 的最後一個步驟只需要有
fit
函式。
make_pipeline 方便 Pipeline 建立
使用前面介紹的語法建立 pipeline 有時是有點麻煩,一般來說,我們不需要為每個步驟
指定名稱。有一個方便的函式
make_pipeline
,用來建立一個 pipeline,並根據類別自動
命名每一步驟。
make_pipeline
的語法如下:
In[17]:
from sklearn.pipeline import make_pipeline
# 標準語法
pipe_long = Pipeline([("scaler", MinMaxScaler()), ("svm", SVC(C=100))])
# 簡短的語法
pipe_short = make_pipeline(MinMaxScaler(), SVC(C=100))
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

TensorFlow深度学习课程:深度神经网络在机器学习任务的应用

TensorFlow深度学习课程:深度神经网络在机器学习任务的应用

乔恩·克罗恩
精實企業|高績效組織如何達成創新規模化

精實企業|高績效組織如何達成創新規模化

Jez Humble, Joanne Molesky, Barry O'Reilly
初探深度學習|使用TensorFlow

初探深度學習|使用TensorFlow

Reza Zadeh, Bharath Ramsundar

Publisher Resources

ISBN: 9789864763665