PRML / PRMLT

Matlab code of machine learning algorithms in book PRML
http://prml.github.io/
MIT License
6.03k stars 2.16k forks source link

Chapter 7: Use similar data as demo, but not work #47

Closed so2liu closed 6 years ago

so2liu commented 6 years ago

Hallo, thank you for your all efforts. Recently I met a problem for remBinFp function. I used my data with size 21000 and label with 11000. But something happened and the output model.index is 3, while in your demo it's 3. Therefore, binPlot func doesn't work. Could you please take a look for me? I upload the data.mat in google drive. Thanks

%% RVM for classification
load('data.mat');
[model, llh] = rvmBinFp(X, y);
plot(llh);
y = rvmBinPred(model,X)+1;
figure;
binPlot(model,X,y);
---------------------
Index exceeds matrix dimensions.

Error in binPlot (line 25)
y = w(1)*x1+w(2)*x2+w(3);
sth4nth commented 6 years ago

I am not able to download your data now. Could you upload your data to some place inside GFW.

sth4nth commented 6 years ago

For the binary classifier, the labels are assumed to be (0/1), where as the labels your data are (1/2)

sth4nth commented 6 years ago

There is indeed a problem that the binPlot function does not support sparse models. Fixed to use plotClass instead.