Saturday, December 14, 2019

List Plots for ResourceData


boston=ResourceData["Sample Data: Boston Homes"]; boston[1,All]

ListPlot[boston[All,{"LSTAT","MEDV"}],
GridLines->Automatic,ImageSize->Large,
              PlotMarkers->Thread[{ChartElementData["EmptyMarkers"][[All, 1]],.01}]]


p=Predict[boston[All,"RM"]->boston[All,"MEDV"], Method -> "LinearRegression"]
Information[p]


p1=Plot[{p[x],p[x] + StandardDeviation[p[x,"Distribution"]],
                   p[x] - StandardDeviation[p[x,"Distribution"]]},{x, 3, 9},
                   PlotStyle->{Blue,Gray,Gray},Filling->{2->{3}},

Exclusions->False,PerformanceGoal->"Speed",
PlotLegends->{"Prediction","Confidence Interval"}];
p2=ListPlot[boston[All,{"RM","MEDV"}],PlotStyle->Red,
PlotLegends->{"Data"}];
Show[p1,p2,GridLines->Automatic,ImageSize->Large]



No comments:

Post a Comment