Examples of MemoryExampleTable


Examples of com.rapidminer.example.table.MemoryExampleTable

               Attribute m2 = AttributeFactory.createAttribute("MAE", Ontology.REAL);
               Attribute m3 = AttributeFactory.createAttribute("NMAE", Ontology.REAL);
             
              List<Attribute> attr=new ArrayList<Attribute>();
              attr.add(m1); attr.add(m2); attr.add(m3);
              MemoryExampleTable a=new MemoryExampleTable(attr);
             
              Map<String,Double> res;
              int minR=getParameterAsInt("Min Rating");
              int maxR=getParameterAsInt("Range")+minR;
              res=RatingEval.Evaluate(predicted,minR,maxR);
              double [] a1={res.get("RMSE"),res.get("MAE"),res.get("NMAE")};
              DoubleArrayDataRow row=new DoubleArrayDataRow(a1);
              a.addDataRow(row);
             
              PerformanceVector result1 = new PerformanceVector();
              EstimatedPerformance performance = new EstimatedPerformance("RMSE", a1[0],1,true);
              EstimatedPerformance performance1 = new EstimatedPerformance("MAE", a1[1],1,true);
              EstimatedPerformance performance2 = new EstimatedPerformance("NMAE", a1[2],1,true);

              result1.addCriterion(performance);
              result1.addCriterion(performance1);
              result1.addCriterion(performance2);

            performanceOutput.deliver(result1);
            exampleSetOutput.deliver(a.createExampleSet())

        }
View Full Code Here

Examples of com.rapidminer.example.table.MemoryExampleTable

            attribute[i] = AttributeFactory.createAttribute(i + "", Ontology.NUMERICAL);
            attribute[i].setTableIndex(i);
        }

        DataRowFactory dataRowFactory = new DataRowFactory(DataRowFactory.TYPE_DOUBLE_ARRAY, '.');
        MemoryExampleTable memoryExampleTable = new MemoryExampleTable(attribute);

        for (Map.Entry<double[], String> entry : itemClassMap.entrySet()) {
            Double[] values = convertdoubleToDoubleArray(entry.getKey(), entry.getValue());
            DataRow rmRow = dataRowFactory.create(values, attribute);
            memoryExampleTable.addDataRow(rmRow);
        }

        ExampleSet newExampleSet = memoryExampleTable.createExampleSet();

        return newExampleSet;

    }
View Full Code Here

Examples of com.rapidminer.example.table.MemoryExampleTable

               Attribute a1 = AttributeFactory.createAttribute("rank", Ontology.INTEGER);
               Attribute tu = AttributeFactory.createAttribute("user_id", Ontology.INTEGER);
               Attribute ti = AttributeFactory.createAttribute("item_id", Ontology.INTEGER);
                attr.add(tu); attr.add(ti); attr.add(a1);
               
                MemoryExampleTable a=new MemoryExampleTable(attr);
                com.rapidminer.data.CompactHashSet<Integer> s=new com.rapidminer.data.CompactHashSet<Integer>();

              for(int i1=0;i1<testU.size();i1++){
               
                s=model.feedback.GetUserMatrix().getL(testU.get(i1));//trainU
               
                data1=PredictItemsFast.PredictItemsFast1(model, testU.get(i1), relevant_items,s, N);

                int cn=0;
                int tr=model.user_mapping.ToOriginalID(testU.get(i1));
                   
                 
               
                for(int i2=0;i2<data1.size();i2++){
                    if(!s.contains(data1.get(i2).item_id)){
                      int[] dat={tr,model.item_mapping.ToOriginalID(data1.get(i2).item_id),cn+1};
                    IntArrayDataRow row=new IntArrayDataRow(dat);
                      a.addDataRow(row);
                      cn++;
                      if(cn==N)
                        break;
                    }
                }
                data1.clear();

              }
             
               exampleSetOutput.deliver(a.createExampleSet())
               exampleSetOutput1.deliver(model);
             
              }
View Full Code Here

Examples of com.rapidminer.example.table.MemoryExampleTable

               Attribute m5 = AttributeFactory.createAttribute("NDCG", Ontology.REAL);
               Attribute m6 = AttributeFactory.createAttribute("MAP", Ontology.REAL);
              
              List<Attribute> attr=new ArrayList<Attribute>();
              attr.add(m1); attr.add(m2); attr.add(m3); attr.add(m4); attr.add(m5); attr.add(m6);
              MemoryExampleTable a=new MemoryExampleTable(attr);
             
             
              double [] a1={result.get("AUC"),result.get("prec@5"),result.get("prec@10"), result.get("prec@15"),result.get("NDCG"),result.get("MAP")};
              DoubleArrayDataRow row=new DoubleArrayDataRow(a1);
              a.addDataRow(row);
             
            PerformanceVector result1 = new PerformanceVector();
            EstimatedPerformance performance = new EstimatedPerformance("AUC", a1[0],1,false);
            EstimatedPerformance performance1 = new EstimatedPerformance("prec@5", a1[1],1,false);
            EstimatedPerformance performance2 = new EstimatedPerformance("prec@10", a1[2],1,false);
            EstimatedPerformance performance3 = new EstimatedPerformance("prec@15", a1[3],1,false);
            EstimatedPerformance performance4 = new EstimatedPerformance("NDCG", a1[4],1,false);
            EstimatedPerformance performance5 = new EstimatedPerformance("MAP", a1[5],1,false);
            result1.addCriterion(performance);
            result1.addCriterion(performance1);
            result1.addCriterion(performance2);
            result1.addCriterion(performance3);
            result1.addCriterion(performance4);
            result1.addCriterion(performance5);
           
           
            performanceOutput.deliver(result1);
            exampleSetOutput.deliver(a.createExampleSet())
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.