From f9254bd0dbb866e3f5859ea6b20ca6781310976b Mon Sep 17 00:00:00 2001 From: thenk008 <794757862@qq.com> Date: Sat, 6 Jun 2020 14:54:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DKNN=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E6=B3=A8=E5=85=A5=E5=8F=8A=E8=8E=B7=E5=8F=96=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wlld/imageRecognition/TempleConfig.java | 16 +++++++----- .../java/org/wlld/nerveEntity/BodyList.java | 24 ++++++++++++++++++ .../org/wlld/nerveEntity/ModelParameter.java | 6 ++--- src/test/java/coverTest/FoodTest.java | 25 ++++++++++++------- src/test/java/coverTest/PicTest.java | 11 ++++++++ src/test/java/org/wlld/ModelData.java | 1 + 6 files changed, 65 insertions(+), 18 deletions(-) create mode 100644 src/main/java/org/wlld/nerveEntity/BodyList.java diff --git a/src/main/java/org/wlld/imageRecognition/TempleConfig.java b/src/main/java/org/wlld/imageRecognition/TempleConfig.java index f6fe1aa..87a033f 100644 --- a/src/main/java/org/wlld/imageRecognition/TempleConfig.java +++ b/src/main/java/org/wlld/imageRecognition/TempleConfig.java @@ -17,6 +17,7 @@ import org.wlld.imageRecognition.modelEntity.LvqModel; import org.wlld.imageRecognition.modelEntity.MatrixModel; import org.wlld.nerveCenter.NerveManager; import org.wlld.nerveCenter.Normalization; +import org.wlld.nerveEntity.BodyList; import org.wlld.nerveEntity.ModelParameter; import org.wlld.nerveEntity.SensoryNerve; import org.wlld.param.Cutting; @@ -539,15 +540,18 @@ public class TempleConfig { case Classifier.KNN: if (knn != null) { Map> listMap = knn.getFeatureMap(); - Map>> knnVector = new HashMap<>(); + List knnVector = new ArrayList<>(); for (Map.Entry> entry : listMap.entrySet()) { List list = entry.getValue(); List> listFeature = new ArrayList<>(); + BodyList bodyList = new BodyList(); + bodyList.setLists(listFeature); + bodyList.setType(entry.getKey()); for (Matrix matrix : list) { List list1 = MatrixOperation.rowVectorToList(matrix); listFeature.add(list1); } - knnVector.put(entry.getKey(), listFeature); + knnVector.add(bodyList); } modelParameter.setKnnVector(knnVector); } @@ -662,11 +666,11 @@ public class TempleConfig { nerveManager.insertModelParameter(modelParameter); break; case Classifier.KNN: - Map>> knnVector = modelParameter.getKnnVector(); + List knnVector = modelParameter.getKnnVector(); if (knn != null && knnVector != null) { - for (Map.Entry>> entry : knnVector.entrySet()) { - List> featureList = entry.getValue(); - int type = entry.getKey(); + for (BodyList bodyList : knnVector) { + int type = bodyList.getType(); + List> featureList = bodyList.getLists(); for (List list : featureList) { Matrix matrix = MatrixOperation.listToRowVector(list); knn.insertMatrix(matrix, type); diff --git a/src/main/java/org/wlld/nerveEntity/BodyList.java b/src/main/java/org/wlld/nerveEntity/BodyList.java new file mode 100644 index 0000000..9523864 --- /dev/null +++ b/src/main/java/org/wlld/nerveEntity/BodyList.java @@ -0,0 +1,24 @@ +package org.wlld.nerveEntity; + +import java.util.List; + +public class BodyList { + private int type; + private List> lists; + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public List> getLists() { + return lists; + } + + public void setLists(List> lists) { + this.lists = lists; + } +} diff --git a/src/main/java/org/wlld/nerveEntity/ModelParameter.java b/src/main/java/org/wlld/nerveEntity/ModelParameter.java index 1d6d236..545e72f 100644 --- a/src/main/java/org/wlld/nerveEntity/ModelParameter.java +++ b/src/main/java/org/wlld/nerveEntity/ModelParameter.java @@ -23,15 +23,15 @@ public class ModelParameter { private Map borderMap = new HashMap<>();//边框距离模型 private LvqModel lvqModel;//LVQ模型 private Map> matrixK = new HashMap<>();//均值特征向量 - private Map>> knnVector;//Knn模型 + private List knnVector;//Knn模型 private Frame frame;//先验边框 private double dnnAvg;// - public Map>> getKnnVector() { + public List getKnnVector() { return knnVector; } - public void setKnnVector(Map>> knnVector) { + public void setKnnVector(List knnVector) { this.knnVector = knnVector; } diff --git a/src/test/java/coverTest/FoodTest.java b/src/test/java/coverTest/FoodTest.java index cc20f0c..71b0457 100644 --- a/src/test/java/coverTest/FoodTest.java +++ b/src/test/java/coverTest/FoodTest.java @@ -1,6 +1,7 @@ package coverTest; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import org.wlld.MatrixTools.Matrix; import org.wlld.config.Classifier; import org.wlld.config.RZ; @@ -19,7 +20,7 @@ import java.util.List; public class FoodTest { public static void main(String[] args) throws Exception { - //test(); + test(); } public static void one(double[] test, double[] right, double[] wrong) { @@ -39,7 +40,7 @@ public class FoodTest { public static void test2(TempleConfig templeConfig) throws Exception { if (templeConfig == null) { - templeConfig = getTemple(); + templeConfig = getTemple(null); } Picture picture = new Picture(); List specificationsList = new ArrayList<>(); @@ -63,11 +64,11 @@ public class FoodTest { } } - public static TempleConfig getTemple() throws Exception { + public static TempleConfig getTemple(ModelParameter modelParameter) throws Exception { TempleConfig templeConfig = new TempleConfig(); - templeConfig.isShowLog(true);//是否打印日志 + //templeConfig.isShowLog(true);//是否打印日志 Cutting cutting = templeConfig.getCutting(); - Food food =templeConfig.getFood(); + Food food = templeConfig.getFood(); //切割 cutting.setMaxRain(320);//切割阈值 cutting.setTh(0.88); @@ -83,12 +84,15 @@ public class FoodTest { food.setTimes(2);//聚类数据增强 templeConfig.setClassifier(Classifier.KNN); templeConfig.init(StudyPattern.Cover_Pattern, true, 400, 400, 3); + if (modelParameter != null) { + templeConfig.insertModel(modelParameter); + } return templeConfig; } public static void test() throws Exception { Picture picture = new Picture(); - TempleConfig templeConfig = getTemple(); + TempleConfig templeConfig = getTemple(null); Operation operation = new Operation(templeConfig); List specificationsList = new ArrayList<>(); Specifications specifications = new Specifications(); @@ -120,9 +124,12 @@ public class FoodTest { operation.colorStudy(threeChannelMatrix10, 10, specificationsList); System.out.println("=======================================" + i); } - - templeConfig.finishStudy(); - test2(templeConfig); + ModelParameter modelParameter = templeConfig.getModel(); + String model = JSON.toJSONString(modelParameter); + System.out.println(model); + ModelParameter modelParameter1 = JSONObject.parseObject(model, ModelParameter.class); + //templeConfig.finishStudy(); + test2(getTemple(modelParameter1)); } public static void study() throws Exception { diff --git a/src/test/java/coverTest/PicTest.java b/src/test/java/coverTest/PicTest.java index d025192..73eef96 100644 --- a/src/test/java/coverTest/PicTest.java +++ b/src/test/java/coverTest/PicTest.java @@ -1,8 +1,11 @@ package coverTest; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import org.wlld.Ma; import org.wlld.MatrixTools.Matrix; import org.wlld.MatrixTools.MatrixOperation; +import org.wlld.ModelData; import org.wlld.config.Classifier; import org.wlld.config.RZ; import org.wlld.config.StudyPattern; @@ -13,6 +16,7 @@ import org.wlld.imageRecognition.Operation; import org.wlld.imageRecognition.Picture; import org.wlld.imageRecognition.TempleConfig; import org.wlld.nerveCenter.NerveManager; +import org.wlld.nerveEntity.ModelParameter; import org.wlld.nerveEntity.SensoryNerve; import org.wlld.tools.ArithUtil; @@ -32,6 +36,13 @@ public class PicTest { //testImage(right, wrong, a, b); //test(); + tm(); + } + + public static void tm() { + String model = ModelData.DATA4; + int index = model.indexOf("knnVector"); + } public static void test() throws Exception {//对图像进行识别测试 diff --git a/src/test/java/org/wlld/ModelData.java b/src/test/java/org/wlld/ModelData.java index c5ce1aa..81af14e 100644 --- a/src/test/java/org/wlld/ModelData.java +++ b/src/test/java/org/wlld/ModelData.java @@ -10,4 +10,5 @@ public class ModelData { public static final String DATA = "{\"borderMap\":{},\"depthNerves\":[[{\"dendrites\":{1:0.0020304986725699875,2:0.10379403134255444,3:0.6287738152527322},\"threshold\":-0.013039049858902418},{\"dendrites\":{1:0.009147717193496609,2:0.5171480630674181,3:0.07024321085598545},\"threshold\":0.3835537617870677},{\"dendrites\":{1:0.011602795293701885,2:0.6969887303241205,3:0.029915231070745535},\"threshold\":0.24842710692475475},{\"dendrites\":{1:0.004314648309356629,2:0.2774802794419887,3:0.3044946060426335},\"threshold\":0.5701864607985},{\"dendrites\":{1:1.6311469584806588,2:0.5459078494569916,3:-0.11586056714457237},\"threshold\":0.6658399434484007},{\"dendrites\":{1:0.04237452864183608,2:1.7034579816123145,3:0.22574166595355413},\"threshold\":1.8805515163580113},{\"dendrites\":{1:0.019435718292224964,2:0.5087213529333345,3:0.28672202220038917},\"threshold\":0.46120853942194867},{\"dendrites\":{1:0.5271980845882384,2:0.4729005635595556,3:-0.023195453516951844},\"threshold\":0.00578668268494179},{\"dendrites\":{1:-0.552305748938011,2:0.8475348259423108,3:1.3472703636188004},\"threshold\":1.392151682067366}],[{\"dendrites\":{1:0.25288000241376574,2:0.06450358237186028,3:0.5046347957825427,4:0.21528656235967294,5:0.6939232706227578,6:0.4595750252294177,7:0.49415648249977806,8:0.6459916977916105,9:0.35306303887346807},\"threshold\":0.7004528362367957},{\"dendrites\":{1:0.1645156004370013,2:0.5690293246225958,3:0.7133259777627303,4:0.6131265758028632,5:0.07714440799272212,6:0.14708642006827452,7:0.5003388329552009,8:0.6758274616936393,9:0.3127431896910309},\"threshold\":0.2663373689460049},{\"dendrites\":{1:0.23964800006811435,2:0.5225792788893102,3:0.12930489495140296,4:0.16930119368297783,5:0.7600128194880553,6:0.7376696960376283,7:0.3382812966086453,8:0.7849321091589967,9:0.10991006490009754},\"threshold\":0.5056040454442194},{\"dendrites\":{1:0.041119150156730636,2:0.3346196350559196,3:0.2826249487228152,4:0.1802786962613548,5:0.08643792513466173,6:0.6410798980605507,7:0.7403945395626602,8:0.21567057436725043,9:0.6287072823115364},\"threshold\":0.4588569521222759},{\"dendrites\":{1:0.0011664718434862098,2:0.23756177346551408,3:0.5036776829974416,4:0.7212997504096563,5:-0.29346432073368217,6:0.9448332142896997,7:0.7585392966533047,8:0.002695441947128464,9:1.2705642996587019},\"threshold\":0.9694977930390324},{\"dendrites\":{1:0.10071472235629521,2:0.0022650657200771686,3:0.6468438734018197,4:0.21528424377444566,5:0.20619983100752548,6:0.7198001658633856,7:0.4410560166683465,8:0.3227377659119746,9:0.5115950768156629},\"threshold\":0.5263572012576768},{\"dendrites\":{1:0.7697733418428502,2:0.5124195345888053,3:0.3125834036661561,4:0.37033362631525857,5:0.002649706805399057,6:0.5577243110726287,7:0.045880320471866104,8:0.40960867460214817,9:0.41822833569438583},\"threshold\":0.48228377813513934},{\"dendrites\":{1:0.11281551989751622,2:0.3342903034927963,3:0.3353781904164797,4:-4.378591638446594E-4,5:1.0021597933253101,6:0.7893392484630952,7:0.3649955048651297,8:0.4294334712863012,9:0.10290835810256865},\"threshold\":0.6254716054589782},{\"dendrites\":{1:0.6537306663769156,2:0.3086234737977303,3:0.013895733110138041,4:0.11762090824985005,5:-0.5815895796103001,6:1.337374847787431,7:0.27254311770901773,8:-2.6868162889639E-4,9:1.2801491534316676},\"threshold\":0.7642933853728607}]],\"dnnAvg\":0.0,\"dymNerveStudies\":[],\"dymOutNerveStudy\":{\"list\":[],\"threshold\":0.0},\"matrixK\":{},\"outNerves\":[{\"dendrites\":{1:0.01252748740395147,2:0.3510902525503022,3:-0.05376494874511102,4:-0.3174095645136935,5:-0.19895867053482108,6:-0.09713906112316183,7:-0.042606157892249155,8:-0.6365378265660547,9:-0.0890178455802909},\"threshold\":1.031788938492251},{\"dendrites\":{1:0.7672973829093716,2:0.29737599835650413,3:1.1293564390097313,4:-0.06014816479264548,5:-0.7857554443312225,6:0.32760555564057525,7:0.08286304807960662,8:0.7815153927096252,9:-0.8168204332127076},\"threshold\":0.912845723311604},{\"dendrites\":{1:0.4948448701971685,2:0.17912924410374617,3:0.23454899486057917,4:1.0410152721961028,5:0.5560984359423662,6:0.833443989823426,7:0.5974207622212677,8:0.81011956764272,9:0.2994861922578987},\"threshold\":0.702591312798831},{\"dendrites\":{1:-0.013638363105609098,2:-0.012406912345502475,3:-0.0737824571833817,4:0.34277110454831927,5:1.4616563338773294,6:0.3082167282191121,7:0.0053824491469858125,8:-0.008124981504839746,9:1.7877699433796186},\"threshold\":-0.746035157755337}]}"; public static final String DATA2 = "{\"borderMap\":{},\"depthNerves\":[[{\"dendrites\":{1:0.9156354255387174,2:0.8125274451863921,3:0.3615535454080259,4:0.09515646614224252,5:-0.006167951588132063,6:0.7007758820647632,7:-0.038886123193204766,8:0.998551102091073,9:0.5973498456659254,10:0.015882895797322875,11:0.2583005838751566,12:-0.3021358925679116,13:0.5038595486717854,14:0.5011833836057619,15:0.6917662166563002,16:1.553930506195548,17:0.5917721863801528,18:0.6233111138821827,19:0.525247832842735,20:0.5108182095108328,21:0.5667298274954142,22:0.6372783054515596,23:0.11501654542165579,24:0.9113395266895495,25:-0.2855500400653184,26:0.21757845363903872,27:0.5101614887137298,28:0.01021848581445577,29:0.6030687449247121,30:0.002435697144397292,31:0.24059286620815065,32:1.002087146653553,33:0.6338256478400186,34:0.004779168644007213,35:0.1304141409889401},\"threshold\":0.5836921401870699},{\"dendrites\":{1:0.08625551810031744,2:0.6345759612952547,3:0.3575919001218449,4:0.2871924546354964,5:1.4546055247915937,6:0.03649187465080839,7:0.40869193773696616,8:-0.24001501787087662,9:0.23105324522286141,10:0.696072527493177,11:0.24279571896869998,12:0.504129369852856,13:0.260249860687681,14:0.20356089774590186,15:-0.04047404485375756,16:-0.4308572402320148,17:0.9331233840622011,18:0.12074461550761922,19:0.38957988376240155,20:0.8224834893516982,21:0.19534508218760585,22:1.0204485689897196,23:0.6412341798103814,24:0.5468752031103918,25:0.890842369435221,26:0.03266992361063095,27:0.5747514966140805,28:0.5313643344588567,29:-0.0400826761653666,30:0.5110551740539728,31:0.49201580085643987,32:-0.14466866328118203,33:1.1503021797097346,34:0.4922827967695276,35:0.31012536334285234},\"threshold\":0.602940258012709},{\"dendrites\":{1:0.8103532480426182,2:0.8197678496276032,3:0.7203066163428514,4:0.3850324203912271,5:-0.1372935958257047,6:0.07603101101409447,7:-0.06355765917652192,8:0.38426433618555583,9:0.49721064915976276,10:0.3311465570664806,11:0.8225429588932153,12:0.11344817980368907,13:0.017241301659374434,14:0.42451080632575433,15:-0.29223026349916414,16:0.515299488722252,17:0.1036358900534614,18:1.0541286443507467,19:0.450876668436343,20:-0.13110839067214874,21:0.14512427971622766,22:-0.24303811142931928,23:0.38210542834526434,24:0.9378076035865255,25:-0.038308119846504216,26:0.8447893036870062,27:1.0160555510261584,28:0.17150197545074547,29:0.18954955271778634,30:0.7236331579889875,31:0.6459034107952953,32:0.2924780613174092,33:0.5614308710538785,34:0.22343851639768503,35:0.10197504097286825},\"threshold\":0.11959676208739431},{\"dendrites\":{1:0.9837858419630495,2:0.45424797326162814,3:0.5893916386413408,4:0.4127702832851598,5:-0.0067465517628135345,6:0.6037334350963892,7:0.21176691150789295,8:0.6528833634415865,9:0.7088206843211601,10:0.19559750390154224,11:0.3313176392796089,12:0.861554290733756,13:-0.13910101262667193,14:0.819430667902879,15:0.9592155457639877,16:0.38852300221176134,17:0.9418806452623761,18:0.21116973495051397,19:1.0025392470768941,20:0.1867800385302861,21:0.17065088558464117,22:1.001836573992451,23:0.407559144658943,24:0.7432571230631019,25:0.7749759909746943,26:0.3254788815173017,27:0.3644307069125431,28:0.24912932523294326,29:0.9307041678759556,30:0.699048059614266,31:0.728704552084487,32:0.913943969766506,33:0.5802104781957471,34:0.6573867838531485,35:-0.04321768769880419},\"threshold\":0.4241006108808708},{\"dendrites\":{1:0.19920169441025076,2:0.283905497627178,3:0.690922866830004,4:0.41239608343984385,5:0.4744057296320321,6:0.030631568422444078,7:0.6499170122378747,8:-0.08811933932229582,9:0.10903212095036993,10:0.02458926864699401,11:0.921835491387858,12:0.6175302318420931,13:0.26633796337480325,14:0.3038976335968196,15:-0.15232041199299576,16:0.6349681424513026,17:0.8160043058981271,18:0.8495900937317006,19:0.9580085109476663,20:0.6743276238614023,21:-0.25341457067920964,22:0.025191028965877067,23:0.14677306305999596,24:0.5482296659326563,25:-0.028874022258026356,26:0.3286318410570052,27:0.051188531290815555,28:-0.052605032413628336,29:0.1897969918926036,30:-0.12276949211978622,31:0.16483973543702135,32:1.1810343055554207,33:0.34684602580065005,34:0.7762813829921015,35:0.6858180991892883},\"threshold\":0.14997943028292604},{\"dendrites\":{1:1.0974969151084395,2:0.936967646573873,3:0.39795640786753256,4:0.6402322890977816,5:0.4235845844093391,6:0.7677386113872484,7:0.5961996152534333,8:1.2521757289422184,9:0.4571123579303345,10:0.6361448727632808,11:0.24530754368780872,12:-0.05548152126223768,13:0.44149083806368306,14:0.32674272498608026,15:0.755811640527441,16:0.6747984705118185,17:0.3169864956155609,18:0.5346485128344831,19:0.37463119727580596,20:0.5041963482770885,21:0.3390878707844756,22:0.2696533095790938,23:-0.06118972414932952,24:0.3854038830087774,25:0.4338621752642365,26:0.546503710940206,27:0.261857461595586,28:0.4021994590872773,29:1.3334702096310247,30:0.6158636952839264,31:0.27105580593749395,32:1.061174337637762,33:0.2696890868311552,34:0.8564067556854029,35:0.13520811427252727},\"threshold\":0.6335548635763375},{\"dendrites\":{1:0.04835136137796232,2:-0.12686613242421027,3:0.29637166829430056,4:0.24239594528518588,5:0.6134369761388886,6:0.8608974422845553,7:0.3555939708275826,8:-0.17673327153200372,9:0.20987985717400512,10:0.28434221264693776,11:0.2409307076515411,12:0.46375890629856736,13:0.33196605543509144,14:0.5389882054887085,15:0.7152113524904163,16:0.2616228256933283,17:0.5478744524261299,18:0.349557833469607,19:0.5563688454271275,20:0.29244488310108935,21:-0.22674418274199645,22:0.6028340470378245,23:0.546318250810038,24:0.4873862063999614,25:0.8679487465056529,26:0.12813451400352888,27:0.2129675370736518,28:0.5659760228070683,29:0.27797659313753653,30:0.3189347143655221,31:0.8489647174550218,32:0.6943892965772299,33:0.5302023116100267,34:0.5448209001444516,35:0.15042321133246547},\"threshold\":0.7575553837019298},{\"dendrites\":{1:0.9521559184882041,2:0.8619876679443739,3:0.3010609850191267,4:-0.0344509620673846,5:-0.13759914581506963,6:0.40683592536961516,7:0.04690124151380615,8:1.0173368876184483,9:1.199433904190157,10:0.4020424935128357,11:1.1958338920119842,12:0.05359902926297085,13:0.442506767107261,14:0.7764453647831739,15:-0.08096907617664022,16:1.3753301108977356,17:0.43527810675353035,18:1.1397264549932902,19:0.7905417085543797,20:0.7058375612624342,21:-0.02196427108225332,22:0.15238638798818877,23:0.4882825263529862,24:0.07921604329059662,25:0.278679757741462,26:1.210113345271487,27:1.0993656920048847,28:0.5958992053877409,29:0.4061152733225028,30:0.8584275568372073,31:0.4836873521126818,32:0.5590150412216057,33:1.0279330847860175,34:0.20304021037346687,35:0.9057015731366597},\"threshold\":0.2636878588337292},{\"dendrites\":{1:0.3322458387264257,2:0.8352550103352013,3:0.4067735050592622,4:0.5394489572931047,5:0.737987816959301,6:0.9631207497943103,7:0.2821845920912778,8:0.272401617466448,9:0.663976675476805,10:0.6681964207675661,11:0.3971170903004289,12:0.5357989962983247,13:0.45414120659852764,14:0.6723064702417859,15:0.6582726171317375,16:0.7500572877220858,17:0.3569196121274252,18:0.8122555103066491,19:0.7257151381110599,20:0.3352859260653776,21:-0.024637165566452294,22:0.4524190974573769,23:0.19362832411698944,24:0.24745991191937128,25:0.20575841528270228,26:0.08841266098021185,27:0.05612495088844542,28:0.6476611370144862,29:-0.09643675312783118,30:0.05948708239762503,31:0.8589994302466895,32:0.15953621440855548,33:0.17931218782276984,34:0.4651222837904641,35:0.004389470421472894},\"threshold\":0.6584309718490976}]],\"dnnAvg\":7.554722039,\"dymNerveStudies\":[{\"list\":[0.7420409276352997,0.8209894775060258,0.046279559652834035,0.2936342988849149,0.9239862253994111,0.8279839821942477,0.5566128258076107,0.4631584041045016,0.3250473974710636],\"threshold\":0.752790247857131},{\"list\":[0.6158870331633205,0.45181557957592455,0.9927584363539438,0.2539274540818277,0.3110487406058071,0.8469758106978404,0.5000763100115186,0.4759398013126066,0.004937624215994196],\"threshold\":0.675708942194237},{\"list\":[0.31519447106663656,0.7033543461517842,0.1197621502905899,0.949040645006429,0.5391405760278829,0.913965279996319,0.1803104237409392,0.6413209250564212,0.006057944455254094],\"threshold\":0.2866779367535988}],\"dymOutNerveStudy\":{\"list\":[0.1158193701005863,0.5824115065035881,0.36215110848792853,0.8583226875995783,0.3238312394598135,0.6278868364142066,0.27896792952427796,0.012391816984186454,0.8681656707005733],\"threshold\":0.566356763152684},\"matrixK\":{},\"outNerves\":[{\"dendrites\":{1:0.6362626356594226,2:-0.5608378341349095,3:0.3362922496151163,4:-0.1695991697074301,5:0.39865913495868316,6:0.4740429836922996,7:-0.2402634391468057,8:0.18779392729575706,9:-0.1334378297625433},\"threshold\":-1.1128222688220462},{\"dendrites\":{1:-0.3693618239647306,2:0.35723369329162236,3:-0.30735171421731877,4:0.04034420090683381,5:-0.16861236716900796,6:-0.3044638907372062,7:0.3572034137732162,8:-0.2621799230535107,9:0.18654670947721513},\"threshold\":-0.349780825974247}]}"; public static final String DATA3 = "{\"borderMap\":{},\"depthNerves\":[[{\"dendrites\":{1:-0.47578283876922645,2:0.25361035284142036,3:0.7160439370706159,4:-0.03652656814825689,5:0.5783154673848899,6:0.4557900211183697,7:-0.06853946060004582,8:-0.5374787320598601,9:0.20091879707311303,10:-0.3697292921364848,11:0.24421154625259003,12:0.7582213900307538,13:-0.16974850783889242,14:-0.03940152303695751,15:0.23548348509020806,16:0.6014403221431438,17:0.35547817426678835,18:0.6210766149436667,19:0.26661415646699016,20:0.5583825616604929,21:0.7483676828561064,22:0.5433917218716718,23:-0.001230749600167296,24:0.025078251683870224,25:0.7310410655153967,26:1.1950042573501287,27:0.8515019982596593,28:0.9102698700244091,29:1.0133982064290885,30:0.9474458177617898,31:1.5632191354900822,32:1.4417984314692034,33:0.7419019819844954,34:1.06298014529452,35:1.167628325311264},\"threshold\":0.712475201604175},{\"dendrites\":{1:0.2210460759140201,2:0.10223856175333884,3:0.45349666425709756,4:0.8103257564178863,5:0.16426429375417612,6:0.8420988456642566,7:0.38907779227389877,8:0.9152142382519965,9:0.18250158260269114,10:0.4028456472534935,11:0.3839459334826135,12:0.1490231416621912,13:0.6018867186959436,14:0.8099431338323142,15:0.4654933372601952,16:1.0995537737021426,17:0.6529169801467233,18:1.0307149405799736,19:0.6476317719294152,20:1.2259121514458717,21:0.12307669371573933,22:0.12733691928692567,23:0.773417381020008,24:0.6901303514511037,25:0.48350374777193333,26:0.12776876394777975,27:0.9419085398202361,28:0.6879484698599551,29:0.5205369243501949,30:0.6982716804952239,31:0.454229134449188,32:0.42574281737535263,33:0.3266206257916909,34:0.1679765029330681,35:0.4614502309217239},\"threshold\":0.7324226818966374},{\"dendrites\":{1:0.49415775697954645,2:0.8374454637518293,3:-0.043333533988261584,4:-0.2989568883551582,5:0.9991337119437482,6:0.012470631234929032,7:0.25283384743731074,8:0.16449428960048917,9:0.9845817775615111,10:-0.00165813398656474,11:-0.563910161485814,12:0.4291660995317359,13:0.2608564312367051,14:-0.17308996368276533,15:0.5506648147974829,16:0.1020411637147802,17:0.36069864113455,18:0.2683878517602938,19:0.6357442462905069,20:0.6534911662284106,21:1.5045657049142511,22:1.257677376413893,23:0.19535071254617176,24:0.699437525383934,25:0.030572675059638982,26:1.169154649403698,27:0.08762721851019845,28:1.0370420036785093,29:1.4290450356671305,30:1.2695909690828953,31:0.7935309733832248,32:1.0502830832737242,33:0.564150356329378,34:1.7534209597575015,35:1.3789773840145618},\"threshold\":0.3520568584665965},{\"dendrites\":{1:0.6431094641581983,2:0.7132976155292926,3:0.5574653581312913,4:0.08009055827262929,5:0.5033512998442182,6:0.3439196003244908,7:0.849407408903155,8:0.4043649891470587,9:0.06300970684143943,10:0.742226515264529,11:0.6473441314251747,12:0.48111669410573477,13:0.23308882986536342,14:-0.05881965658626874,15:0.8485442180078595,16:0.16106796043360153,17:0.7438097050725485,18:0.7643717038003933,19:0.7997827518317202,20:0.8556130276777161,21:0.6289984466693352,22:0.052888433002990454,23:0.1040895310360726,24:0.13326238151841258,25:0.9554361430055195,26:0.9704021728665477,27:0.819826579785669,28:0.9052408610484842,29:0.7147762080597372,30:1.0881056779275557,31:0.8634717825480158,32:0.9514793541397598,33:1.165866305185544,34:0.7309549201052485,35:1.0683723438977628},\"threshold\":0.8674282088167221},{\"dendrites\":{1:0.6954574494738188,2:-0.0013018919795619616,3:0.12187599563653842,4:0.6045699086836567,5:0.8745017120485251,6:0.5120472511246185,7:1.096477153595774,8:0.19296180700147358,9:0.13676475388481937,10:0.6624240155161343,11:1.1271147641341777,12:0.4449964249544851,13:-0.02392444383765663,14:1.0099070047545435,15:0.6607699391141874,16:0.5782693540091328,17:0.4003717034522762,18:0.6879380200347469,19:0.9749346174272627,20:0.16218891420628453,21:-0.14405810075180445,22:-0.17432450687522522,23:0.21101122486195306,24:0.6333425677037118,25:0.885196266926744,26:0.9936435988764308,27:0.9229664208990858,28:-0.09784692395214109,29:0.4149795744020192,30:0.6729652605086447,31:1.034367200466997,32:0.1397083104893555,33:0.30439632820697293,34:0.591399518310888,35:0.13726004064813263},\"threshold\":0.0482671075394849},{\"dendrites\":{1:0.9043978696985354,2:0.5114944702041193,3:0.8547913769997153,4:0.656626722813553,5:0.5564805739304622,6:0.18658389314870538,7:0.90118419263876,8:0.25653320504917676,9:0.19374534806615876,10:0.5402916344625995,11:0.8959608625592672,12:0.7626539248327463,13:0.5345843876413,14:0.11705556370547755,15:0.7044204347330826,16:0.43917218634245747,17:0.8550515402786902,18:1.030591054081812,19:1.1139459689579814,20:0.03225224588882324,21:0.3285659259307474,22:0.04776274130394083,23:0.4237353793999157,24:0.9221396900271989,25:0.7299289154059098,26:0.6723838041267668,27:0.43685665726500283,28:0.19528635828370672,29:0.4082214523581449,30:0.30127953297603,31:0.6255510195646445,32:0.7725210248438826,33:0.4270044984322164,34:0.9077900467779042,35:0.054791336773918446},\"threshold\":0.7184258204881401},{\"dendrites\":{1:0.6318876239396358,2:0.17931613068357785,3:1.089750522519565,4:0.6789165107970391,5:1.035512208104859,6:0.9065246149052963,7:0.8502462973121925,8:-0.3357888143358637,9:0.7341258470708674,10:-0.09956658805542824,11:-0.21929023665178413,12:1.022250024353536,13:0.37160901863972234,14:0.08008376524591072,15:0.16257720927101083,16:0.43752235791988403,17:0.5948531662489178,18:0.3479971816646408,19:1.0647396833678673,20:0.39402103474011635,21:0.6858110100415199,22:0.5642181102352418,23:0.09701346370968034,24:0.530588823077516,25:0.29875677325790034,26:1.1561529178424494,27:0.5141757229881521,28:0.9046736141934985,29:0.9298278328107674,30:0.6548452798856871,31:1.2890683119407158,32:1.109890151344512,33:0.9997915381776958,34:1.3794631092351899,35:1.3036999307906136},\"threshold\":0.16134084793032513},{\"dendrites\":{1:0.17870374353217866,2:0.7114703956003448,3:0.7958322331898945,4:0.18169352069149877,5:0.8251160628880929,6:0.05173492934032594,7:0.2161486588024675,8:0.4275604110226431,9:0.11617943887170663,10:0.24062388036111637,11:0.6076824682725707,12:0.7137886405760635,13:-0.09925304227972864,14:0.4533613243400423,15:0.5914331162663737,16:0.4020385927508013,17:0.8227231219208598,18:0.975212398672925,19:1.3548187118396786,20:0.521794255874998,21:0.449922135453937,22:0.7813867808887636,23:0.517516467419692,24:0.6410415532971943,25:0.4385069224893672,26:0.5930629267950435,27:0.18856167141473507,28:0.02347812326854917,29:-0.0917954864977519,30:0.5873243866839859,31:0.8774746156090867,32:0.7199276037379724,33:0.8854582040553278,34:0.3553722071364917,35:0.3993911577875779},\"threshold\":0.16018703405052662},{\"dendrites\":{1:0.6604157179255382,2:0.7417588801083059,3:-0.07842746996704852,4:0.9147230054935125,5:0.08595583186957803,6:0.6342465427091476,7:0.49854581390233954,8:0.37525652400916515,9:0.103833859073775,10:0.5757325375139762,11:0.8375927340783086,12:0.5920033061346183,13:0.450917668868008,14:0.5474741999233096,15:0.9015392563250932,16:0.5393764005783392,17:0.89108742856504,18:0.16444212341910705,19:0.6403011005680834,20:1.0717662759546087,21:-0.304525593513622,22:0.5010307843240901,23:0.3807136735805639,24:0.9069963050200798,25:0.44816000873195416,26:0.5809243524742147,27:1.0738583153965418,28:-0.017258284718131508,29:0.08128990064476473,30:0.29515871434493657,31:0.5961533367085238,32:0.27744733306768654,33:0.18372651440691046,34:0.6726388715787553,35:0.6498352829672713},\"threshold\":0.6730579891999835}]],\"dnnAvg\":7.6125873238,\"dymNerveStudies\":[{\"list\":[0.11336361826267749,0.3152629374625133,0.9760194928696584,0.9891664347587575,0.2797335212804729,0.6006672881903405,0.7519342186503372,0.8018437014201365,0.9600873862726558],\"threshold\":0.1672704783804445},{\"list\":[0.38733049741087344,0.8737258913047904,0.0945098231378132,0.34933299351608016,0.7315921193491124,0.14526202526762055,0.46900481376922853,0.2909286605116036,0.32666625063110843],\"threshold\":0.0323618929774641},{\"list\":[0.4315782334051259,0.31423487520083304,0.05908076855945221,0.35744390656530967,0.17417003252672103,0.1191307189486468,0.0667239796932958,0.7947869399385024,0.564512886131763],\"threshold\":-0.807549953532866}],\"dymOutNerveStudy\":{\"list\":[0.461744792593901,0.886001843426975,0.09192891226500333,0.3164439082281295,0.5870274615392361,0.7850967668439511,0.6309425280509436,0.9203188541377715,0.2614358051696034],\"threshold\":-0.805223727846192},\"matrixK\":{},\"outNerves\":[{\"dendrites\":{1:-0.13833216272361046,2:0.6724283784761534,3:0.05901753325971701,4:0.3169774005624482,5:0.46637989292557513,6:-0.053779277805462884,7:0.01495089273402363,8:0.04565193250755854,9:0.7437691232986713},\"threshold\":0.52776953371034},{\"dendrites\":{1:0.7857343536605664,2:-0.15749831914179838,3:0.681096971348693,4:0.31746419564639194,5:0.5246561528223534,6:0.15248503714394618,7:0.4228718902600013,8:0.2271822243188965,9:0.20163511411877677},\"threshold\":0.3022664051180266}]}"; + public static final String DATA4 = "{\"error\":0,\"modelParameter\":{\"borderMap\":{},\"depthNerves\":[],\"dnnAvg\":0.0,\"dymNerveStudies\":[],\"dymOutNerveStudy\":{\"list\":[],\"threshold\":0.0},\"knnVector\":{1:[[33.0557650862,51.606950431,19.0631734914,72.1523933103,96.915333045,41.0629685698,107.8205402254,132.5688884571,75.7692382433],[33.0557650862,51.606950431,19.0631734914,72.1512256669,96.9087599135,41.0644917087,107.8166278166,132.5666278166,75.7634032634],[38.7367195368,55.681898288,21.8923086606,80.2768912076,101.4235461102,49.9162191192,122.4675675676,138.470777027,93.7081925676],[38.7367195368,55.681898288,21.8923086606,80.270021479,101.420144216,49.9142758515,122.4645150389,138.4656978709,93.7037005745],[37.322616408,52.4771341463,21.1697616408,74.3451235016,97.5777333818,45.9096440247,125.853805175,130.4257990868,92.7568493151],[37.330908839,52.4964671654,21.1767110003,74.3449137148,97.5789736603,45.910626703,125.8551750381,130.4250380518,92.7563926941],[36.8265550239,52.2906100478,20.2608253589,73.0290626636,92.7779280852,42.73525048,116.2301394293,130.5531776913,80.5869001297],[36.8288277512,52.2967703349,20.2639354067,73.0231279455,92.7760080293,42.7280066329,116.2214656291,130.536154345,80.582846952],[36.5029655991,53.627995255,20.5568208778,71.3295217391,94.8153913043,41.4590434783,112.1040470723,129.2634184845,78.1803960964],[36.4866357805,53.6062009979,20.5529817059,71.2919711204,94.7874913013,41.4280184412,112.0652920962,129.2201460481,78.1406786942],[36.4117177522,51.7970945083,19.1639527458,73.4777769774,94.5808961245,40.9536089901,114.5993645925,130.4155346188,83.3765337423],[36.4138463176,51.7981055768,19.1639527458,73.4758285303,94.5787824207,40.9516570605,114.5945028471,130.4091108191,83.3687034604],[37.900860143,57.9724084004,22.3343945487,74.7050714772,99.1244383935,47.9628318584,114.5767709766,136.6422799175,88.9656121045],[37.9081120286,57.9870564606,22.3424458826,74.7182177408,99.1351001499,47.9710791661,114.5698693709,136.6317463046,88.9623581987],[41.7912184284,60.1244153414,20.970357811,80.3918128655,102.9007997936,46.5558135535,119.5210194025,138.0749923006,88.9746689252],[41.8042056075,60.1373247664,20.9775700935,80.3970233999,102.9080781142,46.5628441156,119.5194915254,138.0755007704,88.9765023112],[39.4267350025,58.3670811628,21.3896403966,79.2711113807,102.1907607377,50.2780271779,130.2330228365,145.3688401442,106.921875],[39.1511935209,58.020630861,21.2173913043,78.4731671374,101.4384440624,49.5607884072,127.738372093,143.5064899946,103.7030827474],[39.7527124774,58.4097649186,21.646835443,75.9842540598,98.06484292,48.3252010927,113.0468703868,127.9041186891,83.1919840567],[39.759403255,58.418716094,21.647920434,75.9876309,98.0660191228,48.3246699044,113.0468703868,127.9041186891,83.1919840567]],2:[[80.5652881797,71.0607294041,39.7102735265,145.8842907386,139.0442555686,97.7331770223,194.1744341689,196.9999391579,173.3956558773],[80.5350048844,71.0331325301,39.6974926734,145.8895008202,139.0443520037,97.7292008437,194.1776235695,197.0088872656,173.4072315559],[91.7258791704,85.0154418395,44.5270513977,145.6824911173,140.8492400316,95.8245163837,183.4272600658,182.3663585718,151.7596226893],[91.6642599278,84.9508122744,44.4928925993,145.6692322873,140.8377244918,95.8069370436,183.4207594937,182.3579113924,151.7480379747],[83.6886738759,74.4593056346,38.8420603301,140.590279355,136.5266863502,92.8855325914,177.0609988109,175.5733055886,144.3014863258],[83.641069397,74.4169510808,38.8199658703,140.6017026107,136.5395005675,92.8963677639,177.06592099,175.578236554,144.3074131366],[105.3096601756,94.2051355479,57.3961435662,156.3361187215,150.8578995434,114.6456621005,188.9818301949,193.8885034688,176.1518830525],[105.3073175392,94.2055789071,57.3967329003,156.3077590934,150.8283677573,114.6184426979,188.9686778767,193.8615232443,176.1017969008],[88.0239903668,79.6973879215,45.6845127825,146.3005605628,143.8695317652,102.9233347989,182.6434756644,184.2855329949,158.7251418334],[88.0239903668,79.6973879215,45.6845127825,146.3031002639,143.8687335092,102.9217788039,182.6447761194,184.2875373134,158.7357462687],[93.0734180036,81.6666666667,45.6765819964,146.6119631902,140.7800996933,99.2345667178,181.9414750672,182.1104807405,154.7671693043],[92.9157694033,81.4754374159,45.5203005832,146.5293977055,140.7013384321,99.1641491396,181.936641791,182.105,154.7580597015],[81.0686471297,77.0111401044,40.4066639904,135.2988357717,133.9828456625,88.9549763033,174.7967766117,173.742053973,143.7421289355],[80.8248581848,76.7194084279,40.2205226904,134.8819241983,133.5717930029,88.4201374427,174.3724699325,173.3180551481,143.146450572],[88.2509496676,80.9145299145,47.0477207977,147.4381584492,144.6371154657,105.3813211125,183.1615760538,185.76262472,158.9109651802],[88.2509496676,80.9145299145,47.0477207977,147.4389357218,144.6385669125,105.3873024236,183.1609833062,185.7633346906,158.9111868893],[85.1588560886,73.8625461255,40.1507380074,146.8648415278,141.838683462,98.3715969118,178.3551122195,177.3600374065,147.5278054863],[85.1055843195,73.8149038462,40.1109467456,146.785495716,141.7409730722,98.2423500612,178.2642573766,177.2610339697,147.3990825688],[74.5244852369,72.4103484774,41.5455774739,135.7346207237,134.9049863796,95.5912384372,180.201872158,181.4944782005,155.8170664645],[74.6591386555,72.5513655462,41.6419117647,135.8504540868,135.0158930373,95.7110998991,180.2395551039,181.5350609756,155.8824525745]],3:[[132.578379111,48.0855168052,41.2667148536,125.2243864155,109.6832905251,79.5308219178,207.8087413736,172.0087906671,142.9544035491],[132.5896891379,48.0794324959,41.2706940177,125.2122681883,109.6786733238,79.5161198288,207.7949392047,171.9935918501,142.9384653303],[100.5394040657,36.2860623782,28.0538847118,159.0183281412,81.251298027,62.5884735202,209.5433422699,175.7106047066,148.6439529342],[100.6171853293,36.3032786885,28.0717560433,159.0572884176,81.3006342275,62.6298606779,209.5571535022,175.7383010432,148.6707898659],[122.1525512888,40.8819042609,34.8360073645,171.7611211301,108.3346107604,83.2645776976,221.4100555011,188.6335292197,160.0238328436],[122.3503662365,41.0359696547,34.9361266132,171.943570348,108.7952344932,83.6163388805,221.5,188.7635887361,160.1609364768],[105.5563426046,36.7242656616,28.5969586691,162.0933003177,86.9431414689,66.0648944123,212.1836244541,172.6301310044,144.4942503639],[101.5376004592,35.295924225,27.2408869116,160.5625778331,83.8550080057,63.9085127202,211.4670493197,171.5578939909,143.3592687075],[92.3417547569,26.2965116279,23.0297040169,152.1460522366,62.5153482438,54.4953092165,209.1939259987,172.1772265881,144.6321218075],[92.3417547569,26.2965116279,23.0297040169,152.1506304413,62.5165490844,54.500975683,209.1939259987,172.1772265881,144.6321218075],[134.2643115942,47.4489583333,42.9942934783,175.6344537815,109.9690320573,86.5669934641,216.37943577,178.8439496097,154.2033356991],[134.2758558232,47.4529070821,42.9981887339,175.6308782311,109.9568670196,86.5460915603,216.3777935438,178.8333628946,154.1897836112],[107.3393305917,44.9826936258,35.2210418095,164.5457338691,104.1326518554,79.7980973765,209.9710541901,178.2235712171,150.9501776725],[107.2361843614,44.8839715662,35.1624627379,164.4006493506,103.9283943329,79.6186540732,209.9014458542,178.1157421068,150.8431690764],[126.9252966559,43.4017182925,37.0357142857,167.6724339686,112.841775326,86.932631227,210.7999630587,179.8411525674,152.2783524197],[126.9233970407,43.4027435265,37.0392647965,167.6777480789,112.8434680922,86.9285833612,210.8009053954,179.8409090909,152.2773466371],[127.6268366082,46.3663480262,37.2780138078,172.0615464184,112.7501292992,84.8252521334,213.7019546404,180.9724709042,152.5178304984],[127.6470353982,46.3795132743,37.2932743363,172.0733962752,112.774314537,84.8404681842,213.7019546404,180.9724709042,152.5178304984],[130.0773476244,48.0210366341,41.8678611422,169.8994329553,110.5930620414,87.5504503002,214.2024207012,182.4065108514,154.3513146912],[130.0756678931,48.0180371141,41.8643816989,169.8988492328,110.5826384256,87.5565376918,214.2062813022,182.4157971619,154.364148581]]},\"matrixK\":{},\"outNerves\":[]}}"; }