Question: Consider this small and simple dataset: points = pd . DataFrame ( [ [ 1 , 1 ] , [ 2 , 1 ] ,

Consider this small and simple dataset:
points = pd.DataFrame(
[[1,1],[2,1],[3,3],[6,5],[7,7],[7,6]],
columns=["X","y"]
)
base = alt.Chart(points).mark_point().encode(
x='X',
y='y'
)
base
Now consider these three **potential** lines we could fit for the same dataset:
lines = pd.DataFrame(
[
[0.93,0.017562, 'Line A'],
[7,5.9868, 'Line A'],
[0,0.1022, 'Line B'],
[7,6.965, 'Line B'],
[0.26,0.003564, 'Line C'],
[8,7.0965, 'Line C']
],
columns=["X","y", 'Name']
)
base + alt.Chart(lines).mark_line().encode(
x='X',
y='y',
color='Name'
)
Use the graph below to roughly calculate the average squared vertical distance between the points and the blue line ("Line A" above).**Read values of the graph to a precision of 0.25**(e.g.1,1.25,1.5,1.75,2). We reprint the plot for you with only a single line to make it easier to estimate the locations on the graph.
*Save your answer to a variable named `answer2_0`.*
base + alt.Chart(lines[lines['Name']== 'Line A']).mark_line().encode(
x='X',
y='y',
)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!