Tkinter Guideο
This guide covers the desktop application interface of RegressionLab built with Tkinter. The Tkinter version provides a full-featured native application experience with advanced options and offline capabilities.
Overviewο
The Tkinter interface offers:
Native Performance: Fast, responsive desktop application.
Offline Operation: No internet connection required.
Advanced Features: Loop mode, direct file browsing, extensive customization.
Traditional UI: Familiar desktop application layout.
Full Control: Access to all configuration options.
Launching the Applicationο
Method 1: Desktop Shortcutο
Double-click the βRegressionLabβ shortcut created during installation.

Method 2: Shell Scriptsο
Windows:
bin\run.bat
macOS/Linux:
./bin/run.sh
Method 3: Direct Python Executionο
# Activate virtual environment first (if using one)
source .venv/bin/activate # macOS/Linux
.venv\Scripts\activate # Windows
# Run the application
pythonw src/main_program.py
Interface Layoutο
The Tkinter application uses a menu-based navigation system:
Languageο
The language is set in the .env file or in the Configure dialog (Language section):
LANGUAGE="es" # Spanish (default)
LANGUAGE="en" # English
LANGUAGE="de" # German (Deutsch)
You can also use aliases (e.g. spanish, english, deutsch). Change requires restarting the application.
Operation Modesο
Mode 1: Normal Fittingο
Purpose: Fit one equation to one dataset with optional loop mode.
Steps:
Click βNormal Fittingβ from the main menu.
Select Equation Type:
Dialog appears with dropdown menu.

Choose from predefined equations:
Linear (y=mx)
Linear with intercept (y=mx+n)
Quadratic (y=axΒ²)
Quadratic complete (y=cxΒ²+bx+a)
Fourth power (y=axβ΄)
Sin, Cos (with and without phase)
Sinh, Cosh
Logarithmic (y=aΒ·ln(x))
Inverse (y=a/x)
Inverse square (y=a/xΒ²)
Or select βCustom Formulaβ (see below).
Click βAcceptβ or press Enter.
Enable/Disable Loop Mode:
Dialog asks: βDo you want to enable loop mode?β
Yes: After fitting, you can modify data and refit.
No: Single fit, then return to main menu.
Loop mode recommended for iterative data refinement.
Select Data File:
Native file picker opens.
Default filter: all data files (CSV, TXT, XLSX). You can also filter by type.
Default location:
input/directory.Navigate to your data file and click βOpenβ.
Select Variables:
Dialog shows available columns.

Select X (independent variable):
Dropdown with all non-uncertainty columns.
Example: βtimeβ, βvoltageβ, βconcentrationβ.
Multidimensional (custom formulas only): If the equation has 2+ independent variables, a dialog asks you to select multiple X columns (e.g. first X, second X, etc.).
Select Y (dependent variable):
Dropdown with remaining columns.
Example: βtemperatureβ, βcurrentβ, βabsorbanceβ.
Enter Plot Name:
Text field for output filename.
Default: based on variable names.
Example: βexperiment_2026β.
Click βAcceptβ.
View Results:
New window opens showing:

Plot: Your data with fitted curve. For 2 independent variables: interactive 3D plot (rotatable with mouse). For 3+ variables: residuals plot.

Equation: Mathematical formula with parameters.
Parameters: Values with uncertainties.
RΒ² Value: Goodness of fit.
Prediction button: Opens a dialog to evaluate the fitted function at user-specified x values; shows predicted y with uncertainty propagation when available.
Plot automatically saved to
output/directory.
Loop Mode (if enabled):
After viewing results, dialog asks: βContinue with this dataset?β
Yes:
Modify your data file (in Excel, text editor, etc.).
Click Yes to reload and refit.
Repeat as needed.
No: Return to main menu.
Custom Formula:
If you select βCustom Formulaβ:
Number of Parameters:
Dialog with spinbox.
Enter number of parameters (1-10).
Click βAcceptβ.
Parameter Names:
Dialog appears for each parameter.
Enter meaningful names (e.g., βamplitudeβ, βfrequencyβ, βphaseβ).
Or use defaults (p1, p2, etc.).
Number of Independent Variables (optional):
Spinbox: 1 for standard y=f(x), 2+ for multidimensional regression.
Use
x_0,x_1, etc. in the formula for 2+ variables.
Enter Formula:
Text entry dialog.

Enter formula using parameter names and
x(orx_0,x_1for multidimensional).Example:
amplitude * sin(frequency * x + phase).Example (2 variables):
a*x_0 + b*x_1 + c.Click βAcceptβ.
Continue with steps 3-8 above.
Example Workflow:
1. Click "Normal Fitting"
2. Select "Linear with intercept"
3. Enable loop mode: Yes
4. File type: Excel
5. Select: temperature_vs_time.xlsx
6. X: time (s), Y: temperature (Β°C)
7. Plot name: "heating_curve"
8. View results: RΒ² = 0.92 (notice one outlier)
9. Continue: Yes
10. Edit Excel to remove outlier
11. View new results: RΒ² = 0.99 β
12. Continue: No β Done!
Mode 2: Single Fit Multiple Datasetsο
Purpose: Apply the same equation to multiple different datasets.
Steps:
Click βSingle Fit Multiple Datasetsβ from the main menu.
Select Equation Type: (same as Normal Fitting).
Enter Number of Datasets:
Dialog with spinbox.
Enter how many datasets you want to fit (2-99).
Click βAcceptβ.
Enable/Disable Loop Mode:
Asked once for all datasets.
For Each Dataset:
Select file (native file picker).
Select X and Y variables.
Enter plot name.
Repeat for all datasets.
View All Results:
Results appear sequentially.
Each in its own window.
All plots saved automatically.
Loop Mode (if enabled):
After all fits, ask to continue with all datasets.
Modify any/all data files.
Reload and refit all.
Tips:
Prepare all data files beforehand.
Use consistent column names across files.
Keep file browser in same directory for faster selection.
Example Workflow:
1. Click "Single Fit Multiple Datasets"
2. Select "Quadratic"
3. Number of datasets: 3
4. Loop mode: No
5. Dataset 1:
- File: sample_A.csv
- X: concentration, Y: absorbance
- Plot: "sample_A"
6. Dataset 2:
- File: sample_B.csv
- X: concentration, Y: absorbance
- Plot: "sample_B"
7. Dataset 3:
- File: sample_C.csv
- X: concentration, Y: absorbance
- Plot: "sample_C"
8. View 3 result windows
9. Compare parameters and RΒ² values
Mode 3: Checker Fitting (Multiple Fits Single Dataset)ο
Purpose: Test multiple equations on the same dataset.
Steps:
Click βChecker Fittingβ from the main menu.
Load Dataset:
Select file (native file picker).
Select X and Y variables.
Enter plot name (used for all results).
Test Equations:
For each equation you want to test:
Dialog asks: βSelect equation typeβ.
Choose an equation.
Click βAcceptβ.
View results.
Dialog asks: βDo you want to continue testing?β
Yes: Try another equation.
No: Return to main menu.
Compare Results:
Multiple result windows open.
Compare RΒ² values.
Compare visual fit quality.
Choose the best equation.
Workflow Strategy:
1. Start with simple equations (linear, quadratic)
2. Try more complex if simple don't fit well
3. Stop when you find a good fit (RΒ² > 0.95)
4. Don't over-complicate - simpler is better if fit is good
Example Workflow:
1. Click "Checker Fitting"
2. Load: unknown_data.xlsx
- X: x, Y: y
- Plot: "test"
3. Try Linear: RΒ² = 0.65 (poor) β Continue: Yes
4. Try Quadratic: RΒ² = 0.88 (acceptable) β Continue: Yes
5. Try Inverse: RΒ² = 0.97 (excellent!) β Continue: No
6. Use inverse function for final analysis
Mode 4: Total Fittingο
Purpose: Automatically fit ALL available equations.
Steps:
Click βTotal Fittingβ from the main menu.
Load Dataset:
Select file (native file picker).
Select X and Y variables.
Enter plot name.
Automatic Fitting:
All predefined equations fitted automatically.
Result windows appear sequentially.
Takes 5-30 seconds depending on data size.
Review All Results:
Multiple windows with all fits.
Scan through to find highest RΒ².
Choose the best-fitting equation.
Use Cases:
Comprehensive analysis.
Educational demonstrations.
When you have no idea what equation to expect.
Creating a fitting report with all options.
Example Workflow:
1. Click "Total Fitting"
2. Load: mystery_data.csv
- X: t, Y: signal
- Plot: "complete_analysis"
3. Wait for all equations to fit
4. Review results:
- Linear: RΒ²=0.45
- Quadratic: RΒ²=0.52
- ...
- Sin with phase: RΒ²=0.99 β Winner!
- ...
- Inverse: RΒ²=0.31
5. Conclusion: Data shows sinusoidal behavior
Mode 5: Watch Dataο
Purpose: View data file contents without fitting. Includes transform, clean, and save options.
Steps:
Click βWatch Dataβ from the main menu.
Select File:
Native file picker opens (default filter: all data files). Browse and select a CSV, TXT, or XLSX file.
View Data:

Dialog shows:
All columns and rows in table format.
Row 1: Pair plots button | Save updated data | Help (opens a dialog with detailed info about every option and mode, in the current language).
If there are more than 10 variables, clicking the pair plots button opens a variable selection dialog first (max 10 for readability).
Row 2: Transform dropdown | Transform button (same accent color as equation buttons).
Row 3: Clean dropdown | Clean button (same accent color as equation buttons).
Use scrollbar to navigate the table.
Click Help for a reference with collapsible sections (pair plots, transform options, clean options, save). Each transform and clean option has a detailed description. Available in Spanish, English, and German.
Click Accept when done.
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.
If the pair plots window is open, it updates automatically.
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.
Save Updated Data (optional):
Click Save updated data to save the current (possibly transformed/cleaned) data to CSV, TXT, or XLSX.
Use Cases:
Verify data loaded correctly.
Check column names.
Inspect data values.
Preview before fitting.
Transform data (e.g. FFT, Hilbert, Laplace, log) for analysis.
Clean data (remove outliers, fill NaN) before fitting.
Mode 6: Information (Help)ο
Purpose: View help and application information.
Steps:
Click βInformationβ from the main menu.
View Help Dialog:

Window with scrollable content and collapsible sections (click the section header to expand/collapse).
Sections: Objective, Advantages, Fitting Modes (including loop mode), Custom Functions, Data Format (columns, uncertainty prefix), Data Location (input dir, formats), Output Location (plots, logs), Statistics (RΒ², RMSE, ΟΒ², reduced ΟΒ², DoF, 95% parameter intervals).
If a donations URL is set in configuration, a Donations button appears at the bottom.
Click Accept (or close the window) when done.
Configuration Dialog (Configure)ο
Purpose: Edit .env options without opening the file manually.
Steps:
Click βConfigureβ from the main menu.
Configuration dialog:

Collapsible sections (click header to expand/collapse): Language, UI, Plot, Font, Paths, Links, Updates, Logging.
Each option has a label and a short description; values are shown in text fields, checkboxes (for booleans), or dropdowns (for fixed options).
Use the scroll area and mouse wheel to move through sections.
Accept or Cancel:
Accept: Writes current values to
.envand closes the dialog; the application then restarts so the new settings take effect.Cancel (or close window): Discards changes and closes the dialog.
Note: A message at the bottom reminds you that the app will restart after saving. See the Configuration Guide for the full list of options and their meanings.
Dialog Typesο
All dialogs and secondary windows open centered on screen. Small dialogs (file type, variable selection, etc.) keep their natural size. The help and configuration dialogs use fixed dimensions (900Γ650 and 760Γ800 pixels) for consistent layout with collapsible sections.
Selection Dialogsο
Dropdown Menus:
Click to expand options.
Click option to select.
Press Enter or click βAcceptβ.
Radio Buttons:
Click one option.
Click βAcceptβ.
Spinbox:
Type number.
Or use up/down arrows.
Click βAcceptβ.
Text Entry Dialogsο
Single Line:
Type text.
Press Enter or click βAcceptβ.
ESC or βCancelβ to abort.
Multi-Line (for formulas):
Type formula.
Use multiple lines if needed.
Click βAcceptβ when done.
Information Dialogsο
Message Boxes:
Read message.
Click βOKβ.
Yes/No Dialogs:
Read question.
Click βYesβ or βNoβ.
Result Windowsο
Plot Window:
Shows matplotlib plot (or interactive 3D canvas for 2-variable fits; residuals plot for 3+ variables).
Embedded in Tkinter window.
Includes:
Plot image.
Equation text (formula with fitted values).
Parameters with uncertainties and 95% confidence intervals.
Statistics: RΒ², RMSE, ΟΒ², reduced ΟΒ², degrees of freedom.
Prediction button: Opens a dialog to evaluate the fitted function at user-specified inputs; shows predicted y with uncertainty when available.
Click βCloseβ (or βAcceptβ) to dismiss.
File Browsingο
Default Directoriesο
Input:
Default:
input/in RegressionLab directory.Contains sample datasets.
Add your data files here.
Output:
Default:
output/in RegressionLab directory.All plots saved here automatically.
Named according to plot name + timestamp.
Changing Directoriesο
In file browser:
Navigate using folder list.
Double-click folders to open.
Click file to select.
Use βUpβ button to go to parent directory.
Or configure defaults in .env:
FILE_INPUT_DIR="path/to/your/data"
FILE_OUTPUT_DIR="path/to/your/results"
Keyboard Shortcutsο
While dialogs are open:
Space: Accept current selection.
Tab: Move between fields.
In result windows:
Alt+F4 (Windows/Linux) or Cmd+W (Mac): Close window.
Main menu:
Alt+F4 (Windows/Linux) or Cmd+Q (Mac): Quit application.
Understanding Resultsο
Result Window Componentsο

βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Plot Name - Equation Name [X] β
βββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββββββββββββββββββββββββββ β
β β [Plot Image / 3D / Residuals]β β
β βββββββββββββββββββββββββββββββββββββββββ β
β β
β Equation: y = 5.12Β·x + 2.45 β
β RΒ² = 0.987 β
β β
β Parameter Results: β
β m = 5.123 Β± 0.045 [IC 95%: 5.03, 5.21] β
β n = 2.456 Β± 0.123 [IC 95%: 2.21, 2.70] β
β RΒ² = 0.987 RMSE = 0.12 ΟΒ² = ... β
β β
β [ Accept ] [ Prediction ] β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
The result text includes parameters (value Β± uncertainty and 95% confidence interval per parameter) and statistics (RΒ², RMSE, ΟΒ², reduced ΟΒ², degrees of freedom). The Information dialog (main menu β Information) has a Statistics section that explains these in detail.
Statistics Shownο
RΒ²: Coefficient of determination (goodness of fit).
RMSE: Root mean square error.
ΟΒ²: Chi-squared.
ΟΒ²_red: Reduced chi-squared.
DoF (Ξ½): Degrees of freedom.
IC 95%: 95% confidence interval for each fitted parameter.
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 a different equation β.
RΒ² is the fraction of variance in the data explained by the model (e.g. RΒ² = 0.95 means 95% of the variance is explained). Higher is better.
Plot Featuresο
Data Points:
Red circles (default, configurable).
Error bars if uncertainties present.
Size and style from
.env.
Fitted Curve:
Black line (default, configurable).
Smooth continuous curve.
Based on fitted parameters.
Axes:
Labels from variable names.
Tick marks automatically scaled.
Font and size from
.env.
Tips and Best Practicesο
Performanceο
Close result windows: Free memory by closing old results.
Use loop mode wisely: Only when iteratively refining data.
Large datasets: May take longer, be patient.
Workflowο
Test with small data first: Verify setup before big analysis.
Use Watch Data: Preview, transform, clean, and save data before fitting.
Start simple: Try Normal Fitting before complex modes.
Save important plots: Copy from
output/to safe location.
Data Organizationο
Keep data in
input/: Faster access.Use descriptive names: βexperiment1.csvβ not βdata.csvβ.
One dataset per file: Donβt combine unrelated data.
Backup originals: Especially when using loop mode.
Custom Formulasο
Test incrementally: Start with simple formula, add complexity.
Use meaningful parameter names: βamplitudeβ not βp1β.
Check parentheses: Ensure correct order of operations.
Know available functions:
Trig:
sin(x),cos(x),tan(x).Hyperbolic:
sinh(x),cosh(x).Exponential:
exp(x),log(x),sqrt(x).Powers:
x**2,x**0.5.
Troubleshootingο
Application Wonβt Startο
Issue: Double-clicking shortcut does nothing.
Solutions:
Run from command line to see error messages.
Check Python installation:
python --version.Verify virtual environment activated.
Check logs:
regressionlab.log.
Dialogs Not Appearingο
Issue: Clicked button but nothing happens.
Solutions:
Check if dialog opened behind other windows.
Look at taskbar for new windows.
Press Alt+Tab to cycle through windows.
Check if application is frozen (wait indicator).
File Browser Emptyο
Issue: No files shown in file browser.
Solutions:
Navigate to correct directory.
Check file extensions (CSV, XLSX, TXT).
Verify files exist in expected location.
Use absolute path in
.envfor input directory.
Fitting Failsο
Issue: Error message after selecting variables.
Solutions:
Check data format (numeric values only).
Ensure sufficient data points (>5).
Verify X and Y columns exist.
Check for NaN or infinite values.
Try different equation type.
Result Window Too Large/Smallο
Issue: Result window doesnβt fit screen.
Solutions:
Adjust plot size in
.env:PLOT_FIGSIZE_WIDTH=10 PLOT_FIGSIZE_HEIGHT=5
Restart application.
Use smaller font sizes.
Colors Look Wrongο
Issue: Text unreadable or colors clash.
Solutions:
Edit
.envcolor settings.Use high contrast combinations:
Dark background + light text.
Light background + dark text.
Restart application.
Advanced Featuresο
Loop Mode Strategiesο
Strategy 1: Outlier Removal
1. Fit data
2. Identify outliers in plot
3. Edit data file to remove outliers
4. Reload and refit
5. Repeat until clean data
Strategy 2: Parameter Exploration
1. Fit with all data
2. Note parameters
3. Remove specific range
4. Refit and compare parameters
5. Understand data sensitivity
Strategy 3: Uncertainty Testing
1. Fit with estimated uncertainties
2. Adjust uncertainty columns
3. Refit and see effect on parameter errors
4. Find realistic uncertainty estimates
Batch Processing Workflowο
For processing many similar files:
1. Prepare all files in input/
2. Use consistent naming: exp1.csv, exp2.csv, etc.
3. Use "Single Fit Multiple Datasets"
4. Enter number of files
5. Disable loop mode for speed
6. Quickly select each file
7. All results saved automatically
8. Review output/ directory for all plots
Customizationο
See Configuration Guide for extensive customization:
Colors and themes.
Plot styles.
Fonts and sizes.
Directories.
Logging.
Differences from Streamlit Versionο
Tkinter has:
β Loop mode for iterative fitting.
β Direct file system access.
β Offline operation.
β Extensive customization via
.env.β Native desktop performance.
β Prediction window (evaluate fitted function at user inputs; uncertainty propagation).
β Multidimensional fitting (custom formulas with 2+ variables; 3D/residuals plots).
β Data view with transform, clean, and save (FFT, Hilbert, Laplace, DCT, log, outliers, etc.).
Tkinter lacks:
β Modern web UI.
β Easy sharing (URL-based).
β Mobile/tablet support.
β Automatic cloud storage.
When to use each:
Tkinter: Serious analysis, offline work, advanced features.
Streamlit: Quick checks, sharing, accessibility.
Next Stepsο
Customize Interface: Edit
.envto personalize appearance (Configuration Guide).Add Functions: Learn to extend RegressionLab (Extending RegressionLab).
Web Version: Try the Streamlit interface (Streamlit Guide).
Master the desktop interface! Check Troubleshooting for help with any issues.
