Skews

Now let's look at how the data for the house prices are distributed:

func hist(a []float64) (*plot.Plot, error){  h, err := plotter.NewHist(plotter.Values(a), 10)  if err != nil {    return nil, err  }  p, err := plot.New()  if err != nil {    return nil, err  }  h.Normalize(1)  p.Add(h)  return p, nil}

This section is added to the main function:

hist, err := plotHist(YsBack)mHandleErr(err)hist.Title.Text = "Histogram of House Prices"mHandleErr(hist.Save(25*vg.Centimeter, 25*vg.Centimeter, "hist.png"))

The following diagram is:

Histogram of House prices

As can be noted, the histogram of the prices is a little skewed. Fortunately, we can fix that by ...

Get Go Machine Learning Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.