Cannot map index of nominal attribute to nominal value

jdzhu
jdzhu New Altair Community Member
edited November 5 in Community Q&A
Hello Sir:

I got a error for use LSTM in Rapidminer ,and I don't have missing value in data.

process : 

<?xml version="1.0" encoding="UTF-8"?><process version="9.7.002">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" compatibility="9.4.000" expanded="true" name="Process" origin="GENERATED_TUTORIAL">
    <parameter key="logverbosity" value="init"/>
    <parameter key="random_seed" value="2001"/>
    <parameter key="send_mail" value="never"/>
    <parameter key="notification_email" value=""/>
    <parameter key="process_duration_for_mail" value="30"/>
    <parameter key="encoding" value="SYSTEM"/>
    <process expanded="true">
      <operator activated="true" class="retrieve" compatibility="9.7.002" expanded="true" height="68" name="Retrieve 0925" width="90" x="112" y="136">
        <parameter key="repository_entry" value="0925"/>
      </operator>
      <operator activated="true" class="retrieve" compatibility="9.7.002" expanded="true" height="68" name="Retrieve 0925 (2)" width="90" x="112" y="340">
        <parameter key="repository_entry" value="0925"/>
      </operator>
      <operator activated="true" class="retrieve" compatibility="9.7.002" expanded="true" height="68" name="Retrieve 0925 (3)" width="90" x="112" y="238">
        <parameter key="repository_entry" value="0925"/>
      </operator>
      <operator activated="true" class="collect" compatibility="9.7.002" expanded="true" height="103" name="Collect" width="90" x="246" y="136">
        <parameter key="unfold" value="false"/>
      </operator>
      <operator activated="true" class="deeplearning:dl4j_timeseries_converter" compatibility="0.9.004" expanded="true" height="82" name="TimeSeries to Tensor" origin="GENERATED_TUTORIAL" width="90" x="447" y="187"/>
      <operator activated="true" class="deeplearning:dl4j_tensor_sequential_neural_network" compatibility="0.9.004" expanded="true" height="145" name="Deep Learning (Tensor)" origin="GENERATED_TUTORIAL" width="90" x="648" y="136">
        <parameter key="loss_function" value="Multiclass Cross Entropy (Classification)"/>
        <parameter key="epochs" value="5"/>
        <parameter key="use_early_stopping" value="false"/>
        <parameter key="condition_strategy" value="score improvement"/>
        <parameter key="patience" value="5"/>
        <parameter key="minimal_score_improvement" value="0.0"/>
        <parameter key="best_epoch_score" value="0.01"/>
        <parameter key="max_iteration_score" value="3.0"/>
        <parameter key="max_iteration_time" value="10"/>
        <parameter key="use_miniBatch" value="true"/>
        <parameter key="batch_size" value="8"/>
        <parameter key="updater" value="Adam"/>
        <parameter key="learning_rate" value="0.005"/>
        <parameter key="momentum" value="0.9"/>
        <parameter key="rho" value="0.95"/>
        <parameter key="epsilon" value="1.0E-6"/>
        <parameter key="beta1" value="0.9"/>
        <parameter key="beta2" value="0.999"/>
        <parameter key="RMSdecay" value="0.95"/>
        <parameter key="weight_initialization" value="Xavier"/>
        <parameter key="bias_initialization" value="0.0"/>
        <parameter key="use_regularization" value="false"/>
        <parameter key="l1_strength" value="0.1"/>
        <parameter key="l2_strength" value="0.1"/>
        <parameter key="optimization_method" value="Stochastic Gradient Descent"/>
        <parameter key="cudnn_algo_mode" value="Prefer fastest"/>
        <parameter key="backpropagation" value="Standard"/>
        <parameter key="backpropagation_length" value="50"/>
        <parameter key="infer_input_shape" value="false"/>
        <parameter key="network_type" value="Recurrent with TimeSeries"/>
        <parameter key="input_dimension" value="2"/>
        <parameter key="timeseries_steps" value="4"/>
        <parameter key="log_each_epoch" value="true"/>
        <parameter key="epochs_per_log" value="10"/>
        <parameter key="use_local_random_seed" value="false"/>
        <parameter key="local_random_seed" value="1992"/>
        <process expanded="true">
          <operator activated="true" class="deeplearning:dl4j_lstm_layer" compatibility="0.9.004" expanded="true" height="68" name="Add LSTM Layer" origin="GENERATED_TUTORIAL" width="90" x="179" y="136">
            <parameter key="neurons" value="20"/>
            <parameter key="gate_activation" value="TanH"/>
            <parameter key="forget_gate_bias_initialization" value="1.0"/>
            <description align="center" color="transparent" colored="false" width="126">A long short term memory layer is used for keeping previous time-steps for current training decisions.</description>
          </operator>
          <operator activated="true" class="deeplearning:dl4j_dense_layer" compatibility="0.9.004" expanded="true" height="68" name="Add Fully-Connected Layer" origin="GENERATED_TUTORIAL" width="90" x="447" y="136">
            <parameter key="number_of_neurons" value="2"/>
            <parameter key="activation_function" value="Softmax"/>
            <parameter key="use_dropout" value="false"/>
            <parameter key="dropout_rate" value="0.25"/>
            <parameter key="overwrite_networks_weight_initialization" value="false"/>
            <parameter key="weight_initialization" value="Normal"/>
            <parameter key="overwrite_networks_bias_initialization" value="false"/>
            <parameter key="bias_initialization" value="0.0"/>
            <description align="center" color="transparent" colored="false" width="126">Using no activation function for this output layer, since a regression is performed.</description>
          </operator>
          <connect from_port="layerArchitecture" to_op="Add LSTM Layer" to_port="layerArchitecture"/>
          <connect from_op="Add LSTM Layer" from_port="layerArchitecture" to_op="Add Fully-Connected Layer" to_port="layerArchitecture"/>
          <connect from_op="Add Fully-Connected Layer" from_port="layerArchitecture" to_port="layerArchitecture"/>
          <portSpacing port="source_layerArchitecture" spacing="0"/>
          <portSpacing port="sink_layerArchitecture" spacing="0"/>
        </process>
        <description align="center" color="transparent" colored="false" width="126">Double click the operator for its inner layer structure</description>
      </operator>
      <operator activated="true" class="retrieve" compatibility="9.7.002" expanded="true" height="68" name="Retrieve 0925 (4)" width="90" x="112" y="442">
        <parameter key="repository_entry" value="0925"/>
      </operator>
      <operator activated="true" class="collect" compatibility="9.7.002" expanded="true" height="103" name="Collect (2)" width="90" x="246" y="340">
        <parameter key="unfold" value="false"/>
      </operator>
      <operator activated="true" class="deeplearning:dl4j_timeseries_converter" compatibility="0.9.004" expanded="true" height="82" name="TimeSeries to Tensor (2)" origin="GENERATED_TUTORIAL" width="90" x="447" y="340"/>
      <operator activated="true" class="nd4j:apply_model_generic" compatibility="0.1.001" expanded="true" height="82" name="Apply Model (Generic)" origin="GENERATED_TUTORIAL" width="90" x="782" y="289">
        <description align="center" color="transparent" colored="false" width="126">This operator adds the prediction to the input tensor and provides it as a Collection of ExampleSets.</description>
      </operator>
      <operator activated="true" class="loop_collection" compatibility="9.7.002" expanded="true" height="82" name="Loop Collection" origin="GENERATED_TUTORIAL" width="90" x="916" y="187">
        <parameter key="set_iteration_macro" value="false"/>
        <parameter key="macro_name" value="iteration"/>
        <parameter key="macro_start_value" value="1"/>
        <parameter key="unfold" value="false"/>
        <process expanded="true">
          <operator activated="true" class="filter_example_range" compatibility="9.7.002" expanded="true" height="82" name="Filter Example Range" origin="GENERATED_TUTORIAL" width="90" x="112" y="34">
            <parameter key="first_example" value="1"/>
            <parameter key="last_example" value="1"/>
            <parameter key="invert_filter" value="false"/>
          </operator>
          <connect from_port="single" to_op="Filter Example Range" to_port="example set input"/>
          <connect from_op="Filter Example Range" from_port="example set output" to_port="output 1"/>
          <portSpacing port="source_single" spacing="0"/>
          <portSpacing port="sink_output 1" spacing="0"/>
          <portSpacing port="sink_output 2" spacing="0"/>
          <description align="center" color="yellow" colored="false" height="145" resized="false" width="180" x="45" y="157">Looping over all patients (ExampleSets) from the Apply Model (Generic)'s Collection output to extract one measurement each (since all contain the same prediction).</description>
        </process>
        <description align="center" color="transparent" colored="false" width="126">Loop over all patients (ExampleSets) from the Apply Model (Generic)'s Collection output.</description>
      </operator>
      <operator activated="true" class="append" compatibility="9.7.002" expanded="true" height="82" name="Append" origin="GENERATED_TUTORIAL" width="90" x="1050" y="289">
        <parameter key="datamanagement" value="double_array"/>
        <parameter key="data_management" value="auto"/>
        <parameter key="merge_type" value="all"/>
      </operator>
      <operator activated="true" class="performance_classification" compatibility="9.7.002" expanded="true" height="82" name="Performance" origin="GENERATED_TUTORIAL" width="90" x="1184" y="187">
        <parameter key="main_criterion" value="first"/>
        <parameter key="accuracy" value="true"/>
        <parameter key="classification_error" value="false"/>
        <parameter key="kappa" value="false"/>
        <parameter key="weighted_mean_recall" value="false"/>
        <parameter key="weighted_mean_precision" value="false"/>
        <parameter key="spearman_rho" value="false"/>
        <parameter key="kendall_tau" value="false"/>
        <parameter key="absolute_error" value="false"/>
        <parameter key="relative_error" value="false"/>
        <parameter key="relative_error_lenient" value="false"/>
        <parameter key="relative_error_strict" value="false"/>
        <parameter key="normalized_absolute_error" value="false"/>
        <parameter key="root_mean_squared_error" value="false"/>
        <parameter key="root_relative_squared_error" value="false"/>
        <parameter key="squared_error" value="false"/>
        <parameter key="correlation" value="false"/>
        <parameter key="squared_correlation" value="false"/>
        <parameter key="cross-entropy" value="false"/>
        <parameter key="margin" value="false"/>
        <parameter key="soft_margin_loss" value="false"/>
        <parameter key="logistic_loss" value="false"/>
        <parameter key="skip_undefined_labels" value="true"/>
        <parameter key="use_example_weights" value="true"/>
        <list key="class_weights"/>
      </operator>
      <connect from_op="Retrieve 0925" from_port="output" to_op="Collect" to_port="input 1"/>
      <connect from_op="Retrieve 0925 (2)" from_port="output" to_op="Collect (2)" to_port="input 1"/>
      <connect from_op="Retrieve 0925 (3)" from_port="output" to_op="Collect" to_port="input 2"/>
      <connect from_op="Collect" from_port="collection" to_op="TimeSeries to Tensor" to_port="collection"/>
      <connect from_op="TimeSeries to Tensor" from_port="tensor" to_op="Deep Learning (Tensor)" to_port="training set"/>
      <connect from_op="Deep Learning (Tensor)" from_port="model" to_op="Apply Model (Generic)" to_port="model"/>
      <connect from_op="Retrieve 0925 (4)" from_port="output" to_op="Collect (2)" to_port="input 2"/>
      <connect from_op="Collect (2)" from_port="collection" to_op="TimeSeries to Tensor (2)" to_port="collection"/>
      <connect from_op="TimeSeries to Tensor (2)" from_port="tensor" to_op="Apply Model (Generic)" to_port="unlabelled data"/>
      <connect from_op="Apply Model (Generic)" from_port="labelled data" to_op="Loop Collection" to_port="collection"/>
      <connect from_op="Loop Collection" from_port="output 1" to_op="Append" to_port="example set 1"/>
      <connect from_op="Append" from_port="merged set" to_op="Performance" to_port="labelled data"/>
      <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"/>
      <description align="center" color="yellow" colored="false" height="108" resized="false" width="180" x="102" y="449">Note: This tutorial process is intended to showcase the functional usage. The examples size and chosen parameters are not optimal.</description>
      <description align="center" color="blue" colored="true" height="344" resized="true" width="242" x="102" y="59">Using a prepared subsample of the ICU medical data set. It contains anonymised patient data. Some attributes are time-series like (temperature) some aren't (age). Each ExampleSet represents one patient.</description>
      <description align="center" color="yellow" colored="false" height="344" resized="true" width="219" x="387" y="59">Convert the number of samples (a Collection of ExampleSets) to a tensor.</description>
      <description align="center" color="green" colored="true" height="453" resized="true" width="274" x="626" y="59">Notice that the Deep Learning (Tensor) and Apply Model (Generic) operators are used. For data with more than rows and columns we need to use these. The Deep Learning (Tensor) operator can be configured exactly the same as the non tensor one.</description>
      <description align="center" color="yellow" colored="false" height="344" resized="true" width="398" x="903" y="59">Extracting the classificaton performance from the prediction on tensor data.</description>
    </process>
  </operator>
</process>


And my email is : diabloaegis@gmail.com

Thank for reply.

Answers

  • jacobcybulski
    jacobcybulski New Altair Community Member
    I am not sure if this was intended but your training data (not included or described in your post)  consists of two example sets, so is your test data. This is not much of a time series to train your LSTM model. You may need to change your data pre-processing to use LSTM.