我正在嘗試使用樸素貝葉斯算法來構建文本分類模型。 這裏是我的樣本數據(標籤和功能): 1|combusting [chemical]
1|industrial purposes
1|
2|salt for preserving,
2|other for foodstuffs
2|auxiliary
2|fluids for use with abrasives
3|vulcanisa
我想創建一個新的 mongodb RDD,每當我進入foreachRDD時。不過我有序列化問題: mydstream
.foreachRDD(rdd => {
val mongoClient = MongoClient("localhost", 27017)
val db = mongoClient(mongoDatabase)
val coll =
給定以下的Apache火花(Python)的碼(它是工作): import sys
from random import random
from operator import add
import sqlite3
from datetime import date
from datetime import datetime
from pyspark import SparkCont