Training sequential models with Q#, using built-in datasets

This sample uses Q# and the Microsoft.Quantum.MachineLearning library to train a simple sequential model. The model is trained on the wine dataset from the UCI Machine Learning Repository, using a classifier structure defined in Q#.

Prerequisites

Running the Sample

This sample can be run in a number of different ways, depending on your preferred environment.

Python in Visual Studio Code or the Command Line

At a terminal, run the following command:

python host.py

C# in Visual Studio Code or the Command Line

At a terminal, run the following command:

dotnet run

C# in Visual Studio 2019

Open the folder containing this sample in Visual Studio ("Open a local folder" from the Getting Started screen or "File → Open → Folder..." from the menu bar) and set Wine.csproj as the startup project. Press Start in Visual Studio to run the sample.

Manifest

  • Training.qs: Q# code implementing quantum operations for this sample.
  • host.py: Python code to interact with and print out results of the Q# operations for this sample.
  • Host.cs: C# code to interact with and print out results of the Q# operations for this sample.
  • Wine.csproj: Main C# project for the sample.