1
$\begingroup$

I am running Classify function using a support vector machine model. I get an error that I can not fix.

Here is my code. The data is imported from a file *.txt:

files = FileNames["*.txt"];
data = N@Flatten[ReadList[#]] & /@ files;
Dimensions@data (*500*3000*)
trainset = Association[{"class1" -> data[[1 ;; 50]], "class2" -> data[[51 ;; 100]]}]
validset = Association[{"class1" -> data[[101 ;; 120]],  "class2" -> data[[101 ;; 120]]}]
Classify[trainset, ValidationSet -> validset, Method -> "SupportVectorMachine"].

Here is a link to the directory which contains all files. files

And here are the errors:

Dot::dotsh: Tensors <<>>,{1.,0.,0.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,<<791>>},<<48>>,<<50>>} and {<<>>,<<784>>} have incompatible shapes. >>

LinearAlgebraBLASGEMM::blrank: The argument MachineLearningGeneralPackagePrivate`dist$182968 evaluates to rank 1. Rank 2 is expected.

Transpose::nmtx: The first two levels of <<>> cannot be transposed. >>

Commonest::arg1: The first argument is expected to be a list. >>

LinearAlgebraBLASGEMM::blrank: The argument MachineLearningGeneralPackagePrivate`dist$185704 evaluates to rank 1. Rank 2 is expected.

When I delete the validationSet option, or I use, for example, the LogisticRegression the training finishes correctly!

$\endgroup$
  • $\begingroup$ virustotal.com/en/file/… $\endgroup$ – thedude Feb 12 '16 at 5:35
  • $\begingroup$ I've reported similar bug in August. In my case I had kernel crash. Problem also was in ValidationSet. $\endgroup$ – Alexey Golyshev Feb 12 '16 at 9:55
  • $\begingroup$ @AlexeyGolyshev What version do you use? I am running Mathematica 10.1.0 $\endgroup$ – BetterEnglish Feb 12 '16 at 13:49
  • $\begingroup$ @Developer2000 10.3.1 $\endgroup$ – Alexey Golyshev Feb 12 '16 at 16:39
  • $\begingroup$ @AlexeyGolyshev, I receive the confirmation of technical support about this bug. $\endgroup$ – BetterEnglish Feb 16 '16 at 21:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.