| | |
| | | return error(GlobalErrorCodeConstants.BAD_REQUEST.getCode(),"请重新导入模型参数"); |
| | | } |
| | | JSONArray jsonArray = JSON.parseArray(cache.get(uuid)); |
| | | double[][] data = new double[jsonArray.size()][jsonArray.getJSONArray(0).size()]; |
| | | |
| | | double[][] data = new double[jsonArray.size()][]; |
| | | for (int j = 0; j < jsonArray.size(); j++) { |
| | | data[j] = new double[jsonArray.getJSONArray(j).size()]; |
| | | for (int k = 0; k < jsonArray.getJSONArray(j).size(); k++) { |
| | | data[j][k] = jsonArray.getJSONArray(j).getDoubleValue(k); |
| | | } |
| | |
| | | return error(GlobalErrorCodeConstants.BAD_REQUEST.getCode(),"模型设置错误,请检查!"); |
| | | } |
| | | |
| | | log.info("#######################测试运行模型 " + dto.getPyName() + " ##########################"); |
| | | log.info("参数: " + JSON.toJSONString(paramsValueArray)); |
| | | HashMap result = (HashMap) clazz.getDeclaredMethod(dto.getMethodName(), paramsArray).invoke(clazz.newInstance(), paramsValueArray); |
| | | log.info("model test run result:" + result); |
| | | return success(JSON.toJSONString(result)); |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |