Cannot scale data

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Cannot scale data

rkok
Hello!

I have this error in R:

In svm.default(x, y, scale = scale, ..., na.action = na.action) :
  Variable(s) ‘X.11.’ constant. Cannot scale data.

Of course, I have a column of 25 rows where the values are always 0. Why it
is not possible to have a column with 0?
I need this column because is a feature from a patient. Is there any way to
solve this error?

Thanks in advance!

        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Cannot scale data

Rui Barradas
Hello,

Can't you simply call svm() with scale = FALSE ?
If the variable is constant, it cannot be scaled to unit variance (and
zero mean).

Hope this helps,

Rui Barradas

Em 06-04-2013 17:19, Nicolás Sánchez escreveu:

> Hello!
>
> I have this error in R:
>
> In svm.default(x, y, scale = scale, ..., na.action = na.action) :
>    Variable(s) ‘X.11.’ constant. Cannot scale data.
>
> Of course, I have a column of 25 rows where the values are always 0. Why it
> is not possible to have a column with 0?
> I need this column because is a feature from a patient. Is there any way to
> solve this error?
>
> Thanks in advance!
>
> [[alternative HTML version deleted]]
>
>
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Cannot scale data

rkok
Of Course, that's the solution!
Thankss!


2013/4/6 Rui Barradas <[hidden email]>

> Hello,
>
> Can't you simply call svm() with scale = FALSE ?
> If the variable is constant, it cannot be scaled to unit variance (and
> zero mean).
>
> Hope this helps,
>
> Rui Barradas
>
> Em 06-04-2013 17:19, Nicolás Sánchez escreveu:
>
>> Hello!
>>
>> I have this error in R:
>>
>> In svm.default(x, y, scale = scale, ..., na.action = na.action) :
>>    Variable(s) ‘X.11.’ constant. Cannot scale data.
>>
>> Of course, I have a column of 25 rows where the values are always 0. Why
>> it
>> is not possible to have a column with 0?
>> I need this column because is a feature from a patient. Is there any way
>> to
>> solve this error?
>>
>> Thanks in advance!
>>
>>         [[alternative HTML version deleted]]
>>
>>
>>
>> ______________________________**________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help>
>> PLEASE do read the posting guide http://www.R-project.org/**
>> posting-guide.html <http://www.R-project.org/posting-guide.html>
>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.