ModelParameters.jl icon indicating copy to clipboard operation
ModelParameters.jl copied to clipboard

Facilities to update Table

Open virgile-baudrot opened this issue 4 years ago • 3 comments
trafficstars

update!(ruleset,df) is fantastic.

Maybe some facilities to update df would be nice (maybe already implemented but I'm not aware of). Using DataFrame.jl, I do:

df[(df.component .== MyRule) .& (df.fieldname .== :myParam), :val] .= NewValue

virgile-baudrot avatar Jul 02 '21 13:07 virgile-baudrot

No, nothing implemented for that, I haven't actually used this for dataframes much. My main goals were use with Optim and Interact, and simple Tables.jl load/save of parameters. I kind of stalled on adding anything once those were working well. So ideas are appreciated.

It also might not be the best structure for updating specific things like that because components/fieldnames can be duplicates. I guess I would update a model directly with Accessors.jl and make a new dataframe from it if I wanted to change something specific like that, in any case that the differences weren't just stored in a CSV.

This workflow wasn't really my intention for it I guess - it was more just verbatim load/save of the data. But I'm also not a data scientist so I don't really think about these things much or very clearly.

rafaqz avatar Jul 03 '21 06:07 rafaqz

Ok fine.

components/fieldnames can be duplicates

Indeed, that's why I considered using both colum. But maybe you can have combination of components*fieldnames duplicated ... but it would mean that it's the same model called several time.

virgile-baudrot avatar Jul 05 '21 07:07 virgile-baudrot

Component x field name can be duplicated. A simple example is a collection of objects of the same type. I have this problem at the moment, unfortunately.

Could you elaborate on the interface that you are looking for with update!(ruleset, df)?

bgroenks96 avatar Feb 03 '22 12:02 bgroenks96