Package com.rapidminer.example

Examples of com.rapidminer.example.Attributes


  @Override
  public void doWork() throws OperatorException {
   
    ExampleSet exampleSet = exampleSetInput.getData();
    Attributes attributes = exampleSet.getAttributes();
   
    for(Attribute a : attributes)
      System.out.println(a.toString());
       
    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);
View Full Code Here


         
         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);
View Full Code Here

                      throw new UserError(this,105);
                  }
           
            boolean OU = getParameterAsBoolean("Online updates");
           
            Attributes Att = exampleSet.getAttributes();
            AttributeRole ur=Att.getRole("user identification");
            Attribute u=ur.getAttribute();
            AttributeRole ir=null;
            Attribute i=null;
           
          if(OU==true){
            if(Att.getRole("item identification")!=null){
              ir=Att.getRole("item identification");
              i=ir.getAttribute();
            }
          }
       
            ItemRecommender model = exampleSetInput1.getData();
             int N=getParameterAsInt("n");
            
              List<Attribute> attr=new ArrayList<Attribute>();
       
              com.rapidminer.data.CompactHashSet<Integer> s1=new com.rapidminer.data.CompactHashSet<Integer>();
             
             
              ArrayList<Integer> new_users=new ArrayList<Integer>();
              ArrayList<Integer> new_items=new ArrayList<Integer>();
             
             
              ArrayList<Integer> feed_it=null;
              ArrayList<Integer> feed_us=null;
              int use_feedUpdate=0;
              if(model.AddFeedbacks(null, null)==1){
                feed_it=new ArrayList<Integer>();
                feed_us=new ArrayList<Integer>();
                use_feedUpdate=1;
              }
             
               if(N>model.MaxItemID)
                 N=model.MaxItemID+1;
             
              com.rapidminer.data.CompactHashSet<Integer> s2=new com.rapidminer.data.CompactHashSet<Integer>();
              com.rapidminer.data.CompactHashSet<Integer> s3=new com.rapidminer.data.CompactHashSet<Integer>();
             
              for (Example example : exampleSet) {
                double j=example.getValue(u);
                int uid=model.user_mapping.ToInternalID((int) j);
                double j1=0;
                int iid=0;
 
            if(OU==true){
             
              if(uid>model.feedback.GetMaxUserID()){
                new_users.add(uid);
              }
             
              if(Att.getRole("item identification")!=null){
                  j1=example.getValue(i);
                  iid=model.item_mapping.ToInternalID((int) j1);
               
                if(iid>model.feedback.GetMaxItemID()){
                    new_items.add(iid);
View Full Code Here

             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();
           
            if (attribute_set.getAttributes().getSpecial("user identification") == null) {
                    throw new UserError(this,105);
                }
           
            if (attribute_set.getAttributes().getSpecial("attribute identification") == null) {
                    throw new UserError(this, 105);
                }
           
            Attributes aatr = attribute_set.getAttributes();
            AttributeRole ar=aatr.getRole("attribute identification");
            Attribute at=ar.getAttribute();
            ur=aatr.getRole("user identification");
            i=ur.getAttribute();

            SparseBooleanMatrix mat=new SparseBooleanMatrix();
           
           
View Full Code Here

  @Override
  public void doWork() throws OperatorException {
       
    ExampleSet exampleSet = exampleSetInput.getData();
    ExampleSet exampleSet1=exampleSetInput1.getData();
    Attributes attributes1=exampleSet1.getAttributes();
       
     if (exampleSet.getAttributes().getSpecial("user identification") == null) {
              throw new UserError(this,105);
          }
    
     if (exampleSet.getAttributes().getSpecial("item identification") == null) {
              throw new UserError(this,105);
          }
     
    if (exampleSet1.getAttributes().getSpecial("item identification") == null) {
              throw new UserError(this, 105);
          }
   
    if (exampleSet1.getAttributes().getSpecial("user 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();
       
        AttributeRole tur=attributes1.getRole("user identification");
        Attribute tu=tur.getAttribute();
View Full Code Here

TOP

Related Classes of com.rapidminer.example.Attributes

Copyright © 2018 www.massapicom. 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.