The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
Cannot create repository folder
Hi
I am new to making use of the functionalities provided by RapidMiner through a java application by means of the RapidMiner API. I tried out the following code:
I created the repository Repository using the GUI of the Rapid Miner application and adult is a dataset I stored in the repository to apply the operations on it. I cannot understand what's causing the error.
Thanks,
FM
I am new to making use of the functionalities provided by RapidMiner through a java application by means of the RapidMiner API. I tried out the following code:
import java.io.File;However every time I get Cannot create repository folder at '\\Repository\adult'
import com.rapidminer.RapidMiner;
import com.rapidminer.RapidMiner.ExecutionMode;
import com.rapidminer.operator.Operator;
import com.rapidminer.operator.OperatorCreationException;
import com.rapidminer.operator.OperatorException;
import com.rapidminer.operator.io.ModelWriter;
import com.rapidminer.operator.io.RepositorySource;
import com.rapidminer.operator.learner.bayes.NaiveBayes;
import com.rapidminer.repository.RepositoryException;
import com.rapidminer.repository.RepositoryManager;
import com.rapidminer.repository.local.LocalRepository;
import com.rapidminer.tools.OperatorService;
import com.rapidminer.Process;
public class DataMining {
/**
* @param args
* @throws OperatorCreationException
* @throws RepositoryException
*/
public static void main(String[] args) throws OperatorException, OperatorCreationException, RepositoryException {
System.out.println(RapidMiner.getVersion());
String rapidMinerHome = "//rapidminer";
System.setProperty("rapidminer.home", rapidMinerHome);
RapidMiner.setExecutionMode(ExecutionMode.UI);
RapidMiner.init();
File f= new File("//Repository/adult");
LocalRepository local = new LocalRepository("local",f);
RepositoryManager.getInstance(null).addRepository(local);
try {
/* Reading Data */
Operator trainingDataReader = OperatorService.createOperator(RepositorySource.class);
trainingDataReader.setParameter(RepositorySource.PARAMETER_REPOSITORY_ENTRY,"//Repository/adult");
/* Classifier */
Operator bayesClassifier = OperatorService.createOperator(NaiveBayes.class);
/* Save model */
Operator modelWriter = OperatorService.createOperator(ModelWriter.class);
modelWriter.setParameter("model_file", "//repository/test_model");
Process process;
process = new Process();
process.getRootOperator().getSubprocess(0).addOperator(trainingDataReader);
process.getRootOperator().getSubprocess(0).addOperator(bayesClassifier);
process.getRootOperator().getSubprocess(0).addOperator(modelWriter);
trainingDataReader.getOutputPorts().getPortByName("output").connectTo(bayesClassifier.getInputPorts().getPortByName("training set"));
bayesClassifier.getOutputPorts().getPortByName("model").connectTo(modelWriter.getInputPorts().getPortByName("input"));
process.run();
}
catch (OperatorCreationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (OperatorException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
hellothe exception is created when executing process.run()
5.3.000
27 Ott 2012 15:41:32 com.rapidminer.tools.ParameterService init
INFO: Reading configuration resource com/rapidminer/resources/rapidminerrc.
27 Ott 2012 15:41:32 com.rapidminer.tools.I18N <clinit>
INFO: Set locale to en.
27 Ott 2012 15:41:32 com.rapid_i.Launcher ensureRapidMinerHomeSet
INFO: rapidminer.home is '//Repository'.
27 Ott 2012 15:41:45 com.rapidminer.parameter.ParameterTypePassword decryptPassword
WARNING: Password in XML file looks like unencrypted plain text.
27 Ott 2012 15:41:53 com.rapidminer.tools.jdbc.JDBCProperties <init>
WARNING: Missing database driver class name for ODBC Bridge (e.g. Access)
27 Ott 2012 15:41:53 com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver ca.ingres.jdbc.IngresDriver not found. Probably the driver is not installed.
[Fatal Error] :1:1: Premature end of file.
27 Ott 2012 15:41:53 com.rapidminer.repository.local.LocalRepository <init>
WARNING: Failed to create repository directory: com.rapidminer.repository.RepositoryException: Cannot create repository folder at '\\Repository\adult'.
com.rapidminer.repository.RepositoryException: Cannot create repository folder at '\\Repository\adult'.
at com.rapidminer.repository.local.SimpleFolder.mkdir(SimpleFolder.java:69)
at com.rapidminer.repository.local.LocalRepository.<init>(LocalRepository.java:83)
at com.rapidminer.repository.local.LocalRepository.fromXML(LocalRepository.java:199)
at com.rapidminer.repository.RepositoryManager.load(RepositoryManager.java:243)
at com.rapidminer.repository.RepositoryManager.<init>(RepositoryManager.java:145)
at com.rapidminer.repository.RepositoryManager.init(RepositoryManager.java:150)
at com.rapidminer.RapidMiner.init(RapidMiner.java:531)
at DataMining.main(DataMining.java:35)
I created the repository Repository using the GUI of the Rapid Miner application and adult is a dataset I stored in the repository to apply the operations on it. I cannot understand what's causing the error.
Thanks,
FM
Tagged:
0
Answers
I'm not sure what you are trying to do, but what you are actually doing is trying to create new repositories.
I think you're trying to access something in your existing repository, so if that is correct, use this: click
And I will repeat it again and again: Create your desired processes in RapidMiner via the GUI, and then execute them via java. That is the safest and least error-prone way. Do not try and create a process from scratch via OperatorService.createOperator() unless you know exactly what you are doing.
Regards,
Marco