rdrr1990 / kerasformula

A high-level interface to keras for R that takes advantage of formulas
51 stars 5 forks source link

Possible to make "data" 1st argument? #8

Closed eoppe1022 closed 6 years ago

eoppe1022 commented 6 years ago

Hey, awesome package. Do you think it would be possible to rearrange the formula so that data is the first argument? That way, the formula could be pipeable like data %>% kms()

rdrr1990 commented 6 years ago

Thanks! Sorry for delayed reply--caught me traveling. I made the formula the first argument so as to make the function feel like 'lm' or 'glm'. However you can pipe data like so:

iris %>% 
    kms(input_formula = "Species ~ .") 
       %>% plot_confusion

or

mtcars %>% 
   filter(complete.cases(mpg)) %>% 
     kms(input_formula = "mpg ~.") ->
out

How's that seem?

(Also added more permanent example here)

eoppe1022 commented 6 years ago

That's awesome! Nice work. Feel free to close if you want.

rdrr1990 commented 6 years ago

Great!