Name |
Type |
Description |
SelectDataMiningTechnique |
beanshell |
Scriptimport javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
List selectionValues =new ArrayList();
selectionValues.add(0,"Clasificación");
selectionValues.add(1,"Reglas de Asociación") ;
selectionValues.add(2, "Series Temporales");
selectionValues.add(3, "Clustering");
ButtonGroup group = new ButtonGroup();
JPanel messagePanel = new JPanel();
messagePanel.setLayout(new BoxLayout(messagePanel,BoxLayout.Y_AXIS));
messagePanel.add(new JLabel((message == void ? null : message)));
JRadioButton[] buttonArray = new JRadioButton[selectionValues.size()];
for (int i = 0; i < buttonArray.length; i++) {
buttonArray[i] = new JRadioButton(selectionValues.get(i));
if (i==0) buttonArray[i].setSelected(true);
group.add(buttonArray[i]);
messagePanel.add(buttonArray[i]);
}
JOptionPane.showOptionDialog(null, messagePanel, "Selecciona Tipo de Técnica de Minería",
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, new Object[]{"OK"}, null);
//dire=direccion;
String answer="";
for (JRadioButton button : buttonArray) {
if (button.isSelected()) {
answer=button.getText();
}
}
|
Load_file |
beanshell |
Scriptimport java.awt.CardLayout;
import java.awt.Image;
import java.awt.Toolkit;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import javax.swing.ImageIcon;
import javax.swing.JEditorPane;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.filechooser.FileFilter;
class FileExtFilter extends FileFilter {
public FileExtFilter(String ext, String label, boolean includeDir) {
this.ext = ext;
this.label = label;
this.includeDir = includeDir;
}
public String getDescription() {
return this.label;
}
public boolean accept(File file) {
if (file.isDirectory() && includeDir) {
return true;
} else {
return file.getName().endsWith(this.ext);
}
}
String ext, label;
boolean includeDir;
}
if (title == void) {
title = "Arff File";
}
if ((fileExtensions == void) || (fileExtensions == null)) {
fileExtensions = ".arff";
}
if ((fileExtLabels == void) || (fileExtLabels == null)) {
fileExtLabels = "";
}
JFileChooser chooser = new JFileChooser();
chooser.setDialogTitle(title);
String[] fileTypeList = fileExtensions.split(",");
String[] filterLabelList = fileExtLabels.split(",");
if (fileTypeList != null && filterLabelList != null && fileTypeList.length != filterLabelList.length) {
throw new RuntimeException("The list of extensions and file filter labels must be the same length");
}
// create the file filters
for (int i = 0; i < fileTypeList.length; i++) {
FileExtFilter filter = new FileExtFilter(fileTypeList[i], filterLabelList[i], true);
chooser.setFileFilter(filter);
}
chooser.showOpenDialog(null);
File file = chooser.getSelectedFile();
selectedFile = file.getAbsolutePath();//arff path
selectedFileReplace = selectedFile.replace("\\", "_");
selectedFileReplace = selectedFileReplace.replace(":", "-");
name = file.getName();//name |
Metacharacteristics_nested_workflow |
workflow |
|
Select_Measure_of_Performance |
beanshell |
Scriptimport javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
List selectionValues =new ArrayList();
selectionValues.add(0,"Correctos");
selectionValues.add(1,"Cobertura") ;
selectionValues.add(2, "Precisión");
ButtonGroup group = new ButtonGroup();
JPanel messagePanel = new JPanel();
messagePanel.setLayout(new BoxLayout(messagePanel,BoxLayout.Y_AXIS));
messagePanel.add(new JLabel((message == void ? null : message)));
JRadioButton[] buttonArray = new JRadioButton[selectionValues.size()];
for (int i = 0; i < buttonArray.length; i++) {
buttonArray[i] = new JRadioButton(selectionValues.get(i));
if (i==0) buttonArray[i].setSelected(true);
group.add(buttonArray[i]);
messagePanel.add(buttonArray[i]);
}
JOptionPane.showOptionDialog(null, messagePanel, "Selecciona Tipo de Técnica de Minería",
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, new Object[]{"OK"}, null);
//dire=direccion;
String answer="";
for (JRadioButton button : buttonArray) {
if (button.isSelected()) {
answer=button.getText();
}
}
|
DataMiningAlgorithms_nested_workflow |
workflow |
|
Performance_Method |
beanshell |
Scriptimport javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
List selectionValues =new ArrayList();
selectionValues.add(0,"Cross-validation");
selectionValues.add(1,"Percentage Split") ;
ButtonGroup group = new ButtonGroup();
JPanel messagePanel = new JPanel();
messagePanel.setLayout(new BoxLayout(messagePanel,BoxLayout.Y_AXIS));
messagePanel.add(new JLabel((message == void ? null : message)));
JRadioButton[] buttonArray = new JRadioButton[selectionValues.size()];
for (int i = 0; i < buttonArray.length; i++) {
buttonArray[i] = new JRadioButton(selectionValues.get(i));
if (i==0) buttonArray[i].setSelected(true);
group.add(buttonArray[i]);
messagePanel.add(buttonArray[i]);
}
JOptionPane.showOptionDialog(null, messagePanel, "Selecciona Tipo de Técnica de Minería",
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, new Object[]{"OK"}, null);
//dire=direccion;
String answer="";
for (JRadioButton button : buttonArray) {
if (button.isSelected()) {
answer=button.getText();
}
}
|
REST_InformationforModel |
rest |
|
send_arff_server |
beanshell |
ScriptString urlToConnect = "http://localhost:8080/restTest/apirest/Service/putExample/upload";
String paramToSend = "fubar";
File fileToUpload = new File(direccionArff);
String boundary = Long.toHexString(System.currentTimeMillis()); // Just generate some unique random value.
URLConnection connection = new URL(urlToConnect).openConnection();
connection.setDoOutput(true); // This sets request method to POST.
connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary);
PrintWriter writer = null;
try {
writer = new PrintWriter(new OutputStreamWriter(connection.getOutputStream(), "UTF-8"));
writer.println("--" + boundary);
writer.println("Content-Disposition: form-data; name=\"paramToSend\"");
writer.println("Content-Type: text/plain; charset=UTF-8");
writer.println();
writer.println(paramToSend);
writer.println("--" + boundary);
writer.println("Content-Disposition: form-data; name=\"fileToUpload\"; filename="+name);
writer.println("Content-Type: text/plain; charset=UTF-8");
writer.println();
BufferedReader reader = null;
try {
reader = new BufferedReader(new InputStreamReader(new FileInputStream(fileToUpload), "UTF-8"));
for (String line; (line = reader.readLine()) != null;) {
writer.println(line);
}
} finally {
if (reader != null) try { reader.close(); } catch (IOException logOrIgnore) {}
}
writer.println("--" + boundary + "--");
} finally {
if (writer != null) writer.close();
}
// Connection is lazily executed whenever you request any status.
int responseCode = ((HttpURLConnection) connection).getResponseCode();
System.out.println(responseCode); // Should be 200
//nombre=fileToUpload.getName();
//selectedpath=fileToUpload.getAbsolutePath(); |
Comments (0)
No comments yet
Log in to make a comment