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

User kNN - NegativeArraySizeException

olgakulesza2olgakulesza2 Member Posts: 15 Learner III
edited June 2019 in Help

Hello, 

I have problem in recommendation system model. When I run my process, it is failed on "User kNN" operator. 

I got this Exception: 

Exception: java.lang.NegativeArraySizeException
Message: null
Stack trace:

com.rapidminer.data.Matrix_f.<init>(Matrix_f.java:69)
com.rapidminer.data.CorrelationMatrix.<init>(CorrelationMatrix.java:52)
com.rapidminer.data.BinaryDataCorrelationMatrix.<init>(BinaryDataCorrelationMatrix.java:17)
com.rapidminer.data.BinaryCosine.<init>(BinaryCosine.java:24)
com.rapidminer.data.BinaryCosine.Create(BinaryCosine.java:104)
com.rapidminer.operator.RatingPrediction.UserKnnCosine.Train(UserKnnCosine.java:28)
com.rapidminer.operator.RatingPrediction.UserKnn.doWork(UserKnn.java:159)
com.rapidminer.operator.Operator.execute(Operator.java:1004)
com.rapidminer.operator.execution.SimpleUnitExecutor.execute(SimpleUnitExecutor.java:77)
com.rapidminer.operator.ExecutionUnit$3.run(ExecutionUnit.java:812)
com.rapidminer.operator.ExecutionUnit$3.run(ExecutionUnit.java:807)
java.security.AccessController.doPrivileged(Native Method)
com.rapidminer.operator.ExecutionUnit.execute(ExecutionUnit.java:807)
com.rapidminer.operator.OperatorChain.doWork(OperatorChain.java:428)
com.rapidminer.operator.Operator.execute(Operator.java:1004)
com.rapidminer.Process.execute(Process.java:1310)
com.rapidminer.Process.run(Process.java:1285)
com.rapidminer.Process.run(Process.java:1176)
com.rapidminer.Process.run(Process.java:1129)
com.rapidminer.Process.run(Process.java:1124)
com.rapidminer.Process.run(Process.java:1114)
com.rapidminer.gui.ProcessThread.run(ProcessThread.java:65)

Could you please tell me what to do with it?

 

My code below:

<?xml version="1.0" encoding="UTF-8"?><process version="8.1.001">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="8.1.001" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="retrieve" compatibility="8.1.001" expanded="true" height="68" name="Retrieve ratings" width="90" x="45" y="34">
<parameter key="repository_entry" value="//Local Repository/ratings"/>
</operator>
<operator activated="true" class="set_role" compatibility="8.1.001" expanded="true" height="82" name="Set Role" width="90" x="179" y="34">
<parameter key="attribute_name" value="rating"/>
<parameter key="target_role" value="label"/>
<list key="set_additional_roles">
<parameter key="book_id" value="item identification"/>
<parameter key="user_id" value="user identification"/>
<parameter key="rating" value="label"/>
</list>
</operator>
<operator activated="true" class="split_data" compatibility="8.1.001" expanded="true" height="103" name="Split Data" width="90" x="45" y="136">
<enumeration key="partitions">
<parameter key="ratio" value="0.7"/>
<parameter key="ratio" value="0.3"/>
</enumeration>
</operator>
<operator activated="true" class="irbrecommender:user_k-NN_rp" compatibility="5.1.002" expanded="true" height="82" name="User k-NN" width="90" x="246" y="136"/>
<operator activated="true" class="irbrecommender:apply_model_rp" compatibility="5.1.002" expanded="true" height="82" name="Apply Model" width="90" x="246" y="289"/>
<operator activated="true" class="irbrecommender:performance_rating_prediction" compatibility="5.1.002" expanded="true" height="82" name="Performance" width="90" x="447" y="187"/>
<connect from_op="Retrieve ratings" from_port="output" to_op="Set Role" to_port="example set input"/>
<connect from_op="Set Role" from_port="example set output" to_op="Split Data" to_port="example set"/>
<connect from_op="Split Data" from_port="partition 1" to_op="User k-NN" to_port="example set"/>
<connect from_op="Split Data" from_port="partition 2" to_op="Apply Model" to_port="query set"/>
<connect from_op="User k-NN" from_port="Model" to_op="Apply Model" to_port="Model"/>
<connect from_op="Apply Model" from_port="result set" to_op="Performance" to_port="predictions"/>
<connect from_op="Performance" from_port="performance" 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>

 

 

 

Tagged:

Answers

  • sgenzersgenzer Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,959 Community Manager

    Hello @olgakulesza2 - I see in your XML that you're using a VERY old extension from ver 5.1 for these operators? If so, this is not recommended and I'm not surprised you're getting errors. Why not use the kNN, apply model and so forth from the core set of operators?

     

     <operator activated="true" class="irbrecommender:user_k-NN_rp" compatibility="5.1.002" expanded="true" height="82" name="User k-NN" width="90" x="246" y="136"/>
    <operator activated="true" class="irbrecommender:apply_model_rp" compatibility="5.1.002" expanded="true" height="82" name="Apply Model" width="90" x="246" y="289"/>
    <operator activated="true" class="irbrecommender:performance_rating_prediction" compatibility="5.1.002" expanded="true" height="82" name="Performance" width="90" x="447" y="187"/>

    Scott

     

Sign In or Register to comment.