Giter Club home page Giter Club logo

automl-playground's Introduction

Small sample app for testing the Microsoft AutoML framework

The code is inspired by the following tutorial: Auto generate a binary classifier using the CLI and Github repo here

The code is based on training data from 30k labelled comments on Wikipedia ('Wikipedia Detox'). The data consists of a tab-separated values file (.tsv) with each line containing a comment and a value of either 1 or 0 representing whether it is an offensive comment or not. 3 different sizes of training data (100, 1000 and 30000 samples) enable testing of various levels of data quality.

Prerequisites

  1. Install .NET Core SDK 2.2 or later from here

  2. Install ML.NET CLI by entering the following in you terminal (on Windows you might have to log out/in after installing .NET Core SDK in order to have paths correctly setup to recognize the 'dotnet tool' command):

> dotnet tool install -g mlnet
  1. (Optional) Install VS Code from here

Running the sample

  1. cd into the root directory of this repo where this README.md file is placed.

  2. Train a simple model using the small dataset and using a short amount of time:

> mlnet auto-train --task binary-classification --dataset wiki100Rows.tsv --label-column-name Label --max-exploration-time 30

This will attempt training a number of models within the given time and should output a generated model with accuracy around 83% placed in 'SampleBinaryClassification⁩/SampleBinaryClassification.Model⁩/MLModel.zip'

  1. Run the custom console app 'CustomBinaryClassificationConsoleApp' in order to test the generated model:
> cd CustomBinaryClassificationConsoleApp
> dotnet run

You should notice that some senetences are badly predicted such as "you are pretty" which is categorized as hostile.

  1. Now try training a model with the large dataset using the following command (note the longer training time of 180 seconds due to the larger dataset):
> cd ..
> mlnet auto-train --task binary-classification --dataset wiki30000Rows.tsv --label-column-name Label --max-exploration-time 180

This should result in a much better performing model with accuracy around 96% which you can test again by running the commands:

> cd CustomBinaryClassificationConsoleApp
> dotnet run

And now you should hopefully experience a much better prediction regarding whether or not the sentences entered are hostile.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.