The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

Read Sparse operator

natalyalnatalyal Member Posts: 1 Learner III
edited November 2018 in Help
I am trying to use the "read sparse operator" but I always get an exception.
The data file is:
w:1.0 5:1 305:5 798:1 yes
w:0.2 305:2 562:1 yes
w:0.8 49:1 782:1 823:2 no

The process xml file which was generated:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.1.001">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" compatibility="5.0.000" expanded="true" name="Root">
    <description>&lt;p&gt;This is another very simple genetic feature selection approach. Due to another selection scheme, the feature selection operator not only tries to maximize the performance delivered by the feature set evaluator but also tries to minimize the number of features. The result is a Pareto front plotted during optimization.&lt;/p&gt;  &lt;p&gt;After the optimization has finished, the user can double click on the Pareto-optimal solutions and see which feature set is represented by which point. The Pareto front does not only give insight into the total number of necessary features but also into the trade-off between number of features and performance and into a ranking of features.&lt;/p&gt;</description>
    <parameter key="logverbosity" value="all"/>
    <process expanded="true" height="323" width="346">
      <operator activated="true" breakpoints="before,after" class="read_sparse" compatibility="5.1.001" expanded="true" height="60" name="Read Sparse" width="90" x="45" y="75">
        <parameter key="data_file" value="D:\My Documents\מחקר\Terrorist Web Documents Detection\Terrorist Web Documents Detection\bin\Debug\RapidMinerFiles\test2.dat"/>
        <parameter key="dimension" value="1000"/>
        <parameter key="use_quotes" value="false"/>
        <parameter key="datamanagement" value="int_sparse_array"/>
        <list key="prefix_map">
          <parameter key="w" value="weight"/>
        </list>
      </operator>
      <operator activated="true" class="store" compatibility="5.1.001" expanded="true" height="60" name="Store" width="90" x="246" y="75">
        <parameter key="repository_entry" value="amen"/>
      </operator>
      <connect from_op="Read Sparse" from_port="output" to_op="Store" to_port="input"/>
      <connect from_op="Store" from_port="through" to_port="result 1"/>
      <portSpacing port="source_input 1" spacing="0"/>
      <portSpacing port="sink_result 1" spacing="0"/>
      <portSpacing port="sink_result 2" spacing="0"/>
    </process>
  </operator>
</process>


The Exception details are:
Exception: java.lang.RuntimeException
Message: Illegal attribute index: 'ן»¿5' (legal values are integers and defined prefixes for special attributes (Parameter prefix_map of SparseFormatExampleSource))!
Stack trace:

  com.rapidminer.example.table.SparseFormatDataRowReader.hasNext(SparseFormatDataRowReader.java:175)
  com.rapidminer.example.table.MemoryExampleTable.readExamples(MemoryExampleTable.java:140)
  com.rapidminer.example.table.MemoryExampleTable.readExamples(MemoryExampleTable.java:131)
  com.rapidminer.example.table.MemoryExampleTable.readExamples(MemoryExampleTable.java:123)
  com.rapidminer.operator.io.SparseFormatExampleSource.createExampleSet(SparseFormatExampleSource.java:210)
  com.rapidminer.operator.io.AbstractExampleSource.read(AbstractExampleSource.java:52)
  com.rapidminer.operator.io.AbstractExampleSource.read(AbstractExampleSource.java:36)
  com.rapidminer.operator.io.AbstractReader.doWork(AbstractReader.java:123)
  com.rapidminer.operator.Operator.execute(Operator.java:829)
  com.rapidminer.operator.execution.SimpleUnitExecutor.execute(SimpleUnitExecutor.java:51)
  com.rapidminer.operator.ExecutionUnit.execute(ExecutionUnit.java:709)
  com.rapidminer.operator.OperatorChain.doWork(OperatorChain.java:369)
  com.rapidminer.operator.Operator.execute(Operator.java:829)
  com.rapidminer.Process.run(Process.java:901)
  com.rapidminer.Process.run(Process.java:797)
  com.rapidminer.Process.run(Process.java:792)
  com.rapidminer.Process.run(Process.java:782)
  com.rapidminer.gui.ProcessThread.run(ProcessThread.java:62)

Can someone know what is my problem?
Thanks.

Answers

  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,531 Unicorn
    Hi,
    I can only guess. I think your file does contain an error somewhere. The operators tries to read the file and finds this "ן»¿" characters. This cannot be parsed to be a number. There are two possible reasons: The one is that there are simply errors in the file itself, the other is, that you try to read the file with the wrong encoding. If you file is encoded in UTF-16 and you read it in Windows Ansi, exactly these errors will occur.

    Greetings,
      Sebastian
Sign In or Register to comment.