help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

error: matrix cannot be indexed with {


From: Phenyo Moletsane
Subject: error: matrix cannot be indexed with {
Date: Sun, 29 Apr 2018 10:41:43 +0200

Hi 

I am trying to call tthis function in octave, m5ptest(model,X_test,Y_test), and get the following error:
error: matrix cannot be indexed with {
error: called from
    m5ppredict at line 107 column 10
    m5ptest at line 74 column 15
Here is my data set and code:


>>params=m5pparams2('modelTree',1);

>>model =m5pbuild(X_train,Y_train,params, [0,0,0, 1, 0, 0, 0,0,0,0,0,0,0]);

>>m5ptest(model,X_test,Y_test)
error: matrix cannot be indexed with {
error: called from
    m5ppredict at line 107 column 10
    m5ptest at line 74 column 15


Here is my X_test

[[  2.28760000e-01,   0.00000000e+00,   8.56000000e+00,
          0.00000000e+00,   5.20000000e-01,   6.40500000e+00,
          8.54000000e+01,   2.71470000e+00,   5.00000000e+00,
          3.84000000e+02,   2.09000000e+01,   7.08000000e+01,
          1.06300000e+01],
       [  2.63630000e-01,   0.00000000e+00,   8.56000000e+00,
          0.00000000e+00,   5.20000000e-01,   6.22900000e+00,
          9.12000000e+01,   2.54510000e+00,   5.00000000e+00,
          3.84000000e+02,   2.09000000e+01,   3.91230000e+02,
          1.55500000e+01],
       [  8.38700000e-02,   0.00000000e+00,   1.28300000e+01,
          0.00000000e+00,   4.37000000e-01,   5.87400000e+00,
          3.66000000e+01,   4.50260000e+00,   5.00000000e+00,
          3.98000000e+02,   1.87000000e+01,   3.96060000e+02,
          9.10000000e+00],
       [  1.43200000e-02,   1.00000000e+02,   1.32000000e+00,
          0.00000000e+00,   4.11000000e-01,   6.81600000e+00,
          4.05000000e+01,   8.32480000e+00,   5.00000000e+00,
          2.56000000e+02,   1.51000000e+01,   3.92900000e+02,
          3.95000000e+00],
       [  6.86000000e-02,   0.00000000e+00,   2.89000000e+00,
          0.00000000e+00,   4.45000000e-01,   7.41600000e+00,
          6.25000000e+01,   3.49520000e+00,   2.00000000e+00,
          2.76000000e+02,   1.80000000e+01,   3.96900000e+02,
          6.19000000e+00],
       [  1.13081000e+00,   0.00000000e+00,   8.14000000e+00,
          0.00000000e+00,   5.38000000e-01,   5.71300000e+00,
          9.41000000e+01,   4.23300000e+00,   4.00000000e+00,
          3.07000000e+02,   2.10000000e+01,   3.60170000e+02,
          2.26000000e+01],
       [  1.71200000e-01,   0.00000000e+00,   8.56000000e+00,
          0.00000000e+00,   5.20000000e-01,   5.83600000e+00,
          9.19000000e+01,   2.21100000e+00,   5.00000000e+00,
          3.84000000e+02,   2.09000000e+01,   3.95670000e+02,
          1.86600000e+01],
       [  3.55100000e-02,   2.50000000e+01,   4.86000000e+00,
          0.00000000e+00,   4.26000000e-01,   6.16700000e+00,
          4.67000000e+01,   5.40070000e+00,   4.00000000e+00,
          2.81000000e+02,   1.90000000e+01,   3.90640000e+02,
          7.51000000e+00],
       [  1.32620000e-01,   0.00000000e+00,   8.56000000e+00,
          0.00000000e+00,   5.20000000e-01,   5.85100000e+00,
          9.67000000e+01,   2.10690000e+00,   5.00000000e+00,
          3.84000000e+02,   2.09000000e+01,   3.94050000e+02,
          1.64700000e+01],
       [  1.07930000e-01,   0.00000000e+00,   8.56000000e+00,
          0.00000000e+00,   5.20000000e-01,   6.19500000e+00,
          5.44000000e+01,   2.77780000e+00,   5.00000000e+00,
          3.84000000e+02,   2.09000000e+01,   3.93490000e+02,
          1.30000000e+01],



My Y_test:
([[ 18.6],
       [ 19.4],
       [ 20.3],
       [ 31.6],
       [ 33.2],
       [ 12.7],
       [ 19.5],
       [ 22.9],
       [ 19.5],
       [ 21.7],
       [ 13.6],
       [ 24.7],
       [ 23.1],
       [ 17.4],
       [ 13.9],
       [ 13.2],
       [ 18.4],
       [ 25. ],
       [ 50. ],
       [ 17.5],
       [ 20.8],
       [ 18.2],
       [ 20.4],
       [ 15. ],
       [ 15.6],
       [ 20. ],
       [ 17.1],
       [ 16. ],
       [ 24.7],
       [ 17.8],
       [ 14.5],
       [ 13.4],
       [ 20.3],
       [ 15.4]])

Please assist

reply via email to

[Prev in Thread] Current Thread [Next in Thread]