Commit 6a2815e9 authored by 宋柯's avatar 宋柯

模型调试

parent f8046c29
...@@ -830,11 +830,9 @@ if __name__ == '__main__': ...@@ -830,11 +830,9 @@ if __name__ == '__main__':
spark = get_spark("service_feature_csv_export") spark = get_spark("service_feature_csv_export")
spark.sparkContext.setLogLevel("ERROR") spark.sparkContext.setLogLevel("ERROR")
itemDF = get_service_feature_df() # itemDF = get_service_feature_df()
print(itemDF.columns) # print(itemDF.columns)
print(itemDF.head(100)) # print(itemDF.head(100))
sys.exit()
# 行为数据 # 行为数据
clickSql = getClickSql(startDay,endDay) clickSql = getClickSql(startDay,endDay)
...@@ -853,9 +851,10 @@ if __name__ == '__main__': ...@@ -853,9 +851,10 @@ if __name__ == '__main__':
.withColumn("timestamp",F.col("timestamp").cast("long")) .withColumn("timestamp",F.col("timestamp").cast("long"))
print(ratingDF.columns) print(ratingDF.columns)
print(ratingDF.show(10, truncate=False)) print(ratingDF.show(100, truncate=False))
print("添加label...") print("添加label...")
#TODO 负样本为排除点击的数据
ratingSamplesWithLabel = addSampleLabel(ratingDF) ratingSamplesWithLabel = addSampleLabel(ratingDF)
df = ratingSamplesWithLabel.toPandas() df = ratingSamplesWithLabel.toPandas()
df = pd.DataFrame(df) df = pd.DataFrame(df)
...@@ -885,13 +884,15 @@ if __name__ == '__main__': ...@@ -885,13 +884,15 @@ if __name__ == '__main__':
print("dataVocab:") print("dataVocab:")
for k, v in dataVocab.items(): for k, v in dataVocab.items():
print(k, len(v)) print(k, len(v), v)
itemDF_spark = spark.createDataFrame(itemDF) itemDF_spark = spark.createDataFrame(itemDF)
itemDF_spark.printSchema() itemDF_spark.printSchema()
itemDF_spark.show(10, truncate=False) itemDF_spark.show(10, truncate=False)
sys.exit(1)
# item统计特征处理 # item统计特征处理
itemStaticDF = addItemStaticFeatures(ratingSamplesWithLabel,itemDF_spark,dataVocab) itemStaticDF = addItemStaticFeatures(ratingSamplesWithLabel,itemDF_spark,dataVocab)
......
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