Options

Attributes do not match

NawafNawaf Member Posts: 16 Learner I
edited December 2020 in Help
Hello, I wanted to create multi-label classifier with 13 labels and I successfully did the training and testing phases. But the problem when I loaded the model, as shown in below image, there was an error message that attributes do not match. 
I attached the model development as well to make sure all good.
Thanks in advance!

Best Answer

  • Options
    lionelderkrikorlionelderkrikor Moderator, RapidMiner Certified Analyst, Member Posts: 1,195 Unicorn
    Solution Accepted
    @Nawaf,

    You can find in attached file a "training process" which gives a special role to all attributes you want to predict (with a Loop attributes operator).
    Please run this "training" process first and then run your "Prediction.rmp" process. In my case, this last process is working fine.

    Hope this helps,

    Regards,

    Lionel 

Answers

  • Options
    Telcontar120Telcontar120 Moderator, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,635 Unicorn
    Probably you have not done the same exact preprocessing ETL in the model development set as in the new data you are trying to apply the model to.  You need to make sure you do all the same transformations, etc., otherwise your model may be trying to use attributes that don't exist or have been modified from their raw form.

    Brian T.
    Lindon Ventures 
    Data Science Consulting from Certified RapidMiner Experts
  • Options
    NawafNawaf Member Posts: 16 Learner I
    I did all the exact preprocessing for both
  • Options
    Telcontar120Telcontar120 Moderator, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,635 Unicorn
    Well, somehow RapidMiner determines that the attributes are not the same, since that is what the error is telling you.  You should do a row by row comparison of the attributes in both files and double check things like attribute names and data types (sometimes a data type will come in one file as numeric and another file as polynominal, or other similar problems).
    Brian T.
    Lindon Ventures 
    Data Science Consulting from Certified RapidMiner Experts
  • Options
    NawafNawaf Member Posts: 16 Learner I
    I will explain how I did it to ensure I'm on the right road. All labels were sat as binomial before importing them. Then I use multi label classification binary relevance (0, 1) in training phase. In application phase, I provide only the texts alongside labels to let machine predict (0 or 1) for each label. As I said I follow the exact preprocessing 
  • Options
    lionelderkrikorlionelderkrikor Moderator, RapidMiner Certified Analyst, Member Posts: 1,195 Unicorn
    Hi @Nawaf,

    In order we can reproduce what you observe and thus understand what is going on, can you please share your process and data ?

    Regards,

    Lionel
  • Options
    NawafNawaf Member Posts: 16 Learner I
    edited December 2020
    This is a sample of the trained data
    This is its main and inner process 

    This is a sample of data need to be predicted

    This is its main and inner process 

    Hopefully you could help me to discover the error
  • Options
    lionelderkrikorlionelderkrikor Moderator, RapidMiner Certified Analyst, Member Posts: 1,195 Unicorn
    @Nawaf,

    To be honest, the pictures you shared are too small to be read, thus these pictures are unusable : 
    Can you please share :  
     - your RM process (.rmp file) via File -> Export Process
     - 
    your different data files (a priori Excel files)

    Thank you for your understanding,

    Regards,

    Lionel
  • Options
    NawafNawaf Member Posts: 16 Learner I
    edited December 2020

  • Options
    NawafNawaf Member Posts: 16 Learner I
    sorry for the confusion, how to remove unrelated file from previous post
  • Options
    lionelderkrikorlionelderkrikor Moderator, RapidMiner Certified Analyst, Member Posts: 1,195 Unicorn
    click on the wheel of your psot and click on "Edit" and delete what you want to delete

    Regards,

    Lionel  : 

    PS : I'm working on your process, I think that you did not connect the wordlist got from your training process (that you Store) to the 
    word input port of your Process documents from data of your "prediction process". 
    This way the word attributes are strictly the same in your "training process" and in your "prediction process" which is a mandatory condition for your "prediction process" to work as explained by @Telcontar120...
  • Options
    NawafNawaf Member Posts: 16 Learner I
    It doesn't allow me to delete attachments

    So wordlist  is the problem?
  • Options
    lionelderkrikorlionelderkrikor Moderator, RapidMiner Certified Analyst, Member Posts: 1,195 Unicorn
    @Nawaf

    Please try this "prediction process" (in attached file) with your real data.
    You will see that I connected the wordlist that you store in your "training process" to the wordlist input port of your Process Documents from Data of your "prediction process".

    Please try it and tell me if the prediction process is working fine now  ….

    Regards,


    Lionel 

    PS : Note that this process will still raise an error because you have only missing values on your testing excel file...
  • Options
    NawafNawaf Member Posts: 16 Learner I
    Thanks a lot!
    Is this model for training or unseen data prediction?
  • Options
    lionelderkrikorlionelderkrikor Moderator, RapidMiner Certified Analyst, Member Posts: 1,195 Unicorn
    @Nawaf,

    The model I shared is for unseen data prediction (to be executed AFTER execution of the training process)

    Regards,

    Lionel
  • Options
    NawafNawaf Member Posts: 16 Learner I
    Why you put multi-label modeling operators again since I already stored it in training phases
  • Options
    NawafNawaf Member Posts: 16 Learner I
    edited December 2020
    I'm not sure if you check both models I did. One for training that worlist and model stored and other one for prediction loaded the stored worlist and model. I attached them 
  • Options
    NawafNawaf Member Posts: 16 Learner I
    edited December 2020
    These
  • Options
    NawafNawaf Member Posts: 16 Learner I
    lionelderkrikor 
    Sorry for the confusion but if you check both files, you can see I divided this model into two phases and did the wordlist connection in prediction file
  • Options
    lionelderkrikorlionelderkrikor Moderator, RapidMiner Certified Analyst, Member Posts: 1,195 Unicorn
    edited December 2020
    @Nawaf ,

    I think I understood:  it is linked to the fact that you did not give a "special role" to the attributes you want to predict (the labels) : 
    To be sure to understand you want to predict all your attributes (surveillance, compulsion etc. ) based on your "Text" attribute" ,right ?

    Regards,

    Lionel
  • Options
    NawafNawaf Member Posts: 16 Learner I
    edited December 2020
    @lionelderkrikor
    I did but gave the same error  
  • Options
    NawafNawaf Member Posts: 16 Learner I
    You are the best, it finally works.
Sign In or Register to comment.