Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Comparison Mode" for Calculators #198 #200

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions App.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,49 @@
st.write(calc["details"])
st.markdown("---")

calculator_inputs = {
"Income Estimator": ["Age", "Education Level", "Occupation", "Work Experience (years)", "Region"],
"Gold Price Predictor": ["S&P 500 Index (SPX)", "Crude Oil Price (USO)", "Silver Price (SLV)", "EUR/USD Exchange Rate"],
"House Price Estimator": ["Location", "Size (sq ft)", "Number of Bedrooms", "Number of Bathrooms", "Property Type"],
"Loan Eligibility": ["Credit Score", "Annual Income", "Loan Amount", "Loan Term (years)", "Employment Status"],
"Parkinson's Disease Risk": ["MDVP_Fo(Hz)", "MDVP_Jitter(%)", "MDVP_Shimmer(dB)", "NHR", "HNR", "DFA"],
"Sleep Disorder Prediction": ["Average Sleep Hours", "Exercise Frequency (per week)", "Stress Level", "Diet Quality", "Caffeine Intake (cups per day)"],
"PDF Malware Detector": ["File Name", "File Size (MB)", "File Type"],
"Stress Level Detector": ["Number of Daily Social Media Posts", "Sentiment of Posts", "Average Post Length (words)"],
"Text Summarizer": ["Text Length (words)", "Document Type", "Desired Summary Length (%)"],
"Real-Time Language Translator": ["Source Language", "Target Language", "Speech Speed (words per minute)"],
"Business Performance Forecaster": ["R&D Spend", "Administration Cost", "Marketing Spend", "Region", "Number of Employees"]
}

#Selecting a model to compare
st.subheader("Comparison Mode")
selected_model = st.selectbox("Select a calculator to compare", list(calculator_inputs.keys()))

if selected_model:
num_inputs = st.slider(f"Select number of input sets for {selected_model} comparison", min_value=2, max_value=5, value=2)

st.markdown(f"### {selected_model} - Comparison Mode")
inputs = []
input_prompts = calculator_inputs[selected_model]

for i in range(num_inputs):
st.markdown(f"### Input Set {i + 1}")
input_data = {}
for prompt in input_prompts:
input_data[prompt] = st.text_input(f"{prompt} (Input {i + 1})", key=f"{prompt}_{i}")
inputs.append(input_data)

# Display results side-by-side
if st.button("Compare Results"):
st.markdown("### Comparison Results")
cols = st.columns(num_inputs)
for i, col in enumerate(cols):
with col:
st.write(f"Input Set {i + 1}:")
for k, v in inputs[i].items():
st.write(f"{k}: {v}")
st.write("Result: (Prediction placeholder)")

st.markdown("## Get Started Today!")
st.markdown("Explore our calculators and take control of your predictive analytics journey!")

Expand Down
Loading