In [1]:
from pyspark import SparkContext
sc = SparkContext('local','example')
In [3]:
exec(open('doweathclass_gendata.py').read())
In [5]:
datax_rdd
Out[5]:
In [6]:
datax_rdd.take(3)
Out[6]:
In [9]:
exec(open('doweathclass_naivebayes.py').read())
In [10]:
exec(open('doweathclass_dectree.py').read())
In [11]:
newpoint = np.array([1,0,0,68,79,0])
my_nbmodel.predict(newpoint)
Out[11]:
In [14]:
dt_model.predict(newpoint)
Out[14]:
In [16]:
print(dt_model.toDebugString())
In [ ]: