2
$\begingroup$

I have about 60000 data to train.
After minutes of calculation,all symbols are cleared.
Is it a Bug?
I have 8G memories ,but it's not enough.My cpu is i5-4590. Here are my codes:

data=ExampleData[{"MachineLearning","MNIST"},"TestData"];
trainingdata=RandomChoice[data,3000];
testdata=RandomChoice[data,1000];
maketuple[i_]=Array[If[i+1==#,1,0]&,10];
transformdata[d_]:=Module[{data=d[[;;,1]],label=d[[;;,2]]},
Flatten[Table[Append[maketuple[j],data[[i]]]->label[[i]]==j,{i,1,Length[data]},{j,0,9}],1]];
tdata=transformdata[trainingdata];
ttest=transformdata[testdata];
c=Classify[tdata];
ClassifierMeasurements[c,ttest,"Accuracy"]

Problem happen when calculate c=Classify[tdata].
If I use c=Classify[tdata,Method->"LogisticRegression"]; everything is ok.

Actually I need to add some information to train.

$\endgroup$
14
  • $\begingroup$ Please do not use the bugs tag until someone else has confirmed your observations. In the meantime: it does seem as if your computer is not sufficiently powerful for 60,000; would a smaller number suffice? $\endgroup$ Commented Mar 27, 2017 at 4:48
  • $\begingroup$ can you reproduce this all the time? Are you sure you are not calling ClearAll[...] or Clear[Global*] any where? or may be the Kernel crashed? That will also cause variable to be cleared. $\endgroup$
    – Nasser
    Commented Mar 27, 2017 at 5:22
  • $\begingroup$ @J.M. I don't know what tag should be.it should not lose all symbols without any information . I can wait but it seems something go wrong. I will add more information later $\endgroup$
    – erow
    Commented Mar 27, 2017 at 5:28
  • 4
    $\begingroup$ When you found your vars are cleared, observe the In Out label. If they start from one, than your kernel is crashed. $\endgroup$
    – vapor
    Commented Mar 27, 2017 at 7:04
  • 1
    $\begingroup$ @erow I found this problem interesting. The kernel even crashes with 40 training data, while the memory usage never exceed 1GB. I am confused by your way of converting the training data. Usually people train multiple classifiers (OvR) if they want to translate a multi class classification to a binary one. You are basically adding the target information into features and gives true when they match. This makes you have sample*class training data. And you are prepending one hot version of class, which significantly increases the number of features. $\endgroup$
    – vapor
    Commented Mar 27, 2017 at 8:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.