|
@@ -10,6 +10,7 @@ public class FeatureTransformV2 {
|
|
|
private static final double smoothPlus = 5.0;
|
|
|
private static final double largerSmoothPlus = 30.0;
|
|
|
private static final double log1Scale = 10.0;
|
|
|
+ private static final long midValidTs = 14 * 24 * 3600 * 1000;
|
|
|
private static final List<String> c1Periods = Arrays.asList("72h", "168h");
|
|
|
private static final List<String> b0Periods = Arrays.asList("1h", "3h", "6h", "12h");
|
|
|
private static final List<String> b1Periods = Arrays.asList("1h", "3h", "6h", "24h", "72h", "168h");
|
|
@@ -62,6 +63,30 @@ public class FeatureTransformV2 {
|
|
|
oneTypeStatFeature("c1", "return_1_uv", c1Periods, userOriginInfo.get("mid_global_feature_20250212"), featMap);
|
|
|
}
|
|
|
|
|
|
+ public static void getMid(String uid, String mid, long currentMs, UserShareReturnProfile profile, Map<String, Double> featMap) {
|
|
|
+ if (null == profile) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String key = "";
|
|
|
+ if (null != uid && !uid.isEmpty() && !uid.equals("null")) {
|
|
|
+ key = uid;
|
|
|
+ } else if (null != mid && !mid.isEmpty() && !mid.equals("null")) {
|
|
|
+ key = mid;
|
|
|
+ }
|
|
|
+ if (!key.isEmpty()) {
|
|
|
+ List<UserSRBO> l_r_s = profile.getL_r_s();
|
|
|
+ if (null != l_r_s && !l_r_s.isEmpty()) {
|
|
|
+ UserSRBO user = l_r_s.get(0);
|
|
|
+ if (null != user) {
|
|
|
+ long ts = user.getTs() * 1000;
|
|
|
+ if (ts > currentMs - midValidTs) {
|
|
|
+ featMap.put(String.format("%s@%s", "mid", key), 1.0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public static void getUserProfileFeature(UserShareReturnProfile profile, Map<String, String> userInfo, Map<String, Double> featMap) {
|
|
|
if (null != profile) {
|
|
|
long s_pv = profile.getS_pv(); // share_pv(分享pv)
|