Commit d8414ece by Rebecca Merrett

Upload New File

parent 7e914483
from sklearn import linear_model
from pandas import DataFrame
import pandas as pd
import pandas
import matplotlib.pyplot as plt
input_data = pandas.read_table("height.csv", sep=",", header=0, names=("weight", "height"))
plt.scatter(input_data["weight"], input_data["height"])
predictor = pd.DataFrame(input_data, columns=["weight"])
outcome = pd.DataFrame(input_data, columns=["height"])
lm = linear_model.LinearRegression()
lm_model =, outcome)
predicted_heights = lm.predict(predictor)
r_squared = lm.score(predictor, outcome)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment