Skip to content

F# Naive Bayes Classification Model built with Accord.NET and exposed via a Suave API

License

Notifications You must be signed in to change notification settings

lqdev/FSAccordSuaveDemo

Repository files navigation

F# Suave Accord Demo

This sample project shows how to expose a machine learning model built with Accord.NET via a Suave API

Dependencies

F# Tools

Windows
Linux
Mac

Install

Windows

.paket\paket.exe install

Mac/Linux

mono .paket\paket.exe install

Train Model

To train the model, run the App.fsx script

Start Server

To initialize the server, run the Server.fsx script

Get Prediction

With the server running, using a REST client like POSTMAN or Insomnia make an HTTP POST request to the enpoint http://localhost:3001/api/predict. In the request body include the data property which is a 2D array of type float.

Sample Request Body

{
	"data": [[3.3,1.6,0.2,5.1]] 
}

Sample Response

{
    "label": [
        "Iris-virginica"
    ]
}

About

F# Naive Bayes Classification Model built with Accord.NET and exposed via a Suave API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages