COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### classregtree #3

• Email
• Follow

```In the documentation of stats toolbox, readable on
http://www.mathworks.com/access/helpdesk/help/toolbox/stat/classregtree.html
it is said that we can use a "weights" option. I dont understand how we can do it.
Somebody can help me?

thanks

Maurice
```
 0
Reply 5/19/2010 8:34:08 AM

See related articles to this posting

```"Maurice " <maurice.charbit@telecom-paristech.fr> wrote in message <ht07q0\$84r\$1@fred.mathworks.com>...
> In the documentation of stats toolbox, readable on
>         http://www.mathworks.com/access/helpdesk/help/toolbox/stat/classregtree.html
> it is said that we can use a "weights" option. I dont understand how we can do it.
> Somebody can help me?
>
> thanks
>
> Maurice

Hi Maurice, weights is a numeric vector of nonnegative numbers. There must be one weight for each observation in your dataset, which means that the number of weights has to equal the number of elements in the row dimension of your X matrix. Remember, each column of X is a predictor variable and the number of elements in every column of X is your number of observations. By default, every observation is given an equal weight of one, which in essence says that all the observations are deemed to be equally precise, of equal quality, or equally reliable, depending on how you want to look at it.

I'm assuming the fact that you are considering the weights option means that you want to downweight, i.e. reduce the influence, some of your observations?

The syntax is just as shown in the documentation:

w = ones(100,1); % weights vector obviously these are just ones

% some junk data
X = randn(100,2);
y = randn(100,1);
T = classregtree(X,y,'weights',w);

Wayne
```
 0
Reply Wayne 5/19/2010 10:52:04 AM

1 Replies
86 Views

Similar Articles

12/8/2013 3:40:16 PM
page loaded in 43391 ms. (0)

Similar Artilces:

classregtree #5
I create a tree for a dataset.Dataset has 100 attributes but classregtree does not use all of them when it constructs the decision trees. How can I extract the attributes used in the decision trees of classregtree? "cev " <cevahirparlak@yahoo.com> wrote in message news:l5ru3l\$m9v\$1@newscl01ah.mathworks.com... > I create a tree for a dataset.Dataset has 100 attributes but classregtree > does not use all of them when it constructs the decision trees. How can I > extract the attributes used in the decision trees of classregtree? > http://www.mathworks.com/matlabcentral/answers/103352-what-predictor-variables-are-used-for-a-given-pruning-level-in-a-classregtree