J48 will work with file like this?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

J48 will work with file like this?

Abacap
Hello there!
 
J48 will work with file like this?
Or it will only correctly clasify nominal values?
Here''s my test file (clients' purchase history) and 'lost' class
 
 
@relation clients_history
@attribute client_id numeric
@attribute turnover numeric
@attribute no_of_articles numeric
@attribute purchase_quantity numeric
@attribute lost {yes,no}
 
@data
101,456,10,3,yes
100,231,12,5,no
200,128,5,1,yes
300,167,23,4,no
305,99,9,6,yes
400,89,3,2,yes
401,567,56,19,no
402,298,29,20,no
500,88,3,3,yes
501,78,2,2,yes
 
Yet after 'cross-validation' classification with J48 in visualization I see only 'no_of_articles' node and 'yes' and 'no' subnodes attached to it. I do not think should be like that...
 
 

_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Fw: J48 will work with file like this?

Abacap
Apparently tree for some reason starts from second attribute not first. Should begin from first, right?
How to change that?
 
 
Sent: Friday, October 30, 2020 at 12:37 PM
From: "Abacap" <[hidden email]>
To: [hidden email]
Subject: J48 will work with file like this?
Hello there!
 
J48 will work with file like this?
Or it will only correctly clasify nominal values?
Here''s my test file (clients' purchase history) and 'lost' class
 
 
@relation clients_history
@attribute client_id numeric
@attribute turnover numeric
@attribute no_of_articles numeric
@attribute purchase_quantity numeric
@attribute lost {yes,no}
 
@data
101,456,10,3,yes
100,231,12,5,no
200,128,5,1,yes
300,167,23,4,no
305,99,9,6,yes
400,89,3,2,yes
401,567,56,19,no
402,298,29,20,no
500,88,3,3,yes
501,78,2,2,yes
 
Yet after 'cross-validation' classification with J48 in visualization I see only 'no_of_articles' node and 'yes' and 'no' subnodes attached to it. I do not think should be like that...
 
 

_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: J48 will work with file like this?

Peter Reutemann
In reply to this post by Abacap
> J48 will work with file like this?

Yes.

> Or it will only correctly clasify nominal values?

J48 can handle numeric attributes. Here are its full capabilities
(copy/paste from the dialog that opens when you click on
"Capabilities" in the GOE window of the classifier):

Capabilities
Class - Nominal class, Binary class, Missing class values

Attributes - Missing values, Nominal attributes, Empty nominal
attributes, Numeric attributes, Binary attributes, Date attributes,
Unary attributes

Additional
min # of instances: 0

> Here''s my test file (clients' purchase history) and 'lost' class
>
>
> @relation clients_history
> @attribute client_id numeric
> @attribute turnover numeric
> @attribute no_of_articles numeric
> @attribute purchase_quantity numeric
> @attribute lost {yes,no}
>
> @data
> 101,456,10,3,yes
> 100,231,12,5,no
> 200,128,5,1,yes
> 300,167,23,4,no
> 305,99,9,6,yes
> 400,89,3,2,yes
> 401,567,56,19,no
> 402,298,29,20,no
> 500,88,3,3,yes
> 501,78,2,2,yes
>
> Yet after 'cross-validation' classification with J48 in visualization I see only 'no_of_articles' node and 'yes' and 'no' subnodes attached to it. I do not think should be like that...

Why? "no_of_articles <= 10" for "yes" and otherwise "no" provides a
perfect separation of your data (when building a model on the full
dataset - which Weka does after cross-validation).

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 577-5304
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Fw: J48 will work with file like this?

Peter Reutemann
In reply to this post by Abacap
> Apparently tree for some reason starts from second attribute not first. Should begin from first, right?
> How to change that?

I don't understand that question. "no_of_articles" is the third attribute.

You either let the algorithm build a model that works best or you have
to construct your own rules. You can't have it both ways.

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 577-5304
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: J48 will work with file like this?

Abacap
In reply to this post by Peter Reutemann
Thank you for reply.
So Weka classifier decides automatically which attribute is most promissing and ignores other.
That's why decission tree does not include less promissing attributes, right?
 
 
Sent: Friday, October 30, 2020 at 8:38 PM
From: "Peter Reutemann" <[hidden email]>
To: "Weka machine learning workbench list." <[hidden email]>
Subject: [Wekalist] Re: J48 will work with file like this?
> J48 will work with file like this?

Yes.

> Or it will only correctly clasify nominal values?

J48 can handle numeric attributes. Here are its full capabilities
(copy/paste from the dialog that opens when you click on
"Capabilities" in the GOE window of the classifier):

Capabilities
Class - Nominal class, Binary class, Missing class values

Attributes - Missing values, Nominal attributes, Empty nominal
attributes, Numeric attributes, Binary attributes, Date attributes,
Unary attributes

Additional
min # of instances: 0

> Here''s my test file (clients' purchase history) and 'lost' class
>
>
> @relation clients_history
> @attribute client_id numeric
> @attribute turnover numeric
> @attribute no_of_articles numeric
> @attribute purchase_quantity numeric
> @attribute lost {yes,no}
>
> @data
> 101,456,10,3,yes
> 100,231,12,5,no
> 200,128,5,1,yes
> 300,167,23,4,no
> 305,99,9,6,yes
> 400,89,3,2,yes
> 401,567,56,19,no
> 402,298,29,20,no
> 500,88,3,3,yes
> 501,78,2,2,yes
>
> Yet after 'cross-validation' classification with J48 in visualization I see only 'no_of_articles' node and 'yes' and 'no' subnodes attached to it. I do not think should be like that...

Why? "no_of_articles <= 10" for "yes" and otherwise "no" provides a
perfect separation of your data (when building a model on the full
dataset - which Weka does after cross-validation).

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 577-5304
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
 
 

_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: J48 will work with file like this?

Peter Reutemann-3
Yes. I recommend reading the publications associated with an algorithm (references, if available, you can find in the dialog that opens with the MORE button in the GOE or in command-line help). Also, a lot of these questions have been answered on this mailing list before, so have a look through archives.

Cheers, Peter

On November 1, 2020 2:15:47 AM GMT+13:00, [hidden email] wrote:
>_______________________________________________
>Wekalist mailing list -- [hidden email]
>Send posts to [hidden email]
>To unsubscribe send an email to [hidden email]
>To subscribe, unsubscribe, etc., visit
>https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
>List etiquette:
>http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 577-5304
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html