One-class SVM for text classfication

In777In777 MemberPosts:29Contributor II
edited November 2018 inHelp

I classify several examples (each example is a small text) using the one-class SVM. I got a problem that I cannot fix "Needs a nominal label with 2 or more values". I tried to set role for the label, to change the label to numerical, to use meta "Polynomial to binominal". Nothing worked. n the last case I got a messsage that there is no obvious mistake, but still the program does not give me any results. There were some posts here related to the topic, but there is still no correct answer. I would appreciate any help. Here is my original xml, It works for LibSVM in multi-class case:

< ?xml version = " 1.0 " encoding = " utf - 8 "独立= " no"?>                                                                           

Best Answer

  • MartinLiebigMartinLiebig 管理员、版主、员工,RapidMiner Certified Analyst, RapidMiner Certified Expert, University ProfessorPosts:3,404RM Data Scientist
    Solution Accepted

    Hi

    i've checked it again. it is the other way around. you need to have a nominal coloum with only one class as label. See attached process.

    ~Martin

    Spoiler
    < ?xml version = " 1.0 " encoding = " utf - 8 "独立= " no"?>






    <运营商激活= " true " class = "process" compatibility="7.1.001" expanded="true" name="Process">

    <运营商激活= " true " class = "retrieve" compatibility="7.1.001" expanded="true" height="68" name="Retrieve Golf" width="90" x="45" y="34">


    <运营商激活= " true " class = "nominal_to_numerical" compatibility="7.1.001" expanded="true" height="103" name="Nominal to Numerical" width="90" x="179" y="34">


    <运营商激活= " true " class = "select_attributes" compatibility="7.1.001" expanded="true" height="82" name="Select Attributes" width="90" x="313" y="34">





    <运营商激活= " true " class = "generate_attributes" compatibility="7.1.001" expanded="true" height="82" name="Generate Attributes" width="90" x="447" y="34">




    <运营商激活= " true " class = "set_role" compatibility="7.1.001" expanded="true" height="82" name="Set Role" width="90" x="581" y="34">




    <运营商激活= " true " class = "support_vector_machine_libsvm" compatibility="7.1.001" expanded="true" height="82" name="SVM" width="90" x="782" y="34">















    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany

Answers

  • bhupendra_patilbhupendra_patil Administrator, Employee, MemberPosts:168RM Data Scientist

    hello@In777

    Not sure if I this solves your issue, but typical problems when doing type conversion and your column is has a special role (e.g columns like labels , weights etc.) is folks do not check the "inclide special attributes" checkbox.

    Can you confirm if that was not the case

  • MartinLiebigMartinLiebig 管理员、版主、员工,RapidMiner Certified Analyst, RapidMiner Certified Expert, University ProfessorPosts:3,404RM Data Scientist

    Dear@In777,

    thanks for reaching out. The LibSVM One class svm is sometimes a bit confusing. You acutually need to have a binary label to do it. The second class needs to have 0 examples.

    ~Martin

    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • In777In777 MemberPosts:29Contributor II

    I do not think that the problem is with the transformation. I modified my workflow, but it still does not work. I got a message about bug report. Here is my xml:

    l version="1.0" encoding="UTF-8" standalone="no"?>






    <运营商激活= " true " class = "process" compatibility="6.0.002" expanded="true" name="Process">

    <运营商激活= " true " class = "text:process_document_from_file" compatibility="7.1.001" expanded="true" height="82" name="Process Categories" width="90" x="112" y="85">






    <运营商激活= " true " class = "text:tokenize" compatibility="7.1.001" expanded="true" height="68" name="Tokenize" width="90" x="45" y="34"/>
    <运营商激活= " true " class = "text:filter_stopwords_english" compatibility="7.1.001" expanded="true" height="68" name="Filter Stopwords (English)" width="90" x="179" y="34"/>
    <运营商激活= " true " class = "text:stem_porter" compatibility="7.1.001" expanded="true" height="68" name="Stem (Porter)" width="90" x="313" y="34"/>
    <运营商激活= " true " class = "text:generate_n_grams_terms" compatibility="7.1.001" expanded="true" height="68" name="Generate n-Grams (Terms)" width="90" x="447" y="34">












    <运营商激活= " true " class = "x_validation" compatibility="7.1.001" expanded="true" height="124" name="Validation" width="90" x="380" y="85">


    <运营商激活= " true " class = "filter_examples" compatibility="6.4.000" expanded="true" height="103" name="Filter Examples" width="90" x="45" y="34">




    <运营商激活= " true " class = "select_attributes" compatibility="7.1.001" expanded="true" height="82" name="Select Attributes" width="90" x="180" y="30">





    <运营商激活= " true " class = "generate_attributes" compatibility="6.4.000" expanded="true" height="82" name="Generate Attributes" width="90" x="45" y="187">




    <运营商激活= " true " class = "set_role" compatibility="5.3.013" expanded="true" height="82" name="Set Role" width="90" x="179" y="187">




    <运营商激活= " true " class = "support_vector_machine_libsvm" compatibility="7.1.001" expanded="true" height="82" name="SVM" width="90" x="313" y="34">



    <连接from_port = "训练" Exampl to_op = "过滤器es" to_port="example set input"/>










    <运营商激活= " true " class = "apply_model" compatibility="7.1.001" expanded="true" height="82" name="Apply Model" width="90" x="45" y="34">


    <运营商激活= " true " class = "nominal_to_binominal" compatibility="7.1.001" expanded="true" height="103" name="Nominal to Binominal" width="90" x="179" y="34">




    <运营商激活= " true " class = "performance" compatibility="7.1.001" expanded="true" height="82" name="Performance" width="90" x="313" y="34">


























  • In777In777 MemberPosts:29Contributor II

    Thank you for your suggestion. I've tried to leave one of the directories with the examples empty, unfortunately that did not help. I still get a bug report (see my previous post).

Sign InorRegisterto comment.