O'Reilly logo

F# for Machine Learning Essentials by Sudipta Mukherjee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Finding linear regression coefficients using F#

The following is an example problem that can be solved using linear regression.

For seven programs, the amount of disk I/O operations and processor times were measured and the results were captured in a list of tuples. Here is that list: (14,2), (16,5),(27,7) (42,9), (39, 10), (50,13), (83,20). The task for linear regression is to fit a model for these data points.

For this experiment, you will write the solution using F# from scratch, building each block one at a time.

  1. Create a new F# program script in LINQPad as shown and highlighted in the following image:
    Finding linear regression coefficients using F#
  2. Add the following variables to represent the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required