Commit bf35110f authored by 宋柯's avatar 宋柯

模型调试

parent 6998171e
......@@ -293,15 +293,18 @@ def wilson_ctr(num_pv, num_click):
def getUserProfileFeature(samples_iEsF_iStatisticF, spark, startDay, endDay):
#连接doris_olap库
userProfileFeatureDF = spark.read.jdbc('jdbc:mysql://172.16.30.136:3306/doris_olap', 'user_tag3_portrait', numPartitions = 100,
properties = { 'user': 'doris_olap', 'password': 'bA27hXasdfswuolap', 'driver': 'com.mysql.jdbc.Driver' })
userProfileFeatureDF.createOrReplaceTempView("userProfileFeatureDF")
table_query = """
select date as dt, cl_id as device_id, first_solutions, second_solutions, first_demands, second_demands, first_positions, second_positions, projects
from user_tag3_portrait
from userProfileFeatureDF
where date >= '{startDay}' and date <= '{endDay}'
""".format(startDay = startDay, endDay = endDay)
print(table_query)
userProfileFeatureDF = spark.read.jdbc('jdbc:mysql://172.16.30.136:3306/doris_olap', table_query, numPartitions = 100,
properties = { 'user': 'doris_olap', 'password': 'bA27hXasdfswuolap', 'driver': 'com.mysql.jdbc.Driver' })
userProfileFeatureDF = spark.sql(table_query)
userProfileFeatureDF.show(100, False)
def addUserFeatures(samples):
......
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