Skip to content

Commit 602cea0

Browse files
authored
Merge pull request #38 from Aljaz-R/styling
Added sphinx documentation, updated README, added new edit icon, new connection lines logic
2 parents ccd9b97 + c3d7dde commit 602cea0

File tree

20 files changed

+541
-54
lines changed

20 files changed

+541
-54
lines changed

.github/gui1.png

55.3 KB
Loading

.github/gui1_old.png

65.9 KB
Loading

.github/gui2.png

-1.99 KB
Loading

.github/gui7.png

-5.41 KB
Loading

.github/gui8.png

-3.32 KB
Loading

README.md

Lines changed: 24 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
<a href="#-cite-us">📄 Cite us</a>
4242
</p>
4343

44-
This is a basic graphical user interface intended for users of the [NiaAML](https://github.com/firefly-cpp/NiaAML) Python package.
44+
A graphical user interface for building and running machine learning pipelines using the [NiaAML](https://github.com/firefly-cpp/NiaAML) framework. This GUI now supports **block-based pipeline composition**, drag-and-drop components, visual connections, and CSV editing.
4545

4646
* **Free software:** MIT license
47-
* **Python versions:** 3.9.x, 3.10.x, 3.11.x, 3.12.x
47+
* **Python versions:** 3.10.x, 3.11.x, 3.12.x, 3.13.x
4848

4949
## 📦 Installation
5050

@@ -73,36 +73,40 @@ $ dnf install NiaAML-GUI
7373
To install `NiaAML-GUI` on Alpine Linux, enable Community repository and use:
7474

7575
```sh
76-
$ apk add niaaml-gui
76+
$ apk add niaaml-gui
7777
```
7878

7979
## 🚀 Usage
8080

8181
NiaAML GUI application allows you to use the main features of the [NiaAML](https://github.com/firefly-cpp/NiaAML) framework. There are two views in the application. In the first one, you can prepare an environment for a pipeline optimization process. The purpose of the second one is to allow you to use an existing pipeline from a file. **The application currently supports data input in the form of CSV files.**
8282

83-
### Optimization View
83+
### Pipeline Canvas View
8484

8585
Below is a screenshot of the first view with labeled components and you can find a description for each component under the screenshot.
8686

8787
<p align="center"><img src=".github/gui1.png" alt="NiaAML GUI First View" title="NiaAML GUI First View"/></p>
8888

8989
| Component | Description |
9090
|:----------|:------------|
91-
| 1 | Tabbed view for choosing components for the optimization. Clicked components get transferred to their corresponding brackets (labels **5**, **6** and **7**). |
92-
| 2 | Input CSV dataset's file selection widget. After the dataset has been selected, you can also view and edit it using the edit button next to the `Select file` button. **Also make sure you check the `CSV has header` checkbox in case the selected CSV file has a header row.** Below you can see a screenshot of the CSV file's editing window. <p align="center"><img src=".github/gui3.png" alt="NiaAML GUI Edit Dataset View" title="NiaAML GUI Edit Dataset View"/></p> |
93-
| 3 | Dropdown widget for categorical features' encoder selection. It will be ignored if the dataset contains no categorical features. |
94-
| 4 | Dropdown widget for missing data imputer selection. It will be ignored if the dataset contains no missing values. |
95-
| 5 | List of selected feature selection algorithms (optional). |
96-
| 6 | List of selected feature transform algorithms (optional). |
97-
| 7 | List of selected classifiers. |
98-
| 8 | Dropdown widget for the selection of components' selection optimization algorithm. |
99-
| 9 | Dropdown widget for the selection of hyperparameters' tuning optimization algorithm. Defaults to **8** if none is selected. |
100-
| 10 | Population size for the components' selection process. |
101-
| 11 | Population size for the hyperparameters' tuning process. |
102-
| 12 | Number of evaluations during the components' selection process. |
103-
| 13 | Number of evaluations during the hyperparameters' tuning process. |
104-
| 14 | Dropdown widget for the selection of a fitness function to use during the pipeline evaluation step. |
105-
| 15 | Destination of the optimization's result (pipeline and text file). |
91+
| 1 | Tabbed view for choosing components to be added to the canvas. Components can be dragged and dropped onto the canvas to visually build the pipeline. |
92+
| 2 | The canvas area where blocks (components) are placed and connected. Users can construct the pipeline visually by drawing arrows between valid components. |
93+
| 3 | "Select CSV File" block. Input dataset selection. Includes a file browser, CSV header checkbox, and an edit button to view/modify the CSV content. <br> <p align="center"><img src=".github/gui3.png" alt="NiaAML GUI Edit Dataset View" title="NiaAML GUI Edit Dataset View"/></p> |
94+
| 4 | "Categorical Encoder" block. Allows selection of encoding method for categorical features. Dropdown populated dynamically. |
95+
| 5 | "Missing Imputer" block. Allows selection of imputation method to handle missing values. |
96+
| 6 | "Feature Selection" block. Multi-selection dialog allows the user to choose one or more feature selection algorithms. |
97+
| 7 | "Feature Transform" block. Multi-selection dialog allows choosing one or more feature transformation algorithms. |
98+
| 8 | "Classifier" block. Multi-selection dialog for selecting one or more classification models. |
99+
| 9 | "Optimization Algorithm (Selection)" block. Dropdown for choosing the optimization algorithm used in component selection. |
100+
| 10 | "Optimization Algorithm (Tuning)" block. Dropdown for choosing the algorithm used for hyperparameter tuning. |
101+
| 11 | "Population Size (Components Selection)" block. Numeric input for specifying the population size during component selection. |
102+
| 12 | "Population Size (Parameter Tuning)" block. Numeric input for specifying the population size for hyperparameter tuning. |
103+
| 13 | "Number of Evaluations (Component Selection)" block. Sets the number of allowed evaluations during selection. |
104+
| 14 | "Number of Evaluations (Parameter Tuning)" block. Sets the number of evaluations for hyperparameter tuning. |
105+
| 15 | "Fitness Function" block. Dropdown for selecting the fitness function used during evaluation of each candidate pipeline. |
106+
| 16 | "Pipeline Output Folder" block. Defines the target folder where output files (pipeline, logs, results) are saved. |
107+
| 17 | Arrow connections between blocks. Only valid connections are allowed. When drawing, green/red highlights show whether the target is acceptable. |
108+
| 18 | Validation system. Before running optimization, the system checks whether all required components are present and properly configured. |
109+
106110

107111
#### Optimization
108112

@@ -111,24 +115,9 @@ Below you can see screenshots of views during and after the optimization has fin
111115
<p align="center"><img src=".github/gui2.png" alt="NiaAML GUI Optimization Running" title="NiaAML GUI Optimization Running"/></p>
112116
<p align="center"><img src=".github/gui4.png" alt="NiaAML GUI Optimization Finished" title="NiaAML GUI Optimization Finished"/></p>
113117

114-
### Usage View
115-
116-
Below is a screenshot of the second view with labeled components and you can find a description for each component under the screenshot.
117-
118-
<p align="center"><img src=".github/gui5.png" alt="NiaAML GUI Second View" title="NiaAML GUI Second View"/></p>
119-
120-
| Component | Description |
121-
|:----------|:------------|
122-
| 1 | Pipeline file selection widget. |
123-
| 2 | Input CSV file selection widget. The file should contain the same headers (if any) as the dataset in the optimization process and there should be no classes (expected results) present. After the dataset has been selected, you can also view and edit it using the edit button next to the `Select file` button. **Also make sure you check the** `CSV has header` **checkbox in case the selected CSV file has a header row.** |
124-
125-
#### Run
126-
127-
You get a similar output than in the optimization process, but this time there is an array of predicted values present.
128-
129118
## 📓 Example
130119

131-
Let's say we want to find an optimal classification pipeline for the [Ecoli dataset](https://archive.ics.uci.edu/ml/datasets/ecoli) [[1]](#1). You can see the optimization setup in the screenshot below.
120+
Let's say we want to find an optimal classification pipeline for the Example dataset. You can see the optimization setup in the screenshot below.
132121

133122
<p align="center"><img src=".github/gui6.png" alt="NiaAML GUI Optimization Setup" title="NiaAML GUI Optimization Setup"/></p>
134123

@@ -144,10 +133,6 @@ Now we can use the exported pipeline file for further classification on the unse
144133

145134
<p align="center"><img src=".github/gui9.png" alt="NiaAML GUI Run Pipeline" title="NiaAML GUI Run Pipeline"/></p>
146135

147-
The result for 5 individuals is shown on the screenshot below.
148-
149-
<p align="center"><img src=".github/gui10.png" alt="NiaAML GUI Run Pipeline Result" title="NiaAML GUI Run Pipeline Result"/></p>
150-
151136
## 📝 References
152137

153138
<a id="1">[1]</a> Dua, D. and Graff, C. (2019). [UCI Machine Learning Repository](http://archive.ics.uci.edu/ml). Irvine, CA: University of California, School of Information and Computer Science.

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/source/api.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
API Reference
2+
=============
3+
4+
.. automodule:: niaaml_gui
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/source/changelog.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Changelog
2+
=========
3+
4+
Version 4.1
5+
-----------
6+
7+
- Fixed pipeline subprocess execution.
8+
- Improved connection validation between blocks.
9+
- Added Sphinx documentation.
10+
11+
Older versions
12+
--------------
13+
14+
See GitHub commit history for earlier changes.

0 commit comments

Comments
 (0)