Skip to Content
スパーク定義ガイド
book

スパーク定義ガイド

by Bill Chambers, Matei Zaharia
March 2025
Intermediate to advanced
606 pages
9h
Japanese
O'Reilly Media, Inc.
Content preview from スパーク定義ガイド

第29章 教師なし学習 教師なし学習

この作品はAIを使って翻訳されている。ご意見、ご感想をお待ちしている:translation-feedback@oreilly.com

この章( )では、教師なし学習のためのSparkの利用可能なツールの詳細を、特にクラスタリングに焦点を当てて説明する。教師なし学習は、一般的に言って、(最終的な結果の観点から)適用と成功の測定が難しいため、教師あり学習よりも使用頻度が低い。これらの の課題は、規模が大きくなると悪化する可能性がある。例えば、高次元空間でのクラスタリングは、単に高次元スペースの特性のために奇妙なクラスタを作成する可能性があり、次元の呪いと呼ばれるものである。次元の呪いとは、特徴空間の次元が広がるにつれて、ますます疎になるという事実を表している。つまり、統計的に意味のある結果を得るために、このスペースを埋めるために必要なデータは、次元が大きくなるにつれて急激に増加する。さらに、高次元のデータにはノイズが多く含まれる。その結果、モデルが特定の結果やグループ分けの原因となっている真の要因ではなく、ノイズにフォーカスしてしまう可能性がある。したがって、モデルのスケーラビリティの表には、計算限界と統計的推奨値のセットが含まれている。これらはヒューリスティックであり、要件ではなく、有用なガイドであるべきである。

教師なし学習の核心は、パターンを発見したり、与えられたデータセットの基本構造の簡潔な表現を導き出そうとすることである。

使用例

、潜在的な使用例をいくつか紹介しよう。その核心は、これらのパターンが、事前には明らかでなかったかもしれないデータのトピック、異常、またはグループ化を明らかにするかもしれないということである:

データの異常を発見する

あるデータセットに含まれる値の大多数が大きなグループに集まり、その外側にいくつかの小さなグループがある場合、それらのグループはさらなる調査が必要かもしれない。

トピックモデリング

大量のテキストを発見することで、異なる文書間に存在するトピックを見つけることができる。

モデルのスケーラビリティ

他のモデルと同様、統計的な推奨事項とともに、基本的なモデルのスケーラビリティ要件についても触れておくことが重要である。

表29-1. クラスタリングモデルのスケーラビリティの参照
モデル 統計的推奨 計算の限界 トレーニングの例

k平均法

最大50~100

特徴 x クラスター < 1000万

制限なし

k-meansを二分する

最大50~100

特徴 x クラスター < 1000万

制限なし

GMM

最大50~100

特徴 x クラスター < 1000万

制限なし

LDA

インタプリタ数字

1,000以上のトピック

制限なし

まずは、数値データの例をロードしてみよう:

// in Scala
import org.apache.spark.ml.feature.VectorAssembler

val va = new VectorAssembler()
  .setInputCols(Array("Quantity", "UnitPrice"))
  .setOutputCol("features")

val sales = va.transform(spark.read.format("csv")
  .option("header", "true")
  .option("inferSchema", "true")
  .load("/data/retail-data/by-day/*.csv" ...
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

高性能Spark

高性能Spark

Holden Karau, Rachel Warren
生成AIの可視化

生成AIの可視化

Priyanka Vergadia, Valliappa Lakshmanan
ソフトウェア工学の基礎

ソフトウェア工学の基礎

Nathaniel Schutta, Dan Vega

Publisher Resources

ISBN: 9798341627567