bethatkinson / rpart

Recursive Partitioning and Regression Trees
47 stars 24 forks source link

Use other kind of object different to continuous, or categorical #69

Open Afr063426 opened 1 day ago

Afr063426 commented 1 day ago

Hello, I am trying to use my own metric to define splits. The y variable is no continuous neither categorical. It is an object created, and it is a list with two vectors with vctrs::new_vctr. I get this error "Error in model.frame.default(formula = histograma ~ prueba, data = histogramas_ejemplo : invalid type (list) for variable 'histograma'" Someone have tried something similar? And how do you solve this?

bethatkinson commented 1 day ago

The function is designed to use results from model.matrix(). Does the endpoint that you've created work with model.matrix?

From: Joshua Cervantes Artavia @.> Sent: Monday, October 14, 2024 9:12 PM To: bethatkinson/rpart @.> Cc: Subscribed @.***> Subject: [EXTERNAL] [bethatkinson/rpart] Use other kind of object different to continuous, or categorical (Issue #69)

Hello, I am trying to use my own metric to define splits. The y variable is no continuous neither categorical. It is an object created, and it is a list with two vectors with vctrs::new_vctr. I get this error "Error in model.frame.default(formula = histograma ~ prueba, data = histogramas_ejemplo : invalid type (list) for variable 'histograma'" Someone have tried something similar? And how do you solve this?

- Reply to this email directly, view it on GitHubhttps://github.com/bethatkinson/rpart/issues/69, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACWQG54OB7BO2FCSNAMPA6LZ3R2VLAVCNFSM6AAAAABP6CZLLKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGU4DONBTGM4TCOI. You are receiving this because you are subscribed to this thread.Message ID: @.**@.>>

Afr063426 commented 7 hours ago

No, should I do that work with model.matrix? And with this should it work?

bethatkinson commented 7 hours ago

Start by getting model.matrix to work

From: Joshua Cervantes Artavia @.> Sent: Wednesday, October 16, 2024 7:52 AM To: bethatkinson/rpart @.> Cc: Atkinson, Beth J., M.S. @.>; Comment @.> Subject: [EXTERNAL] Re: [bethatkinson/rpart] Use other kind of object different to continuous, or categorical (Issue #69)

No, should I do that work with model.matrix? And with this should it work?

- Reply to this email directly, view it on GitHubhttps://github.com/bethatkinson/rpart/issues/69#issuecomment-2416757639, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACWQG54EIZ62DJHUAWF72J3Z3ZOQLAVCNFSM6AAAAABP6CZLLKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJWG42TONRTHE. You are receiving this because you commented.Message ID: @.**@.>>