|
@@ -1,21 +1,14 @@
|
|
|
package com.tzld.piaoquan.ad.engine.service.predict.model.threshold;
|
|
|
|
|
|
+import com.tzld.piaoquan.ad.engine.commons.util.DateUtils;
|
|
|
import com.tzld.piaoquan.ad.engine.service.predict.container.RandWContainer;
|
|
|
import com.tzld.piaoquan.ad.engine.service.predict.param.ThresholdPredictModelParam;
|
|
|
-import com.tzld.piaoquan.ad.engine.service.remote.FeatureRemoteService;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import javax.annotation.PostConstruct;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
-import java.util.Random;
|
|
|
-import java.util.concurrent.Executors;
|
|
|
-import java.util.concurrent.ScheduledExecutorService;
|
|
|
-import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
@Component
|
|
|
public class RandomPredictModel extends ThresholdPredictModel {
|
|
@@ -41,8 +34,10 @@ public class RandomPredictModel extends ThresholdPredictModel {
|
|
|
.toString());
|
|
|
}
|
|
|
double correction=Double.parseDouble(
|
|
|
- modelParam.getExtraParam().getOrDefault(modelParam.getAppType()+"_"+modelParam.getUserExtraFuture("shareType").toString().replace("return","").replace("mids",""),-1
|
|
|
+ modelParam.getExtraParam()
|
|
|
+ .getOrDefault("E620_"+modelParam.getAppType()+"_"+DateUtils.getCurrentHour(),1
|
|
|
).toString());
|
|
|
+ threshold=threshold*correction;
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
result.put("ad_predict", score<threshold?2:1);
|
|
|
result.put("score", score);
|