EdwinKipruto / mfp2

3 stars 0 forks source link

Handling of input matrix #21

Open matherealize opened 1 year ago

matherealize commented 1 year ago

Up until 09526413dd040e4b962f8c6a67fdddafa2dc88cb a call to model.matrix() would convert any input data to a model matrix. This includes conversion of factors into dummies.

That is fine, but leads to the problem that we need to handle the expansion of arguments such as df properly. At the moment, all factors levels are treated as individual variables (also see #13 ), unlike in mfp. Need to implement a helper that deals with this for mfpa().

In the current version we also need to check that the input object is indeed a matrix and does not contain factors, otherwise the program will crash.

Also relates to #20 .

matherealize commented 1 year ago

This will also affect fracplot and predict.mfpa, which both require matrix as input.

matherealize commented 1 year ago

I think the best solution would be to create a dedicated function prepare_input_for_mfp2 that handles all of this.

The goal would be to make the mfp2 function easy to use. It should accept