Hello people,
I am developing a streamlit dashboard and I have different array lists that look like this
import numpy as np
import streamlit as st
svm_pred = np.array([1.50, 2.51, 3.34, 4.123, 5.22])
linear_pred = np.array([0.31, 2.11, 0.33, 4.0, 5])
bayesian_pred = np.array([1, 2.56, 3.89, 4, 5])
Now, I am using this arrays to plot different graphs and due to that I want the arrays to be selected from a dropdown list where when selected, it will automatically plot the graph.
Here is how I created my dropdown list:
preds = {
'SVM Predictions': svm_pred,
'Polynomial Regression Predictions': linear_pred,
'Bayesian Ridge Regression Predictions': bayesian_pred,
}
model_predict = st.sidebar.selectbox(
"Select the model to predict : ", list(preds.keys()))
On plotting code, I call the model_predict selectbox to plot the chart,otherwise the chart will be empty.
plot_predictions(adjusted_dates, world_cases,
model_predict, 'SVM Predictions', 'purple')
plot_predictions(adjusted_dates, world_cases, model_predict,
'Polynomial Regression Predictions', 'orange')
plot_predictions(adjusted_dates, world_cases, model_predict,
'Bayesian Ridge Regression Predictions', 'green')
When I run the code, I get this error
ValueError: Illegal format string "Polynomial Regression Predictions"; two marker symbols
What am I missing and how can I resolve this