Activity 4.3 Q.10

54 views
Skip to first unread message

Shao-hui LEE

unread,
Oct 3, 2013, 3:41:48 AM10/3/13
to wekamooc...@googlegroups.com
In Activity 4.3 Q.10 if I apply the AddID filter and then run LinearRegression, 
the ID will be used as a parameter in the regression formula, however is obviously wrong.

How can I exclude ID in the calculation for the formula, 
while keeping it for outputting the original instance numbers in the classifier result?

Peter Reutemann

unread,
Oct 3, 2013, 4:17:30 AM10/3/13
to WekaMOOC
Use the FilteredClassifier meta-classifier with LinearRegression as
the base classifier and the Remove filter (unsupervised attribute
filter) configured to remove the first attribute.

Here's what the FilteredClassifier does: it applies the filter to the
input data before the specified base classifier sees it. This allows
you to always work with the full dataset and you simply remove the
attributes that you don't want the actual model to use.

Cheers, Peter
--
Peter Reutemann, Dept. of Computer Science, University of Waikato, NZ
http://www.cms.waikato.ac.nz/~fracpete/ Ph. +64 (7) 858-5174

Shao-hui LEE

unread,
Oct 6, 2013, 10:40:05 PM10/6/13
to wekamooc...@googlegroups.com, frac...@waikato.ac.nz
Hi,

Thanks for the answer!
This is the feature exactly what I want!

Peter Reutemann於 2013年10月3日星期四UTC+9下午5時17分30秒寫道:

Tyler Neill

unread,
Feb 24, 2017, 10:21:32 AM2/24/17
to WekaMOOC-general, frac...@waikato.ac.nz
Hello!

This was exactly my question too, and the answer was perfect, thank you both.

Personally, I think it would be clearer if the answer to the Activity question itself made a note of this; as Shao-hui points out, it's not much use to know how to add an ID attribute unless you also know how to prevent this from skewing the model (which in this case it does very much, since the data starts off organized by class value).

Cheers,
Tyler
Reply all
Reply to author
Forward
0 new messages