"Sentiment Analysis Problem"

pelstonpelston MemberPosts:3Contributor I
edited June 2019 inHelp
Hello,

I'm trying to run a sentiment analysis using linear svm. I'm reading my data from a sql server. However on the apply model (2) in the xml below I receive the below error each time. Would you have an idea why this is occurring ?

the input example set does not match the training example set. missing attribute aaaa

Paul













<参数键= "查询" value = "SELECT top 1000000 ID, Feed, Sentiment FROM Twitter_Training_Data WHERE Sentiment = 'Positive' UNION ALL SELECT top 1000000 ID, Feed, Sentiment FROM Twitter_Training_Data WHERE Sentiment = 'Negative'"/>



















































<连接from_op = " SVM(线性)”from_port =“模型”to_port="model"/>




























<参数键= "查询" value = "SELECT top 100 id, feed as feed FROM "dbo"."Twitter_Test_Data""/>





































<连接from_op = "读数据库”from_port = " output" to_op="Set Role (3)" to_port="example set input"/>








<连接from_op = "流程文件数据(2)”from_port="example set" to_op="Set Role (2)" to_port="example set input"/>










Answers

  • haddockhaddock MemberPosts:849Maven
    Hi there,

    At first glance I'd suggest that you doallyour pre-processingbeforethe validation, as you are set uponlythe training examples get filtered and re-typed, the testing examples therefore have different attributes and RM gets confused..

    Hope that works!

    Best wishes,

    H
  • pelstonpelston MemberPosts:3Contributor I
    Thanks Haddock.

    Most of the pre-processing is done before it arrives in RM via an ETL process on SQL.

    Are you suggesting removing the below outside of the x-validation operator ?










    Paul
  • haddockhaddock MemberPosts:849Maven
    Yep Indeedy!

    The point is that the training and testing example sets need to have the same attributes; something like the following is better..











    <参数键= "查询" value = "SELECT top 1000000 ID, Feed, Sentiment FROM Twitter_Training_Data WHERE Sentiment = 'Positive' UNION ALL SELECT top 1000000 ID, Feed, Sentiment FROM Twitter_Training_Data WHERE Sentiment = 'Negative'"/>

















































    <连接from_op = " SVM(线性)”from_port =“模型”to_port="model"/>




























    <参数键= "查询" value = "SELECT top 100 id, feed as feed FROM "dbo"."Twitter_Test_Data""/>





































    <连接from_op = "读数据库”from_port = " output" to_op="Set Role (3)" to_port="example set input"/>










    <连接from_op = "流程文件数据(2)”from_port="example set" to_op="Set Role (2)" to_port="example set input"/>










    Ciao,

    H
  • pelstonpelston MemberPosts:3Contributor I
    Thanks for the XML Haddock. Unfortunately I get the same error.

    The input ExampleSet does not match the training ExampleSet. Missing attribute:aaa

    The operator expects the input to have a set of Attributes which is equal or a superset of the ExampleSet used for training of the input model.
    Please make sure that the attributes of the two example sets satisfy this condition.

    Cause: Apply Model
  • haddockhaddock MemberPosts:849Maven
    Hi there,

    Youaretraining on one set of attributes, and testing on another; put a break before each model applier to check that they are all using the same set of attributes.

    Ciao,

    H
Sign InorRegisterto comment.