Examples of IPosOnlyFeedback


Examples of com.rapidminer.data.IPosOnlyFeedback

    @Override
    public void doWork() throws OperatorException {
     
      ExampleSet exampleSet = exampleSetInput.getData();
         
           IPosOnlyFeedback training_data=new PosOnlyFeedback();
           IEntityMapping user_mapping=new EntityMapping();
           IEntityMapping item_mapping=new EntityMapping();
         
           if (exampleSet.getAttributes().getSpecial("user identification") == null) {
                    throw new UserError(this,105);
                }
           
            if (exampleSet.getAttributes().getSpecial("item identification") == null) {
                    throw new UserError(this, 105);
                }
          
          Attributes Att = exampleSet.getAttributes();
          AttributeRole ur=Att.getRole("user identification");
          Attribute u=ur.getAttribute();
          AttributeRole ir=Att.getRole("item identification");
          Attribute i=ir.getAttribute();


          for (Example example : exampleSet) {
           
            double j=example.getValue(u);
            int uid=(int) j;

            j=example.getValue(i);
            int iid=(int) j;
           
            training_data.Add(user_mapping.ToInternalID(uid), item_mapping.ToInternalID(iid));
            checkForStop();
          }
         
       
           System.out.println(training_data.GetMaxItemID()+" "+training_data.GetMaxUserID());
         
          
          Random recommendAlg=new Random();
           recommendAlg.SetFeedback(training_data);
           recommendAlg.user_mapping=user_mapping;
View Full Code Here

Examples of com.rapidminer.data.IPosOnlyFeedback

  @Override
  public void doWork() throws OperatorException {
   
    ExampleSet exampleSet = exampleSetInput.getData();
       
         IPosOnlyFeedback training_data=new PosOnlyFeedback();
         IEntityMapping user_mapping=new EntityMapping();
         IEntityMapping item_mapping=new EntityMapping();
       
        
         if (exampleSet.getAttributes().getSpecial("user identification") == null) {
                  throw new UserError(this,105);
              }
         
         if (exampleSet.getAttributes().getSpecial("item identification") == null) {
                  throw new UserError(this, 105);
              }
        
         Attributes Att = exampleSet.getAttributes();
         AttributeRole ur=Att.getRole("user identification");
         Attribute u=ur.getAttribute();
         AttributeRole ir=Att.getRole("item identification");
         Attribute i=ir.getAttribute();
       
        for (Example example : exampleSet) {
         
          double j=example.getValue(u);
          int uid=(int) j;

          j=example.getValue(i);
          int iid=(int) j;
         
     
          training_data.Add(user_mapping.ToInternalID(uid), item_mapping.ToInternalID(iid))
           checkForStop();
        }
       
     
        boolean isW = getParameterAsBoolean("Weighted Knn");
View Full Code Here

Examples of com.rapidminer.data.IPosOnlyFeedback

       
    System.out.println(exampleSet.size());
        System.out.println(attributes.size());
       
       
         IPosOnlyFeedback training_data=new PosOnlyFeedback();
         IEntityMapping user_mapping=new EntityMapping();
         IEntityMapping item_mapping=new EntityMapping();
        
         if (exampleSet.getAttributes().getSpecial("user identification") == null) {
                  throw new UserError(this,105);
              }
         
         if (exampleSet.getAttributes().getSpecial("item identification") == null) {
                  throw new UserError(this, 105);
              }
       
        
         Attributes Att = exampleSet.getAttributes();
         AttributeRole ur=Att.getRole("user identification");
         Attribute u=ur.getAttribute();
         AttributeRole ir=Att.getRole("item identification");
         Attribute i=ir.getAttribute();
       
        for (Example example : exampleSet) {
         
          double j=example.getValue(u);
          int uid=(int) j;

          j=example.getValue(i);
          int iid=(int) j;
         
          training_data.Add(user_mapping.ToInternalID(uid), item_mapping.ToInternalID(iid));
          checkForStop();
        }       
        
        MostPopular recommendAlg=new MostPopular();
         recommendAlg.SetFeedback(training_data);
View Full Code Here

Examples of com.rapidminer.data.IPosOnlyFeedback

  @Override
  public void doWork() throws OperatorException {
   
    ExampleSet exampleSet = exampleSetInput.getData();
       
         IPosOnlyFeedback training_data=new PosOnlyFeedback();
         IEntityMapping user_mapping=new EntityMapping();
         IEntityMapping item_mapping=new EntityMapping();
       
         if (exampleSet.getAttributes().getSpecial("user identification") == null) {
                  throw new UserError(this,105);
              }
         
         if (exampleSet.getAttributes().getSpecial("item identification") == null) {
                  throw new UserError(this, 105);
              }
        
         Attributes Att = exampleSet.getAttributes();
         AttributeRole ur=Att.getRole("user identification");
         Attribute u=ur.getAttribute();
         AttributeRole ir=Att.getRole("item identification");
         Attribute i=ir.getAttribute();
         
        for (Example example : exampleSet) {
         
          double j=example.getValue(u);
          int uid=(int) j;

          j=example.getValue(i);
          int iid=(int) j;
         
          training_data.Add(user_mapping.ToInternalID(uid), item_mapping.ToInternalID(iid));
          checkForStop();
        }
       
     
        boolean isW = getParameterAsBoolean("Weighted Knn");
View Full Code Here

Examples of com.rapidminer.data.IPosOnlyFeedback

         
      System.out.println(exampleSet.size());
          System.out.println(attributes.size());
         
         
           IPosOnlyFeedback training_data=new PosOnlyFeedback();
           IEntityMapping user_mapping=new EntityMapping();
           IEntityMapping item_mapping=new EntityMapping();
           IEntityMapping attribute_mapping=new EntityMapping();
          
           if (exampleSet.getAttributes().getSpecial("user identification") == null) {
                    throw new UserError(this,105);
                }
           
           if (exampleSet.getAttributes().getSpecial("item identification") == null) {
                    throw new UserError(this, 105);
                }
          
          
           Attributes Att = exampleSet.getAttributes();
           AttributeRole ur=Att.getRole("user identification");
           Attribute u=ur.getAttribute();
           AttributeRole ir=Att.getRole("item identification");
           Attribute i=ir.getAttribute();
          
          for (Example example : exampleSet) {
           
            double j=example.getValue(u);
            int uid=(int) j;

            j=example.getValue(i);
            int iid=(int) j;
           
            training_data.Add(user_mapping.ToInternalID(uid), item_mapping.ToInternalID(iid));
            checkForStop();
          }
         
          ExampleSet attribute_set=exampleSetInput1.getData();
         
View Full Code Here

Examples of com.rapidminer.data.IPosOnlyFeedback

  public void doWork() throws OperatorException {
   
    ExampleSet exampleSet = exampleSetInput.getData();
   
       
         IPosOnlyFeedback training_data=new PosOnlyFeedback();
         IEntityMapping user_mapping=new EntityMapping();
         IEntityMapping item_mapping=new EntityMapping();
       
        
         if (exampleSet.getAttributes().getSpecial("user identification") == null) {
                  throw new UserError(this,105);
              }
         
         if (exampleSet.getAttributes().getSpecial("item identification") == null) {
                  throw new UserError(this, 105);
              }
        
        Attributes Att = exampleSet.getAttributes();
        AttributeRole ur=Att.getRole("user identification");
        Attribute u=ur.getAttribute();
        AttributeRole ir=Att.getRole("item identification");
        Attribute i=ir.getAttribute();

       
        for (Example example : exampleSet) {
         
          double j=example.getValue(u);
          int uid=(int) j;

          j=example.getValue(i);
          int iid=(int) j;
       
          training_data.Add(user_mapping.ToInternalID(uid), item_mapping.ToInternalID(iid));
           checkForStop();
        }
       
       
        BPRMF recommendAlg=new BPRMF();
View Full Code Here

Examples of com.rapidminer.data.IPosOnlyFeedback

  @Override
  public void doWork() throws OperatorException {
   
    ExampleSet exampleSet = exampleSetInput.getData();
       
         IPosOnlyFeedback training_data=new PosOnlyFeedback();
         IEntityMapping user_mapping=new EntityMapping();
         IEntityMapping item_mapping=new EntityMapping();
       
         if (exampleSet.getAttributes().getSpecial("user identification") == null) {
                  throw new UserError(this,105);
              }
         
         if (exampleSet.getAttributes().getSpecial("item identification") == null) {
                  throw new UserError(this, 105);
              }
        
         Attributes Att = exampleSet.getAttributes();
         AttributeRole ur=Att.getRole("user identification");
         Attribute u=ur.getAttribute();
         AttributeRole ir=Att.getRole("item identification");
         Attribute i=ir.getAttribute();
       
        for (Example example : exampleSet) {
         
          double j=example.getValue(u);
          int uid=(int) j;

          j=example.getValue(i);
          int iid=(int) j;
          training_data.Add(user_mapping.ToInternalID(uid), item_mapping.ToInternalID(iid));
           checkForStop();
        }
     
        WRMF recommendAlg=new WRMF();
        
View Full Code Here

Examples of com.rapidminer.data.IPosOnlyFeedback

      @Override
      public void doWork() throws OperatorException {
       
        ExampleSet exampleSet = exampleSetInput.getData();   
           
             IPosOnlyFeedback training_data=new PosOnlyFeedback();
             IEntityMapping user_mapping=new EntityMapping();
             IEntityMapping item_mapping=new EntityMapping();
           
             if (exampleSet.getAttributes().getSpecial("user identification") == null) {
                      throw new UserError(this,105);
                  }
             
             if (exampleSet.getAttributes().getSpecial("item identification") == null) {
                      throw new UserError(this, 105);
                  }
            
            
             Attributes Att = exampleSet.getAttributes();
             AttributeRole ur=Att.getRole("user identification");
             Attribute u=ur.getAttribute();
             AttributeRole ir=Att.getRole("item identification");
             Attribute i=ir.getAttribute();
           
            for (Example example : exampleSet) {
             
              double j=example.getValue(u);
              int uid=(int) j;

              j=example.getValue(i);
              int iid=(int) j;
             
              training_data.Add(user_mapping.ToInternalID(uid), item_mapping.ToInternalID(iid));
              checkForStop();
            }
           
           
            ExampleSet attribute_set=exampleSetInput1.getData();
View Full Code Here

Examples of com.rapidminer.data.IPosOnlyFeedback

        Attribute ti=tir.getAttribute();

   
        ItemRecommender model = exampleSetInput2.getData();
   
           IPosOnlyFeedback train_data=new PosOnlyFeedback();
           IPosOnlyFeedback test_data=new PosOnlyFeedback();
           IEntityMapping user_mapping=model.user_mapping;//new EntityMapping();
           IEntityMapping item_mapping=model.item_mapping;//new EntityMapping();
         

          for (Example example : exampleSet) {
            double j=example.getValue(u);
            int uid=(int) j;

            j=example.getValue(i);
            int iid=(int) j;
            train_data.Add(user_mapping.ToInternalID(uid), item_mapping.ToInternalID(iid));
        }
         
          for (Example example : exampleSet1) {
            double j=example.getValue(tu);
            int uid=(int) j;

            j=example.getValue(ti);
            int iid=(int) j;
            test_data.Add(user_mapping.ToInternalID(uid), item_mapping.ToInternalID(iid));
       
         
         
           Map<String,Double> result= ItemPredictionEval.Evaluate(model, test_data,train_data,test_data.GetAllUsers(),train_data.GetAllItems()); //train_data.GetAllUsers(),train_data.GetAllItems()

               Attribute m1 = AttributeFactory.createAttribute("AUC", Ontology.REAL);
               Attribute m2 = AttributeFactory.createAttribute("prec@5", Ontology.REAL);
               Attribute m3 = AttributeFactory.createAttribute("prec@10", Ontology.REAL);
               Attribute m4 = AttributeFactory.createAttribute("prec@15", Ontology.REAL);
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.