how to control duplicate function names

5 visualizaciones (últimos 30 días)
jkr
jkr el 11 de Ag. de 2016
Comentada: Greg Heath el 14 de Ag. de 2016
I am using the Neural Network toolbox and attempting to determine how a trained patternnet would classify some test data. The documentation indicates I should use "classify" for this purpose. However, when I do so, I get an error message, because (as documented by "which classify") an unrelated function named "classify" is found preferentially on my matlabpath (/Applications/MATLAB_R2016a.app/toolbox/stats/stats/classify.m). If I "examine package contents" (I'm on a Mac), in fact that stats version of classify is the only one found. If I "doc classify" I get the stats version (re: Discriminant analysis), but at the top there is a notation: "Other uses of classify: nnet/SeriesNetwork.classify", and if I follow the offered link I find documentation on the version of classify appropriate for neural networks. How can I make that version of "classify" the one found in response to a command-line entry or a script? The same problem pertains to "predict". This overloading of function names seems like a very bad idea - what gives?
  2 comentarios
per isakson
per isakson el 11 de Ag. de 2016
Editada: per isakson el 11 de Ag. de 2016
Doc says
"[Ypred,scores] = classify(net,X) estimates the classes for the data in X using the trained network, net."
In this case classify is a method of the class, SeriesNetwork, and net is an object of that class.
I guess your first input argument is not an object of SeriesNetwork.
Walter Roberson
Walter Roberson el 11 de Ag. de 2016
patternnet and SeriesNetwork are not the same, so classify() cannot be used with a patternnet.

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 11 de Ag. de 2016
  5 comentarios
Walter Roberson
Walter Roberson el 11 de Ag. de 2016
You could use round() if the values from [0, 1]
Greg Heath
Greg Heath el 14 de Ag. de 2016
The NNET Roolbox has functions that convert vector output to classindices and vice versa.
classindices = [ 1 3 5 2 4 ]
target = full(ind2vec(classindices))
classindices = vec2ind(target)
Hope this helps.
Greg

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Parallel and Cloud en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by