Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: ClassificationKNN.fit with cell array of strings as Y
Replies: 8   Last Post: May 8, 2013 4:39 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Alan Weiss

Posts: 1,209
Registered: 11/27/08
Re: ClassificationKNN.fit with cell array of strings as Y
Posted: May 7, 2013 1:04 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 5/7/2013 12:55 PM, Alan_Weiss wrote:
> On 5/7/2013 11:07 AM, Jay wrote:
>>
>>> I am not sure where in the documentation you found your statement 1.
>>> Here's what I see when I look at the current documentation:
>>> http://www.mathworks.com/help/stats/classificationknn.fit.html
>>>
>>> Y - Grouping variables of response values with the same number of
>>> elements (rows) as X. Each entry in Y is the response to the data in
>>> the corresponding row of X.
>>>
>>> This does not say that the variable must be a numeric vector, but a
>>> grouping variable
>>> http://www.mathworks.com/help/stats/grouping-variables.html

>>
>> Hm, yes, correct. Here is what I was referring to:
>> http://www.mathworks.de/de/help/stats/classificationknnclass.html
>>
>> Y Numeric vector of response values with the same number of rows as
>> X. Each entry in Y is the response to the data in the corresponding
>> row of X.
>>

>>> As far as your problem 2, I am not sure what is going on. I wonder
>>> if your function myDistance is giving you a problem somehow.

>>
>> So you believe everything should work fine when using a cell array of
>> strings. I don't see how my distance function could cause such an
>> error. My distance function is defined as [ distance ] = myDistance(
>> obj1, objects)
>> and will always return at least "distance = zeros(size(objects,
>> 1),1); " or higher values.

>
> There must be something strange about the German web site, because
> when I try to look at the documentation page for the ClassificationKNN
> class, I do not see the "Numeric vector..." that you do, even when I
> look at the R2012b version of the documentation. I will try to
> investigate this discrepancy. Thanks for reporting the issue.
>
> And, as I said, I really do not know what is going on with the predict
> method that is causing those errors. I will try to look into it, but
> it might take a few days.
>
> Alan Weiss
> MATLAB mathematical toolbox documentation


On second thought, perhaps you should contact Technical Support. If you
really found a bug (and I am satisfied that, if there is a bug, it is
not in the documentation), then tech support is probably in the best
position to research the problem and help to find a solution.

Alan Weiss
MATLAB mathematical toolbox documentation



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.