►
From YouTube: Build a ML.NET Machine Learning Model in F#
Description
Using F# to build a machine learning model with ML.NET.
Code - https://github.com/jwood803/MLNetExamples/blob/master/MLNetExamples/FSharpRegression/Program.fs
Contact:
Twitter: https://twitter.com/JWood/
Blog: https://jonwood.co/
Gear used (affiliate links):
Mic - https://amzn.to/2YEXtxI
Mouse - https://amzn.to/2ZtASoQ
A
Hey
everyone.
So,
while
you
may
have
seen
a
lot
done
that
being
used
and
c-sharp
hats
did
you
know
that
they
can
also
be
used
in
F
sharp
apps
as
well?
If
you're
familiar
with
F
sharp,
it
is
a
functional
first
programming
language
and
in
this
video
I'll
show
how
to
use
F
sharp
to
build
a
machine
learning
model
with
a
no
net.
A
So
here
we
are
in
Visual,
Studio
and
I
have
an
F,
sharp,
banette
core
console
project
loaded
here
and
I.
Have
my
my
data
files
already
loaded
here?
I
have
separate
train
and
test
files
in
the
data
is
just
the
simple
salary
data
that
we
have
used
before
with
just
use
of
experience
and
we're
going
to
predict
the
salary
based
off
the
years
of
experience.
A
There's
no
new
keyword
here.
You
don't
need
to
do
this
and
F
sharp
it
does
it
automatically
and
since
I
have
two
different
files:
I
need
to
load
in
I'm,
going
to
create
a
method
here.
I
can
do
this
in
line
within
that
sharp
gonna
call
it
load
data
by
path.
I'm
gonna,
give
it
a
pass
as
a
parameter
and
notice
an
F,
sharp
I.
Don't
need
to
create
parenthesis
for
parameters
here
in
this
method.
I'll
create
contacts
that
data
that
load
from
text
file
and
I'll
need
to
create
an
input.
A
A
A
A
Look
that
test
file,
not
test
data,
so
next
to
create
our
pipeline
here
and
to
get
started
that
sharp
need
to
use
something
called
estimator
chain.
It
kind
of
helps
with
the
bring
us,
the
crit
types
and
all
that
before
I
sharp,
a
pin
and
we'll
use
the
concatenate
transform
to
create
a
features
vector
from
our
years
experience
column
and
then
we'll
append
the
copy
columns
transform
yes,
so
I
can
just
get
a
label
column
from
the
salary
column
and
then
we'll
bring
in
the
regression
trainers.
A
A
A
We're
doing
another
print
function
or
evaluate
the
model,
and
next
we'll
get
some
metrics
from
our
model
and
they
were
using
context
regression
that
evaluate
method.
We
pass
in
the
predictions
for
my
test
data
and
we'll
get
that
label
column
name,
which
is
label
and
the
score
column
name,
which
is
gonna,
be
score
and
that
score
is
gonna,
come
up
later
and
another
type
that
will
create.
A
A
A
But
since
this
all
since
they're,
both
done
at
languages,
we
can
enter
up
libraries
between
the
two
languages,
so
contacts
that
model
to
create
prediction
engine.
You
know
we
give
it
an
input,
call
an
input
type
here,
settler
data,
but
we
also
need
the
prediction
type
that
we
need
to
create
as
well
and
real,
quick,
we'll
pass
in
the
model
for
that
parameter,
so
we'll
go
up
and
we'll
create
another
type.
A
A
So
notice
we
get
an
error
here,
and
generic
construct
requires
that
the
salary
prediction
type
have
a
public
default
constructor,
and
so
in
order
to
fix
that
area,
we
have
to
give
the
seller
prediction
an
attribute
here,
and
that
attribute
is
called
CLI
mutable.
That
just
gives
it
that
default
constructor
that
the
area
was
telling
about.
So
we
have
our
prediction
function.
Next
will
actually
create
a
prediction,
so
here's
a
prediction
function
called
predict
on
it.
You
know
c-sharp.
When
we
did
this,
we
created
a
new
salary
data
object.
A
We
don't
quite
need
to
do
that
in
that
sharp
it
can
actually
infer
the
type
for
us.
So
we
do
square
brackets
or
curly
brackets,
and
we
do
years
of
experience
and
we'll
say
eight
that
we
won
predict.
Now,
however,
we
still
get
some
red
squigglies,
and
that
means
we
need
to
give
it
this
salary
property
as
well,
and
because
we
don't
need
this
for
prediction:
we're
going
to
just
put
0
that
0.
In
fact,
I've
made
a
type
0
as
well
0
F
to
make
it
a
float
instead
of
separating
each
by
a
comma.
A
A
And
that's
gonna
be
the
prediction
that
predicted
selling:
let's
run
this
actually
real
quick,
we
do
a
console.
The
real
on
to
it'll
stay
there
for
us
and
we
get
a
little
warning
here.
The
result
of
this
is
a
string
and
when
I
do
anything
with
it,
and
so
what
we
can
do
is
that
we
can
pipe
it
to
a
built-in
function
called
ignore,
and
what
that
does
is
just
my
name.
Is
it
know
what
NORs?
What
the
output
of
this
is?
So,
let's
run
this
I.
A
So
we
couldn't
find
implica
years
experience
so
we
might
have,
but-
and
that
is
because
we'll
have
years
of
experience
here
and
these
need
to
match
what
we're
getting
into
the
input.
So
it's
one
that
again
that
should
work.
Oh
I
forgot
to
change
it
down
here
as
well.
A
There
we
go
training
and
value
at
it
on
our
on
a
model
here,
but
we
get
a
big
negative
R
squared
a
prediction
doesn't
really
make
much
sense
for
a
salary.
That's
a
one
thing
that
it
would
have
to
do
pretty
often
when
doing
machine
learning
is
experimenting
with
different
trainers
or
machine
learning.
Algorithms.
So
much
trouble
this
poor
song.
Regression
here
well,
then,
and
see
what
we
get
alright
so
now,
I'm
gonna
r-squared
of
eighty-eight
percent
and
ninety
seven
thousand
is
our
prediction.
A
For
eight
years
of
experience,
it's
not
a
much
better
result
than
what
we
get
in
there
in
the
previous
trainer
that
we
used
before
all
right.
So
that's
just
a
quick
introduction
on
how
to
use
in
Linette
within
an
f-sharp
project.
As
you
can
see
a
there
wasn't
too
many
differences
other
than
some
syntactic
differences
there,
and
we
also
got
to
see
where
I
messed
up
a
bit
and
how
I
fixed
it
so
I
hope,
at
least
that
part
was
helpful.