Name |
Type |
Description |
REST_MetaFeatures |
rest |
|
REST_Recommender |
rest |
|
REST_GetTrainedModel |
rest |
|
Question_Level1 |
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,"Predecir el valor de un atributo objetivo");
selectionValues.add(1,"Describir patrones existentes en sus datos") ;
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, "¿Qué acción desea aplicarle a sus datos?",
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();
}
}
technique=answer; |
Question_Level2 |
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 selectionValues1 =new ArrayList();
selectionValues1.add(0,"Tipo texto");
selectionValues1.add(1,"Tipo número") ;
List selectionValues2 =new ArrayList();
selectionValues2.add(0,"Sí");
selectionValues2.add(1,"No");
ButtonGroup group = new ButtonGroup();
JPanel messagePanel = new JPanel();
messagePanel.setLayout(new BoxLayout(messagePanel,BoxLayout.Y_AXIS));
messagePanel.add(new JLabel((message == void ? null : message)));
if (resp1=="Predecir el valor de un atributo objetivo")
{
JRadioButton[] buttonArray = new JRadioButton[selectionValues1.size()];
for (int i = 0; i < buttonArray.length; i++) {
buttonArray[i] = new JRadioButton(selectionValues1.get(i));
if (i==0) buttonArray[i].setSelected(true);
group.add(buttonArray[i]);
messagePanel.add(buttonArray[i]);
}
JOptionPane.showOptionDialog(null, messagePanel, "¿Su variable objetivo es un número o una etiqueta?",
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, new Object[]{"OK"}, null);
for (JRadioButton button : buttonArray) {
if (button.isSelected()) {
resp2=button.getText();
}
}
}
else
{
JRadioButton[] buttonArray2 = new JRadioButton[selectionValues2.size()];
for (int i = 0; i < buttonArray2.length; i++) {
buttonArray2[i] = new JRadioButton(selectionValues2.get(i));
if (i==0) buttonArray2[i].setSelected(true);
group.add(buttonArray2[i]);
messagePanel.add(buttonArray2[i]);
}
JOptionPane.showOptionDialog(null, messagePanel, "¿Desea usted organizar sus datos por grupos?",
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, new Object[]{"OK"}, null);
for (JRadioButton button : buttonArray2) {
if (button.isSelected()) {
resp2=button.getText();
}
}
}
//dire=direccion;
String answer="";
//resp2=answer; |
Question_Level3 |
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 selectionValues1 =new ArrayList();
selectionValues1.add(0,"Futuro");
selectionValues1.add(1,"Pasado") ;
List selectionValues2 =new ArrayList();
selectionValues2.add(0,"Sí");
selectionValues2.add(1,"No");
ButtonGroup group = new ButtonGroup();
JPanel messagePanel = new JPanel();
messagePanel.setLayout(new BoxLayout(messagePanel,BoxLayout.Y_AXIS));
messagePanel.add(new JLabel((message == void ? null : message)));
if (resp3=="Tipo texto")
resp4="Clasificación";
else
{
if (resp3=="Tipo número")
{
JRadioButton[] buttonArray1 = new JRadioButton[selectionValues1.size()];
for (int i = 0; i < buttonArray2.length; i++) {
buttonArray1[i] = new JRadioButton(selectionValues1.get(i));
if (i==0) buttonArray1[i].setSelected(true);
group.add(buttonArray1[i]);
messagePanel.add(buttonArray1[i]);
}
JOptionPane.showOptionDialog(null, messagePanel, "¿La información de sus datos incluye hechos temporales?",
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, new Object[]{"OK"}, null);
for (JRadioButton button : buttonArray1) {
if (button.isSelected()) {
resp4=button.getText();
}
}
}
else
{
if (resp3=="Sí")
resp4="Clustering";
else
{
if (resp3=="No")
{
JRadioButton[] buttonArray2 = new JRadioButton[selectionValues2.size()];
for (int i = 0; i < buttonArray2.length; i++) {
buttonArray2[i] = new JRadioButton(selectionValues2.get(i));
if (i==0)
buttonArray2[i].setSelected(true);
group.add(buttonArray2[i]);
messagePanel.add(buttonArray2[i]);
}
JOptionPane.showOptionDialog(null, messagePanel, "¿Desea usted identificar relaciones no explícitas entre variables?",
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, new Object[]{"OK"}, null);
for (JRadioButton button : buttonArray2) {
if (button.isSelected()) {
resp4=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 |
send_arff_server |
beanshell |
ScriptString urlToConnect = "http://localhost:8080/restTest/apirest/Service/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(); |
Question_Level4 |
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,"Sí");
selectionValues.add(1,"No");
ButtonGroup group = new ButtonGroup();
JPanel messagePanel = new JPanel();
messagePanel.setLayout(new BoxLayout(messagePanel,BoxLayout.Y_AXIS));
messagePanel.add(new JLabel((message == void ? null : message)));
if (resp4=="Clasificación"||"Futuro"||"Pasado"||"Sí")
resp5=resp4;
else
{
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, "¿Desea usted analizar variables basadas en la influencia entre ellas?",
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, new Object[]{"OK"}, null);
for (JRadioButton button : buttonArray1) {
if (button.isSelected()) {
resp5="Análisis Correlacional";
}
}
} |
Select_DataMining_Task |
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,"Predecir el valor de un atributo objetivo");
selectionValues.add(1,"Describir patrones existentes en sus datos") ;
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, "¿Qué acción desea aplicarle a sus datos?",
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();
}
}
technique=answer; |
Comments (0)
No comments yet
Log in to make a comment