model2names
- pyoptex.utils.model.model2names(model, col_names=None)[source]
Converts the model to parameter names. Each row of the model represents one term.
For example, the row [1, 2] with column names [‘A’, ‘B’] is converted to ‘A * B^2’.
Parameters
- modelnp.array(2d) or pd.DataFrame
The model
- col_namesNone or list(str)
The name of each column of the model. If not provided and a dataframe is provided as the model, the names are taken from the model dataframe. If the model is a numpy array, the columns are named as [‘1’, ‘2’, …]
Returns
- param_nameslist(str)
The names of the parameters in the model.