/** * deserializes the given file and returns the objects from it. * * @param filename the file to deserialize from * @return the deserialized objects * @throws Exception if deserialization fails */ public static Object[] readAll(String filename) throws Exception { return readAll(new FileInputStream(filename)); }
/** * deserializes the given file and returns the objects from it. * * @param filename the file to deserialize from * @return the deserialized objects * @throws Exception if deserialization fails */ public static Object[] readAll(String filename) throws Exception { return readAll(new FileInputStream(filename)); }
data = SerializationHelper.readAll(file.getAbsolutePath()); for (Object obj: data) { if (obj == null)
private void loadModel(String modelPath) throws Exception { if (modelPath != null && modelPath.length() > 0) { try { if (m_env == null) { m_env = Environment.getSystemWide(); } modelPath = m_env.substitute(modelPath); } catch (Exception ex) { // ignore any problems } try { Object[] modelAndHeader = SerializationHelper.readAll(modelPath); if (modelAndHeader.length != 2) { throw new Exception("[InputMappedClassifier] serialized model file " + "does not seem to contain both a model and " + "the instances header used in training it!"); } else { setClassifier((Classifier) modelAndHeader[0]); m_modelHeader = (Instances) modelAndHeader[1]; } } catch (Exception ex) { ex.printStackTrace(); } } }
private void loadModel(String modelPath) throws Exception { if (modelPath != null && modelPath.length() > 0) { try { if (m_env == null) { m_env = Environment.getSystemWide(); } modelPath = m_env.substitute(modelPath); } catch (Exception ex) { // ignore any problems } try { Object[] modelAndHeader = SerializationHelper.readAll(modelPath); if (modelAndHeader.length != 2) { throw new Exception("[InputMappedClassifier] serialized model file " + "does not seem to contain both a model and " + "the instances header used in training it!"); } else { setClassifier((Classifier) modelAndHeader[0]); m_modelHeader = (Instances) modelAndHeader[1]; } } catch (Exception ex) { ex.printStackTrace(); } } }
data = SerializationHelper.readAll(file.getAbsolutePath()); for (Object obj: data) { if (obj == null)
File model = filechooser.getSelectedFile(); try { Object[] objs = SerializationHelper.readAll(model.getAbsolutePath()); MultiLabelClassifier classifier = (MultiLabelClassifier) objs[0]; Instances data = null;
File model = filechooser.getSelectedFile(); try { Object[] objs = SerializationHelper.readAll(model.getAbsolutePath()); MultiLabelClassifier classifier = (MultiLabelClassifier) objs[0]; Instances data = null;
if (Utils.getOptionPos('l',options) >= 0) { lname = Utils.getOption('l',options); Object[] data = SerializationHelper.readAll(lname); MultiLabelClassifier h2 = (MultiLabelClassifier)data[0]; if (h.getClass() != h2.getClass())
if (Utils.getOptionPos('l',options) >= 0) { lname = Utils.getOption('l',options); Object[] data = SerializationHelper.readAll(lname); MultiLabelClassifier h2 = (MultiLabelClassifier)data[0]; if (h.getClass() != h2.getClass())
if (Utils.getOptionPos('l',options) >= 0) { lname = Utils.getOption('l',options); Object[] data = SerializationHelper.readAll(lname); h = (MultiLabelClassifier)data[0]; if (data.length > 1)
if (Utils.getOptionPos('l',options) >= 0) { lname = Utils.getOption('l',options); Object[] data = SerializationHelper.readAll(lname); h = (MultiLabelClassifier)data[0]; if (data.length > 1)