import matplotlib.pyplot as plt
import pandas as pd
# initialize list of lists
data = [['Linear Regression', 0, .48], ['Random Forest', .075, .04, 14, .19, 69], ['lightgbm', 0, .07, 31, .16, 69],
['XGBoost', .06,.04,29,.15, 69],
['Neural Net', 0, .15], ['SVM', 0, .13, 4, .42, 69]
]
# Create the pandas DataFrame
df = pd.DataFrame(data, columns = ['Model Class', 'Avg Error', 'Low Avg Error', 'Schools Pred Bel .3','Low GT Error', 'Schools Bel .3'])
# print dataframe.
df
import plotly.express as px
fig = px.bar(df, x='Model Class', y='Avg Error', title="Models with Avg Error",
# title= 'Judged by the Low Average Error'
hover_data=['Schools Pred Bel .3', 'Schools Bel .3']
)
fig.show()
import plotly.express as px
fig = px.bar(df, x='Model Class', y='Low Avg Error', title="Models with most correct predictions for schools with 30% or lower internet connectivity",
# title= 'Judged by the Low Average Error'
hover_data=['Schools Pred Bel .3', 'Schools Bel .3']
)
fig.show()
fig = px.bar(df, x='Model Class', y='Low GT Error', title="Models with avg error for predictions on schools with only 30% or lower internet connectivity",
# title= 'Judged by the Low Average Error'
)
fig.show()