Streamlit Guideď
This guide covers the web-based interface of RegressionLab built with Streamlit. The Streamlit version provides a modern, browser-based experience for curve fitting operations.
Overviewď
The Streamlit interface offers:
Modern UI: Clean, intuitive design.
Accessibility: Works on any device with a browser.
No installation: Use the online version instantly.
Visual feedback: Real-time updates and progress indicators.
Easy sharing: Share results by downloading plots.

Configuration (language, UI colors, fonts, plot style, paths, etc.) is the same as the Tkinter app: edit the .env file or use the Tkinter Configure menu. The Streamlit UI has no in-app configuration dialog; it reads LANGUAGE, UI_BACKGROUND, UI_FOREGROUND, UI_BUTTON_*, UI_FONT_*, and the rest of the env schema. The initial language and the entire look (background, sidebar, buttons, text) follow the same rules as the desktop version. The sidebar is rendered slightly lighter than the main area for visual separation.
Accessing Streamlitď
Online Version (Recommended)ď
Visit: https://regressionlab.streamlit.app/
First-time access:
Open the URL in your browser.
If you see âApp is sleepingâ, click âStartâ.
Wait 30-60 seconds for the app to wake up.
The app will load and be ready to use.
Local Versionď
If you have RegressionLab installed locally:
Windows:
bin\run_streamlit.bat
macOS/Linux:
./bin/run_streamlit.sh
Or use the direct command:
streamlit run src/streamlit_app/app.py
The app will open automatically in your default browser at http://localhost:8501.
Interface Layoutď
The Streamlit interface consists of three main areas:
2. Main Area (Center)ď
Logo and Title: RegressionLab branding.
Help Section: Expandable information about the app.

Operation Controls: File upload, variable selection, equation selection.

Results Display: Plots and fitting results.
3. Results Section (Bottom)ď

Three columns: Equation (formula and formatted equation, left), Parameters (fit parameters with uncertainties and IC 95%, center), Statistics (R², RMSE, Ď², etc., right).
Plot Display: Visualization of fitted curves below the columns.
Download Button: Below each plot; save as PNG, JPG, or PDF (when configured).
Language Selectionď
Changing the Languageď
Look at the sidebar (left side).
Click the language button. The button always shows the next language in the cycle:
âEnglish đŹđ§â â switch to English (when current is Spanish).
âDeutsch đŠđŞâ â switch to German (when current is English).
âEspaĂąol đŞđ¸â â switch to Spanish (when current is German).
The entire interface updates immediately. Click again to cycle to the next language.
Available Languages (cycle order: es â en â de â es):
Spanish (EspaĂąol) â default.
English.
German (Deutsch).
Operation Modesď
Mode 1: Normal Fittingď
Purpose: Fit one equation to one dataset.
Steps:
Select Mode:
In the sidebar, ensure âNormal Fittingâ is selected.
Optional: Loop fitting:
Check âDo you want loop fitting?â if you plan to fit another file with the same equation later.
When enabled, after the first fit an expander lets you upload another file and click âFit againâ without changing the equation.
Upload Data:
Click âBrowse filesâ or drag and drop your file.
Supported formats: CSV, XLSX, TXT.
Wait for the file to upload and process.
View Data (Optional):

Expand âShow Dataâ to preview your dataset.
Verify columns are loaded correctly.
Select Variables:

Independent Variable (X): Choose from dropdown (e.g., âtimeâ).
Dependent Variable (Y): Choose from dropdown (e.g., âtemperatureâ).
Plot Name: Enter a name for the output file (e.g., âexperiment1â).
Select Equation:
Choose an equation type from the dropdown.
Options include Linear, Quadratic, Sine, Cosine, Logarithmic, etc.
Formula shown next to each option (e.g., âLinear with intercept - y=mx+nâ).
Plot Options (optional):
Show plot title: Checkbox to show or hide the title on the plot. Default comes from the
PLOT_SHOW_TITLEenvironment variable; you can override it per fit without changing the config.
Fit the Curve:
Click âNormal Fittingâ button (blue button).
Wait for processing (spinner appears).
Results appear below.
Review Results (three columns + plot):

Equation (left): Formula and formatted equation with fitted values.
Parameters (center): Fit parameters (e.g. a, b, c) with uncertainties and IC 95%.
Statistics (right): R², RMSE, Ď², Ď²_red, degrees of freedom.
Plot: Data points and fitted curve below the columns (title uses the plot name if enabled).
Download: Button below the plot (PNG/JPG/PDF depending on configuration).
Download Plot:
Click the âđĽ Downloadâ button below the plot.
File format is that configured for the app (default PNG); if PDF is configured, the in-app preview is PNG but the download is PDF. The plot title (when shown) uses the plot name you entered; no numeric suffix is added.
Custom Formula:
If âCustom Formulaâ is selected:
Enter Number of Parameters: Use the number input (1-10).
Name Parameters: Enter names in the input boxes (e.g., âaâ, âbâ, âcâ).
Enter Formula: Type your formula using Python syntax.

Example:
a*x**2 + b*x + c.Use
xas the independent variable.Use parameter names defined above.
Supported:
+,-,*,/,**(power),np.sin(),np.cos(),np.exp(),np.log(), etc.
Example Workflow:
1. Upload: temperature_experiment.csv
2. Select X: time, Y: temperature
3. Plot name: "temp_vs_time"
4. Equation: "Linear with intercept"
5. Click "Normal Fitting"
6. View results: y = 2.5¡time + 20.3, R² = 0.98
7. Download plot
Mode 2: Multiple Datasetsď
Purpose: Apply the same equation to multiple different files.
Steps:
Select Mode:
In sidebar, click âMultiple Datasetsâ.
Select Equation First:
Choose the equation type youâll use for all datasets.
If using custom formula, define it here.
Upload Multiple Files:
Click âBrowse filesâ.
Hold Ctrl (Windows/Linux) or Cmd (Mac) to select multiple files.
Or use drag-and-drop for multiple files.
All files upload simultaneously.
Configure Each Dataset:
For each uploaded file:
File name shown as heading.
Select X variable.
Select Y variable.
Enter plot name (defaults to filename).
Plot Options (optional):
Show plot title: Checkbox to show or hide the title on all plots. Default from
PLOT_SHOW_TITLEenv var.
Fit All Datasets:
Click the âMultiple Datasetsâ button (centered, blue).
All datasets are fitted sequentially.
Progress indicators shown.
Review All Results:
Results displayed for each dataset.
Each has its own:
Equation.
Parameters.
Plot.
Download button.
Scroll through results to compare.
Tips:
All files should have similar column names.
X and Y variables can be different for each file if needed.
Results appear in upload order.
You can upload another set of files and click the button again for another round of fits with the same equation.
Example Workflow:
1. Equation: "Quadratic"
2. Upload 3 files:
- sample1.csv
- sample2.csv
- sample3.csv
3. For each:
- X: concentration
- Y: absorbance
4. Click "Multiple Datasets"
5. Review 3 separate fit results
6. Compare parameters and R² values
Mode 3: Checker Fittingď
Purpose: Test multiple equations on the same dataset to find the best fit.
Steps:
Select Mode:
In sidebar, click âChecker Fittingâ.
Upload Data:
Upload your single data file.
Select Variables:
Choose X and Y variables.
Enter plot name.
Select Multiple Equations:
Click in the âSelect equationâ dropdown.
Select multiple options by clicking each one.
Options remain in the dropdown (multi-select).
Default: First 3 equations pre-selected.
Custom formulas not available in this mode.
Plot Options (optional):
Show plot title: Checkbox to show or hide the title on all plots. Default from
PLOT_SHOW_TITLEenv var.
Run Checker Fitting:
Click âChecker Fittingâ button.
Progress bar shows completion.
Each equation fitted sequentially.
Compare Results:
All results displayed vertically.
Compare:
R² values (higher is better).
Visual fit quality in plots.
Parameter values.
Identify the best-fitting equation.
Example Workflow:
1. Upload: unknown_relationship.xlsx
2. X: voltage, Y: current
3. Select equations:
- Linear with intercept (y=mx+n)
- Quadratic (y=ax²)
- Inverse (y=a/x)
- Logarithmic (y=a¡ln(x))
4. Click "Checker Fitting"
5. Compare results:
- Linear: R²=0.75 (poor)
- Quadratic: R²=0.92 (good)
- Inverse: R²=0.98 (excellent!) â Best fit
- Logarithmic: R²=0.85 (acceptable)
6. Conclusion: Use inverse function
Mode 4: View Dataď
Purpose: View data from a file without performing any fitting. Includes transform, clean, and download options.
Steps:
Select Mode:
In the sidebar, select âView Dataâ (or âMirar datosâ in Spanish).
Upload Data:
Click âBrowse filesâ or drag and drop your file.
Supported formats: CSV, XLSX, TXT.
View Data:
Expand the data section to see the table.

Click Show variable pairs (or equivalent in your language) for scatter matrix (pair plots).
If there are more than 10 variables, a multiselect appears to choose which variables to display (max 10 for readability).
Transform Data (optional):
Select a transform from the dropdown: FFT, FFT magnitude, inverse FFT, DCT, inverse DCT, log, log10, exp, sqrt, square, standardize (z-score), normalize [0,1], Hilbert, inverse Hilbert, envelope (Hilbert), Laplace (discrete), inverse Laplace, cepstrum (real), Hadamard (Walsh), inverse Hadamard.

Click Transform to apply. The table updates immediately.
Clean Data (optional):
Select a cleaning option: drop NaN rows, drop duplicates, fill NaN (mean/median/zero), or remove outliers (IQR or z-score).
Click Clean to apply. The table updates immediately.
Download Updated Data (optional):
Choose format (CSV, TXT, XLSX) from the dropdown.
Click the download button to save the current (possibly transformed/cleaned) data.
Help (optional):
Expand the Help section for a reference with pair plots, transform options (each with a detailed description), clean options (each with a detailed description), and save. Content available in Spanish, English, and German.
Use case: Inspect columns, check data quality, transform or clean data, visualize variable pairs, or download processed data before deciding on a fitting mode.
Mode 5: Total Fittingď
Purpose: Automatically test ALL available equations on your dataset.
Steps:
Select Mode:
In sidebar, click âTotal Fittingâ.
Upload Data:
Upload your data file.
Select Variables:
Choose X and Y variables.
Enter plot name.
Plot Options (optional):
Show plot title: Checkbox to show or hide the title on all plots. Default from
PLOT_SHOW_TITLEenv var.
Run Total Fitting:
Info message shows: âTotal Fitting: [N] equationsâ.
Click âTotal Fittingâ button.
Progress bar shows completion.
All predefined equations fitted automatically.
Takes longer than other modes.
Review All Results:
Comprehensive results for all equation types.
Scroll through to find the best fit.
Look for highest R² value.
Use Cases:
Exploratory data analysis.
No prior knowledge of expected relationship.
Creating comprehensive reports.
Educational purposes (see all function types).
Example Workflow:
1. Upload: mystery_data.csv
2. X: x, Y: y
3. Plot name: "comprehensive_analysis"
4. Click "Total Fitting"
5. Wait for all 13+ equations to fit
6. Scan through results:
- Linear: R²=0.60
- Quadratic: R²=0.65
- Sin with phase: R²=0.99 â Best!
- Logarithmic: R²=0.45
- ... etc.
7. Use "Sin with phase" for this data
Data Uploadď
Supported Formatsď
CSV (
.csv): Comma-separated values.Excel (
.xlsx): Microsoft Excel files.TXT (
.txt): Tab-separated or space-separated text files.
File Size Limitsď
Online version: Limited by Streamlit Cloud (typically 200 MB).
Local version: Limited by your computerâs memory.
Upload Methodsď
Click âBrowse filesâ: Opens file picker dialog.
Drag and drop: Drag files from your file manager into the upload area.
Multiple File Uploadď
Hold Ctrl (Windows/Linux) or Cmd (Mac) while selecting.
Or drag multiple files at once.
Only available in âMultiple Datasetsâ mode.
Data Previewď
After upload, expand âShow Dataâ to see:
First and last rows.
All columns.
Data types.
Verify data loaded correctly.
Understanding Resultsď
Results are shown in three columns, then the plot, then the download button.
Column 1: Equationď
Formula (if available): The generic equation form (e.g. y = mx + n).
Formatted equation: The equation with fitted parameter values (e.g. y = 5.123¡x + 2.456).
Uses standard mathematical symbols (¡, ², etc.).
Column 2: Parametersď
Fit parameters (e.g. a, b, c or m, n) with uncertainties and confidence intervals:
Each parameter: value and uncertainty (e.g. m = 5.123 , Ď(m) = 0.045).
IC 95%: 95% confidence interval for each parameter.
Column 3: Statisticsď
R²: Coefficient of determination.
RMSE: Root mean square error.
Ď²: Chi-squared.
Ď²_red: Reduced chi-squared.
ν (g.l.): Degrees of freedom.
Plot Componentsď
Data Points:
Red circles (or other markers).
Error bars if uncertainties provided.
Your original measurements.
Fitted Curve:
Black line (or configured color).
Smooth curve through data.
Based on fitted equation.
Axis Labels:
X-axis: Your X variable name.
Y-axis: Your Y variable name.
Legend (if shown):
Equation with parameters.
R² value.
R² Value (Coefficient of Determination)ď
Interpretation:
R² = 1.0: Perfect fit (rare in real data).
R² > 0.95: Excellent fit â.
R² > 0.85: Good fit â.
R² > 0.70: Acceptable fit â ď¸.
R² < 0.70: Poor fit - try different equation â.
What it means:
Percentage of variance explained by the model.
R² = 0.95 means 95% of variance explained.
Higher is better.
Downloading Plotsď
Scroll to the result you want (plot is above the download button).
Click the âđĽ Downloadâ button below the plot.
File is saved with the configured format (default PNG); filename:
[plot_name].png(or.pdfif configured).
Download Tips:
Download all plots you need before closing the browser.
Plots are high-resolution (configured DPI).
If the app is configured for PDF output, the in-app preview is shown as PNG but the downloaded file is PDF.
Tips and Best Practicesď
Performance Tipsď
Use local version for large datasets: Faster than online.
Close unused browser tabs: Frees memory.
One mode at a time: Donât switch modes mid-analysis.
Clear results: Refresh page to clear old results and free memory.
Data Tipsď
Check data preview: Always expand âShow Dataâ to verify upload.
Name columns clearly: Use descriptive names like âtime_sâ, âvoltage_Vâ.
Remove headers in Excel: Only column names in first row, data starts row 2.
Consistent units: Ensure all data uses the same units.
Workflow Tipsď
Start with Normal Fitting: Test single equation first.
Use Checker for exploration: When uncertain about best equation.
Use Total for comprehensive analysis: When time permits.
Document your results: Download all relevant plots.
Uncertainty Handlingď
If your data has uncertainties:
Name columns
ux,uy(lowercase âuâ + variable name).Example: for variable
time, uncertainty column isutime.Error bars appear automatically in plots.
Fitting is weighted by uncertainties.
Custom Formula Tipsď
Test simple formulas first: Try
a*xbefore complex expressions.Use parentheses:
a/(1+b*x)nota/1+b*x.Available functions:
np.sin(),np.cos(),np.exp(),np.log(),np.sqrt().Check parameter count: Must match number of parameters defined.
Troubleshootingď
Upload Issuesď
Problem: File wonât upload.
Solutions:
Check file format (CSV, XLSX, TXT only).
Try smaller file.
Check internet connection (online version).
Refresh page and try again.
Fitting Failsď
Problem: âFitting errorâ message appears.
Possible causes:
Not enough data points (need at least 5-10).
Data doesnât match equation type.
Infinite or NaN values in data.
All Y values are the same.
Solutions:
Check data for errors.
Try different equation type.
Ensure sufficient data points.
Remove outliers or bad data.
Results Not Showingď
Problem: Clicked fit button but no results appear.
Solutions:
Wait for processing (check for spinner).
Scroll down (results may be below viewport).
Check browser console for errors (F12).
Refresh page and try again.
App is Slowď
Problem: App responds slowly or freezes.
Solutions:
Use local version instead of online.
Reduce dataset size.
Close other browser tabs.
Clear browser cache.
Refresh the app.
Download Doesnât Workď
Problem: Canât download plots.
Solutions:
Check browserâs download settings.
Allow downloads from streamlit.app domain.
Try right-click â âSave image asâ.
Use different browser.
Keyboard Shortcutsď
While Streamlit doesnât have extensive keyboard shortcuts, these work:
Ctrl+R / Cmd+R: Refresh the app.
F5: Refresh the page.
F11: Full screen mode.
Ctrl+Plus / Cmd+Plus: Zoom in.
Ctrl+Minus / Cmd+Minus: Zoom out.
Mobile and Tablet Usageď
The Streamlit interface is responsive and works on mobile devices:
Recommendations:
Use landscape orientation for better plot viewing.
Tap and pinch to zoom plots.
Use tablet or larger for easier interaction.
Desktop recommended for serious work.
Advanced Featuresď
Session Persistenceď
Results persist during your browser session.
Refresh clears all results.
Online version: sessions timeout after inactivity.
Multiple Tabsď
You can open multiple browser tabs with RegressionLab:
Each tab is independent.
Useful for comparing different analyses.
Be mindful of memory usage.
Appearance and themeď
The Streamlit UI uses the same configuration as the Tkinter app. Colors and fonts come from .env (or the Tkinter Configure dialog):
Background and text:
UI_BACKGROUND,UI_FOREGROUNDSidebar: Slightly lighter than the main area for separation
Buttons and accents:
UI_BUTTON_BG,UI_BUTTON_FG, etc.Fonts:
UI_FONT_FAMILY,UI_FONT_SIZE
So changing the theme in .env (or in Tkinterâs configuration) affects both the desktop and the web interface consistently.
Differences from Tkinter Versionď
Streamlit has:
â Modern, web-based interface.
â Same theme and configuration source (
.env/ config): colors, fonts, and layout rules match the Tkinter app where applicable (sidebar slightly lighter than main).â Easy sharing via URL.
â Mobile/tablet support.
â No installation needed (online).
â Loop-like workflow: in Normal Fitting you can enable âloop fittingâ and then fit another file with the same equation without changing mode; in Multiple Datasets you can upload another set of files and run again.
Streamlit differs:
File input is by upload only (no local file browser).
No configuration panel in the sidebar (language and mode only); change settings in
.envor via Tkinterâs Configure menu.Results layout: three columns (Equation, Parameters, Statistics), plot, then download button.
If output format is PDF, the in-app preview is PNG and the download is PDF.
Prediction window and multidimensional fitting (custom formulas with 2+ variables, 3D/residuals plots) are currently available in the Tkinter (desktop) version.
View Data mode in Streamlit has the same transform, clean, and download options as Tkinter.
When to use each:
Streamlit: Quick analysis, sharing, accessibility.
Tkinter: Offline, local file browsing, in-app configuration dialog, extra features.
Next Stepsď
Learn Tkinter: See Tkinter Guide for desktop version.
Customize: Configure appearance in Configuration Guide.
Extend: Learn to add functions in Extending RegressionLab.
Happy fitting! If you encounter issues, check the Troubleshooting Guide.