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:
- be a
- contain the inputs present in the
Any additional columns in the DataFrame that are not inputs to the model 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 # Predicting on a DataFrame best.predict(test) # Predicting on a Series best.predict(test.iloc)
predict function returns a
np.array of predictions.