mendevi.models.base.Model¶
- class mendevi.models.base.Model(*args: tuple, **kwargs: dict)[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).
- accuracydict[str, float]
For each output label, associate the standard deviation of the associated average error. This dictionary is constructed when the .fit method is called (readonly).
Initialise the model.
Parameters¶
- titlestr, optional
The model title.
- **kwargsdict
Includes the following fields.
- 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 mendevi.plot.axis.Name.
- output_labelslist[str]
The name of all output parameters. The possibles values are mendevi.plot.axis.Name.
- parametersobject, optional
The learnable parameters for regressive models.
- fit(database: Path | str, select: str | None = None, query: str | None = None, table: str | None = None) Self[source]¶
Fit the trainable hyper parameters of the model.
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.
- tablestr, optional
The main sql table juste after the FROM in SELECT. It helps to choose the write query when there is several candidates.
Return¶
- self
A reference to the inplace fitted model.
- property parameters: Tensor¶
Return the trainable parameters of the model.
- predict(*input_args: tuple, **input_kwargs: dict) dict[str][source]¶
Perform the prediction(s) of this model.
Parameters¶
Returns¶
- predictiondict[str]
Associate each ouput variable with the prediction.