ภาพรวมของ PySpark MLlib

Big Data Fundamentals with PySpark

Upendra Devisetty

Science Analyst, CyVerse

PySpark MLlib คืออะไร?

Machine learning is a scientific discipline that explores the construction and
study of algorithms that can learn from data
  • MLlib คือส่วนประกอบของ Apache Spark สำหรับ machine learning

  • เครื่องมือต่าง ๆ ที่ MLlib มีให้ใช้งาน:

    • ML Algorithms: collaborative filtering, classification และ clustering

    • Featurization: การดึง การแปลง การลดมิติ และการคัดเลือก feature

    • Pipelines: เครื่องมือสำหรับสร้าง ประเมิน และปรับแต่ง ML Pipelines

1 https://en.wikipedia.org/wiki/Machine_learning
Big Data Fundamentals with PySpark

ทำไมต้องใช้ PySpark MLlib?

  • scikit-learn คือไลบรารี Python ยอดนิยมสำหรับ data mining และ machine learning

  • อัลกอริทึมของ scikit-learn ทำงานได้เฉพาะกับชุดข้อมูลขนาดเล็กบนเครื่องเดียว

  • อัลกอริทึมของ MLlib ใน Spark ออกแบบมาสำหรับการประมวลผลแบบขนานบน cluster

  • รองรับภาษาอย่าง Scala, Java และ R

  • มี API ระดับสูงสำหรับสร้าง machine learning pipeline

Big Data Fundamentals with PySpark

อัลกอริทึมใน PySpark MLlib

  • Classification (Binary และ Multiclass) และ Regression: Linear SVMs, logistic regression, decision trees, random forests, gradient-boosted trees, naive Bayes, linear least squares, Lasso, ridge regression, isotonic regression

  • Collaborative filtering: Alternating least squares (ALS)

  • Clustering: K-means, Gaussian mixture, Bisecting K-means และ Streaming K-Means

Big Data Fundamentals with PySpark

3 C ของ machine learning ใน PySpark MLlib

  • Collaborative filtering (recommender engines): สร้างคำแนะนำให้ผู้ใช้

  • Classification: ระบุว่าข้อมูลใหม่อยู่ในหมวดหมู่ใด

  • Clustering: จัดกลุ่มข้อมูลตามลักษณะที่คล้ายกัน

Big Data Fundamentals with PySpark

การ import ใน PySpark MLlib

  • Collaborative filtering
from pyspark.mllib.recommendation import ALS
  • Classification
from pyspark.mllib.classification import LogisticRegressionWithLBFGS
  • Clustering
from pyspark.mllib.clustering import KMeans
Big Data Fundamentals with PySpark

มาฝึกกันเถอะ!

Big Data Fundamentals with PySpark

Preparing Video For Download...