|
@@ -3,9 +3,16 @@ import time
|
|
|
import datetime
|
|
|
import pandas as pd
|
|
|
from odps import ODPS
|
|
|
-from config import set_config
|
|
|
+# from config import set_config
|
|
|
+#
|
|
|
+# config_, env = set_config()
|
|
|
|
|
|
-config_, env = set_config()
|
|
|
+# ODPS服务配置
|
|
|
+odps_config = {
|
|
|
+ 'ENDPOINT': 'http://service.cn.maxcompute.aliyun.com/api',
|
|
|
+ 'ACCESSID': 'LTAIWYUujJAm7CbH',
|
|
|
+ 'ACCESSKEY': 'RfSjdiWwED1sGFlsjXv0DlfTnZTG1P',
|
|
|
+}
|
|
|
|
|
|
features = [
|
|
|
'apptype',
|
|
@@ -19,6 +26,7 @@ features = [
|
|
|
'mid_view_count_pv_30day',
|
|
|
'mid_play_count_30day',
|
|
|
'mid_play_count_pv_30day',
|
|
|
+
|
|
|
'mid_share_count_30day',
|
|
|
'mid_share_count_pv_30day',
|
|
|
'mid_return_count_30day',
|
|
@@ -73,10 +81,10 @@ train_feature = [
|
|
|
def get_feature_data(project, table, features, dt, app_type):
|
|
|
"""获取特征数据"""
|
|
|
odps = ODPS(
|
|
|
- access_id=config_.ODPS_CONFIG['ACCESSID'],
|
|
|
- secret_access_key=config_.ODPS_CONFIG['ACCESSKEY'],
|
|
|
+ access_id=odps_config['ACCESSID'],
|
|
|
+ secret_access_key=odps_config['ACCESSKEY'],
|
|
|
project=project,
|
|
|
- endpoint=config_.ODPS_CONFIG['ENDPOINT'],
|
|
|
+ endpoint=odps_config['ENDPOINT'],
|
|
|
)
|
|
|
feature_data = []
|
|
|
sql = f"select * from {project}.{table} where dt={dt} and apptype={app_type}"
|