by: Chris Cave
(Feyn version 2.0 or newer)
auto_run method on the
QLattice is a convenience function for running the
QLattice simulator. This enables you to return fitted models to your data with a single line of code.
import feyn from feyn.datasets import make_classification train, test = make_classification() ql = feyn.connect_qlattice()
Then we use only one line of code to obtain models fitted to the data.
models = ql.auto_run( data=train, output_name='y', kind='classification' )
One epoch of
auto_run is roughly equivalent to:
Models from a
- fit the
Models to the data.
- prune the list of
- update the
QLatticewith the best diverse models.
If you are running this in a
Jupyter environment then it will display the best model at the current epoch. Underneath the model it displays the current epoch, the amount of
Models that have been sampled from the
QLattice and the loss of the
Model's predictions of the data.
This is the data that the
Models will be fitted to. Here each column is read as an input name except for the column that matches the
This is the name of the target variable as a string
The kind parameter can take one of "classification" or "regression" and this specifies whether the Models will be binary classifiers or regressors. The default is a regression. The loss function the
Models will be fitted to is
squared_loss for regressors or
binary_cross_entropy for classifiers.