by: Kevin Broløs & Chris Cave
(Feyn version 2.0 or newer)
Model that has been fitted can be used to perform predictions on a dataset.
An example model that adds two inputs together could look like this:
A regressor outputs values within the range of the output variable.
A binary classifier outputs values between
1. These are the probabilities of the samples belonging to the positive class. This can be rounded to get a discrete prediction of
The data you want to predict for should as a minimum contain the inputs present in the
Model. Any additional columns present will be ignored.
Here is an example of using the
import feyn from feyn.datasets import make_classification # Generate a dataset and put it into a dataframe train, test = make_classification() # Connect to a QLattice and run a classification simulation ql = feyn.connect_qlattice() models = ql.auto_run( data=train, output_name='y', kind='classification' ) # Select the best model and predict best = models best.predict(test)
predict function returns a
np.array of predictions.