Feyn Documentation

Feyn Documentation

  • Learn
  • Guides
  • Tutorials
  • API Reference
  • FAQ

›Essentials

Getting Started

  • Quick start
  • Using Feyn
  • Installation
  • What is the QLattice?

Essentials

  • Auto Run
  • Summary plot
  • Plot response
  • Splitting a dataset
  • Seeding a QLattice
  • Predicting with a model
  • Saving and loading models
  • Categorical features

Evaluate Regressors

  • Regression plot
  • Residuals plot

Evaluate Classifiers

  • ROC curve
  • Confusion matrix
  • Plot probability scores

Understand Your Models

  • Plot response 1D
  • Plot response 2D
  • Model signal
  • Segmented loss
  • Interactive flow

Primitive Operations

  • Using the primitives
  • Updating priors
  • Sample models
  • Fitting models
  • Pruning models
  • Visualise a model
  • Diverse models
  • Updating a QLattice
  • Validate data
  • Semantic types

Advanced

  • Converting a model to SymPy
  • Logging in Feyn
  • Setting themes
  • Saving a graph as an image
  • Using the query language
  • Estimating priors
  • Filtering models
  • Model parameters
  • Model complexity

Privacy & Commercial

  • Privacy
  • Community edition
  • Commercial use
  • Transition to Feyn 3.0

Summary plot

by: Kevin Broløs & Chris Cave
(Feyn version 3.0 or newer)


The summary of a Model can be seen using the plot function on the Model. This provides a graph visualisation of the Model with metrics and useful plots. The metrics and plots of the Model on the data passed are:

  • For regressors:
    • R2 score,
    • Root mean squared error,
    • Mean absolute error,
    • Regression plot,
    • Residuals plot.
  • For classifiers:
    • Accuracy at 0.5 threshold,
    • AUC,
    • Precision at 0.5 threshold,
    • Recall at 0.5 threshold,
    • ROC curve,
    • Confusion matrix at 0.5 threshold.

Example

import feyn

from sklearn.datasets import load_diabetes
import pandas as pd

from feyn.tools import split

# Load diabetes dataset into a pandas dataframe
dataset = load_diabetes()
df_diabetes = pd.DataFrame(dataset.data, columns=dataset.feature_names)
df_diabetes['response'] = dataset.target

# Train/test split
train, test = split(df_diabetes, ratio=[0.6, 0.4], random_state=42)

# Instantiate a QLattice
ql = feyn.QLattice(random_seed=42)

models = ql.auto_run(
    data=train,
    output_name='response'
)
# Select the best Model
best = models[0]
best.plot(
    data=train,
    compare_data=test
)


Parameters for model.plot

data

This should be the data the model has trained on.

compare_data

Can take a single dataframe to compare with, or a list of dataframes - in case you want to compare multiple datasets or splits with each other.

labels

You can pass in custom labels for the header of the summary metrics. If your list of labels is shorter than the compare_data argument, numbered labels will be generated for the rest.

filename

Use to specify a path to a file to save the plot to (as HTML).

best.plot(train, filename="feyn-summary.html")

Location in Feyn

This function can also be found in feyn.plots module.

from feyn.plots import plot_model_summary

plot_model_summary(best, train)
← Auto RunPlot response →
  • Example
  • Parameters for model.plot
    • data
    • compare_data
    • labels
    • filename
  • Location in Feyn

Subscribe to get news about Feyn and the QLattice.

You can opt out at any time, and you can read our privacy policy here.

Copyright © 2024 Abzu.ai - Feyn license: CC BY-NC-ND 4.0
Feyn®, QGraph®, and the QLattice® are registered trademarks of Abzu®