confidence interval

This commit is contained in:
Joey Eamigh
2024-04-18 17:09:06 -04:00
parent dcc96e130d
commit 45f293f75c

View File

@@ -18,15 +18,15 @@ else:
target = "Gross" target = "Gross"
drivers = [ drivers = [
"Release Year", # "Release Year",
"Duration", # "Duration",
"IMDB Rating", # "IMDB Rating",
"Metascore", # "Metascore",
"Votes", # "Votes",
"Genre 1", # "Genre 1",
"Genre 2", # "Genre 2",
"Genre 3", # "Genre 3",
"Director", # "Director",
"Cast", "Cast",
] ]
@@ -38,8 +38,11 @@ y, X = dmatrices(description_string, data=df, return_type="dataframe")
model = sm.OLS(y, X) model = sm.OLS(y, X)
results = model.fit() results = model.fit()
summary = results.summary()
print(results.summary()) # print(results.pvalue)
print(results.conf_int_el(0))
with open("./out/model_summary.csv", "w") as f:
f.write(results.summary().as_csv()) with open("./out/model_summary_cast.csv", "w") as f:
f.write(summary.as_csv())