Commit 4a549299 authored by 张彦钊's avatar 张彦钊

change test fliw

parent ff2eb5f2
......@@ -267,6 +267,8 @@ def get_predict(date,value_map,app_list_map,leve2_map,leve3_map):
df = spark.sql(sql)
df = df.drop_duplicates(["treatment_method","price_min","price_max","treatment_time","maintain_time","recover_time"])
print("pre test")
print(df.count())
df = df.na.fill(dict(zip(features, features)))
f = time.time()
rdd = df.select("label", "y", "z", "ucity_id", "device_id", "cid_id", "app_list", "level2_ids", "level3_ids",
......@@ -297,8 +299,6 @@ def get_predict(date,value_map,app_list_map,leve2_map,leve3_map):
print("native csv")
native_pre.toPandas().to_csv(local_path+"native.csv", header=True)
print("预测集总数")
print(rdd.count())
# TODO 写成csv文件改成下面这样
# native_pre.coalesce(1).write.format('com.databricks.spark.csv').save(path+"native/",header = 'true')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment