|
@@ -77,14 +77,9 @@ public class StatisticsUtil {
|
|
public static void featureCoverRateByLibSvm(String record, Set<String> featureNames, Map<String, Long> allMap) {
|
|
public static void featureCoverRateByLibSvm(String record, Set<String> featureNames, Map<String, Long> allMap) {
|
|
String[] rSplit = record.split("\t");
|
|
String[] rSplit = record.split("\t");
|
|
// 异常样本统计
|
|
// 异常样本统计
|
|
- if (rSplit.length != 3) {
|
|
|
|
- StatisticsUtil.mapKeyAddOne(allMap, "errorSampleNum");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
StatisticsUtil.mapKeyAddOne(allMap, "recommendSampleNum");
|
|
StatisticsUtil.mapKeyAddOne(allMap, "recommendSampleNum");
|
|
- String[] features = rSplit[2].split("\t");
|
|
|
|
- for (String feature : features) {
|
|
|
|
|
|
+ for (int i = 2; i < rSplit.length; i++) {
|
|
|
|
+ String feature = rSplit[i];
|
|
String[] split = feature.split(":");
|
|
String[] split = feature.split(":");
|
|
String key = split[0];
|
|
String key = split[0];
|
|
String value = split[1];
|
|
String value = split[1];
|