mendevi.models.base.Model

class mendevi.models.base.Model(title: str | None = None, **kwargs)[source]

Common structure to all models.

Attributes

citestr

The latex bibtext model citation.

parameterstorch.Tensor | None

The trainable parameters of the model (read and write).

input_labelslist[str]

The name of all input parameters (readonly).

output_labelslist[str]

The name of all output parameters (readonly).

Initialise the model.

Parameters

titlestr, optional

The model title.

sourcesstr

All sources for the model, the conference paper, the authors, etc.

input_labelslist[str]

The name of all input parameters. The possibles values are :py:cst:`mendevi.plot.axis.Name`.

output_labelslist[str]

The name of all output parameters. The possibles values are :py:cst:`mendevi.plot.axis.Name`.

parameterstorch.Tensor, optional

The learnable parameters for regressive models.

property cite: str

Return the bibtex citation.

fit(database: Path | str, select: str | None = None, query: str | None = None) Self[source]

Fit the trainable hyper parameters of the models.

Parameters

databasepathlike

The training database.

selectstr, optional

The python expression to keep the line, like mendevi plot --filter.

querystr, optional

If provided, use this sql query to perform the request, otherwise (default) attemps to guess the query.

Return

self

A reference to the inplace fitted model.

property input_labels: list[str]

Return the name of all input parameters.

property output_labels: list[str]

Return the name of all output parameters.

property parameters: Tensor

Return the trainable parameters of the model.

predict(*input_args, **input_kwargs) dict[str][source]

Perform the prediction(s) of this model.

Parameters

*input_args, **input_kwargs

The parameters values, with the keys defined during initialisation.

Returns

predictiondict[str]

Associate each ouput variable with the prediction.