Skip to Content
精通機器學習
book

精通機器學習

by Aurélien Géron
April 2020
Intermediate to advanced
816 pages
18h 32m
Chinese
GoTop Information, Inc.
Content preview from 精通機器學習
多輸出分類
|
105
這段程式假設所有標籤的重要性一樣
但是事實不一定如此
例如
如果
Alice
的照片比
Bob
Charlie
的多
你可能會讓
Alice
照片的分類器分數有更多權重
有一種簡單的做法
是讓每一個標籤的權重等於它的
support
也就是有該標籤的實例數量
)。
為此
你只要在
上面的程式中設定
average="weighted"
即可
4
多輸出分類
我們要討論的最後一種分類
多輸出多類別分類
或簡稱
多輸出分類
)。
它只不過是更
廣泛的多標籤分類
各個標籤都可以有多個類別
也就是它的值可以超過兩個
)。
為了說明
我們來建立一個移除圖像雜訊的系統
它會接收一張有雜訊的數位圖像
並且
希望如此
輸出一張乾淨的數位圖像
圖像是用像素強度陣列來表示的
就像
MNIST
的圖片那樣
請注意
分類器的輸出是多標籤的
每個像素一個標籤
),
而且各個標籤可
以是多個值
像素強度的範圍是
0
255)。
因此它是個多輸出分類系統
分類與回歸之間的界限有時很模糊
就像這個範例
我們可以說
預測像素
強度比較像回歸
而不是分類
此外
多輸出系統並非只能進行分類任務
你甚至可以讓系統為每個實例輸出多個標籤
包括類別標籤與值標籤
我們先取得
MNIST
圖片
並且用
NumPy
randint()
函式將雜訊加到它們的像素強度
目標圖片是原始圖片
noise = np.random.randint(0, 100, (len(X_train), 784))
X_train_mod = X_train + noise
noise = np.random.randint(0, ...
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

面向数据科学家的实用统计学

面向数据科学家的实用统计学

Peter Bruce, Andrew Bruce
C语言核心技术(原书第2版)

C语言核心技术(原书第2版)

Peter Prinz, Tony Crawford
高效能PYTHON程式設計

高效能PYTHON程式設計

Micha Gorelick, Ian Ozsvald
下一代空间计算:AR与VR创新理论与实践

下一代空间计算:AR与VR创新理论与实践

Erin Pangilinan, Steve Lukas, Vasanth Mohan

Publisher Resources

ISBN: 9789865024345