當我構建Spark模型並調用它時,預測需要幾十ms才能返回。 但是,當我保存相同的模型,然後加載它,預測需要更長的時間。我應該使用某種緩存嗎? model.cache()加載後不起作用,因爲模型不是RDD。 這個偉大的工程: from pyspark.mllib.recommendation import ALS
from pyspark import SparkContext
import
我看到這本書的這個例子「學習星火:快如閃電的大數據分析」: class SearchFunctions(val query: String) {
// more methods here
def getMatchesNoReference(rdd: RDD[String]): RDD[String] = {
// Safe: extract just the field we need in