►
From YouTube: ML.NET End-to-End 2: Building a Web API
Description
Continuing the end-to-end ML.NET project by creating a Web API that loads the ML.NET model and gives a prediction.
First video in series - https://www.youtube.com/watch?v=VVekyUMEKsI
Code - https://github.com/jwood803/MLNet-EndToEnd/tree/master/WineAPI
Contact:
Twitter: https://twitter.com/JWood/
Blog: https://jonwood.co/
A
Hey
everyone,
if
you
remember
from
our
first
video
in
this
in
Medinah
indian
series,
we
created
our
resources
and
they
recreated
this
console
project
where
we
used
a
Madonna
to
get
data
from
the
database
to
create
our
pipeline
and
our
Madonna
model,
and
then
we
also
saved
that
model
to
Azure
blob
storage.
So
now
what
I
want
to
do
in
this
video
is
I
want
to
actually
utilize
the
the
model
that
we
created
here
and
create
a
Web
API.
A
A
A
Before
we
continue
I'm
gonna,
add
some
new
get
product
packages
here
and
I'll
do
mo
net,
so
we
can
load
the
model
and
and
what
an
AdMob
so
load.
The
in
my
data
model
I'm
using
version
1
for
this
and
I'm
gonna
get
a
couple
of
Microsoft
extensions
for
configuration,
because
I'm
still
going
to
use
that
that
JSON
file
from
my
configurations
here
so
I'll
get
the
main
configuration
1
and
then
I'm
get
to
jason
1.
A
Very
good
all
right!
So
let's
go
back
to
this
controller
here
controller
here,
and
this
just
like
I
said
before
this
is
going
to
be
used
to
load
in
the
model
and
it
predicts,
and
since
we
are
going
to
be
sending
in
data
and
to
this
API,
to
use
that
data
to
predict
from
it.
We
can't
use
an
HTTP
GET
call
because
read
to
send
us
some
data,
so
standard
we're
doing
HTTP,
POST
method
here
and
I'm.
A
Gonna
put
it
as
a
sink
because
we're
gonna
mix
an
async
all
within
it
and
I'm
a
return
to
float
and
that's
going
to
return
the
divine
quality.
A
number
that
will
give
that
from
our
prediction
from
the
model
opposed
and
to
send
in
the
data
that
we
need
to
use
to
predict
predict
from
I'm
gonna
use
the
from
body,
because
it's
going
to
get
it
from
the
body
of
our
request
and
it's
going
to
be
the
wand
data
call
my
data
yeah.
A
A
Another
project
we're
kind
of
hold
all
of
our
our
common
code,
and
that
is
going
to
be
do
it
done
a
core
class
library
I
just
in
wand,
common
good.
What
I
can
do
here,
I'm
good?
What
I
can
do
here
is
I,
can
just
move
this
up
in
here
or
remove
this
class
that
I
created
and
go
and
to
use
this
project
within
these
others,
too.
I
have
to
add
a
reference
to
it.
A
If
your
blob
storage
I
need
a
fix
out
my
configuration
kind
of
similar
to
what
we
did
up
here
before
we
built
a
configuration
from
a
JSON
file.
I'm
gonna
do
the
same
thing
in
here,
but
this
is
a
little
bit
different
since
it's
a
Web
API
project,
if
your
project
so
I'm
startup
here
I
have
this
configuration
and
then
this
configure
services
is
where
I
can
I
can
set
this
so
I'm
actually
going
to
take
some
code.
Here
we
have
app
settings,
there's
our
app
settings
and
I'm
going
to
replace
this.
A
A
A
A
A
A
It's
gonna
be
just
the
same
name
as
what
we
have
in
our
blob
storage,
I'm
back
to
our
post
method.
Here,
what
I
want
to
do
first
is
check
if
we
already
have
the
file
downloaded.
If
you
already
have
it
downloaded,
there's
no
need
to
download
it
again.
So
I
can
do
this.
If
it's,
the
file
does
not
exist
and
I'll
just
pass
in
the
model
path
from
here
since
it
doesn't
exist,
I
can
access
it
from
blob
storage.
You
do
is
kind
of
do
similar
to
what
we
did
before.
A
A
A
A
A
Data
view
schema
so
I'm
just
do
get
up
here.
Out
of
you
schema
schema
just
past
that
in
that's
now
a
row
now
we
have
to
model
load
it
locally.
We
can
start
and
by
creating
the
prediction
engine,
and
that
comes
in
from
the
context
that
model
that
create
prediction
engine-
and
this
is
just
like
we've
seen
several
times
before
and
m/l
done-
that
we
have
to
give
at
the
info
schema
and
the
prediction
schema
which
we
don't
have
created
yet
and
then
we'll
just
pass
in
the
model.
A
A
Good
bring
that
in
all
right
and
then
in
the
controller
now
to
seize
up,
because
we
ought
to
have
that
namespace
brought
in
and
now
we
have
our
prediction.
Engine
I
can
create
our
prediction
function
or
create
our
prediction
and
do
prediction.
Engine
I
have
to
predict
and
we'll
just
pass
in
the
data
we
get
here.
A
A
A
Now
and
I
didn't
because
I'm
told
you
a
gate
requesting
we
don't
have
a
get
request
there
we
go
this
and
we
got
a
predicted
quality
of
of
none
so
seems
like
this
is
a
pretty
good
one.
That's
that's
it
kind
of
a
basic
way
to
create
an
API
the
loads
in
a
mode
on
that
model
and
gives
us
a
prediction,
and
so
our
next
video
is
we're.