Feyn Documentation

Feyn Documentation

  • Learn
  • Guides
  • Tutorials
  • API Reference
  • FAQ

›Regression

Overview

  • Tutorials

Beginner

    Classification

    • Titanic survival
    • Pulsar stars
    • Poisonous Mushrooms

    Regression

    • Airbnb prices
    • Automobile MPG
    • Concrete strength

Advanced

    Regression

    • Wine Quality

Use cases

  • Rewriting models with correlated inputs
  • Complexity-Loss Trade-Off
  • Plotting the loss graph
  • Simple linear and logistic regression
  • Deploy a model for inference

Life Sciences

    Classification

    • Detecting Liver Cancer (HCC) in Plasma
    • Classifying toxicity of antisense oligonucleotides

    Regression

    • Covid-19 RNA vaccine degradation data set
    • Preventing the Honeybee Apocalypse (QSAR)

Interfacing with R

  • Classifying toxicity of antisense oligonucleotides

Archive

  • Covid-19 vaccination RNA dataset.

Concrete strength

by: Chris Cave

Feyn version: 2.1+

Last updated: 27/09/2021

Importing the dataset

Here we use the QLattice to predict the compressive strength of concrete based on the ingredients that have been used to make it. You can find this dataset and further descriptions of the features on UCI Machine Learning Repository.

import pandas as pd
import feyn
import numpy as np

from sklearn.model_selection import train_test_split
data = pd.read_csv("../data/concrete.csv")
data.head()
cement blast_furnace_slag fly_ash water superplasticizer coarse_aggregate fine_aggregate age concrete_compressive_strength
0 540.0 0.0 0.0 162.0 2.5 1040.0 676.0 28 79.99
1 540.0 0.0 0.0 162.0 2.5 1055.0 676.0 28 61.89
2 332.5 142.5 0.0 228.0 0.0 932.0 594.0 270 40.27
3 332.5 142.5 0.0 228.0 0.0 932.0 594.0 365 41.05
4 198.6 132.4 0.0 192.0 0.0 978.4 825.5 360 44.30

Connect to the QLattice

random_state = 42

train, test = train_test_split(data, test_size=0.4, random_state=random_state)
ql = feyn.connect_qlattice()
ql.reset(random_state)
output_name = "concrete_compressive_strength"

Use auto_run to obtain models

models = ql.auto_run(train, output_name=output_name)
Loss: 5.92E+01Epoch no. 10/10 - Tried 16521 models - Completed in 21s.concrete_compressive_strength linear: scale=38.935000 w=-0.348912 bias=-0.2386concrete..0outmultiplymultiply1addadd2cement linear: scale=0.004566 w=-0.644702 bias=-0.1647cement3numtanhtanh4age linear: scale=0.005495 w=-4.590090 bias=0.0572age5numaddadd6superplasticizer linear: scale=0.062112 w=0.553223 bias=1.0367superpla..7numblast_furnace_slag linear: scale=0.005565 w=0.502808 bias=0.7536blast_fu..8num
best = models[0]

Summary plot to evaluate performance

best.plot(train, test)
concrete_compressive_strength linear: scale=38.935000 w=-0.348912 bias=-0.2386concrete..0outmultiplymultiply1addadd2cement linear: scale=0.004566 w=-0.644702 bias=-0.1647cement3numtanhtanh4age linear: scale=0.005495 w=-4.590090 bias=0.0572age5numaddadd6superplasticizer linear: scale=0.062112 w=0.553223 bias=1.0367superpla..7numblast_furnace_slag linear: scale=0.005565 w=0.502808 bias=0.7536blast_fu..8numTraining MetricsR20.784RMSE7.59MAE5.83Test0.7269.026.94Inputscementagesuperplasticizerblast_furnace_slag

Training Metrics

Test

← Automobile MPGWine Quality →
  • Importing the dataset
  • Connect to the QLattice
  • Use auto_run to obtain models
  • Summary plot to evaluate performance

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®