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 support for regression #75

Open
wants to merge 206 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
206 commits
Select commit Hold shift + click to select a range
48e5074
Reimplement the plssvm_target_platforms.py utility script to reduce t…
breyerml Oct 15, 2024
7c02de9
Further reduce Python dependencies.
breyerml Nov 28, 2024
bef258b
Add new command line switch and enum value for two different SVM type…
breyerml Dec 12, 2024
95e9b37
Move data_set.hpp file to new directory.
breyerml Dec 12, 2024
1e5cd2f
Move csvm.hpp file to new directory.
breyerml Dec 12, 2024
3318c43
Improve custom csvm_to_backend_type type trait to also directly handl…
breyerml Dec 13, 2024
af7c903
csvm_to_backend_type now works again for incomplete types.
breyerml Dec 13, 2024
c36ba38
Setup first infrastructure for regression using C-SVR. Currently only…
breyerml Dec 17, 2024
0e5487a
Improve command line information for C-SVC vs C-SVR.
breyerml Dec 17, 2024
cf77960
Note that strings as labels can only be used for classification task.…
breyerml Dec 19, 2024
12b4f44
Implement classification and regression data set specialization.
breyerml Dec 19, 2024
a3d5978
Reimplement the data_set_factory function.
breyerml Dec 19, 2024
7aae648
Befriend the C-SVM classes.
breyerml Dec 19, 2024
f1aaec3
Default copy and move constructors as well as copy and move assignmen…
breyerml Dec 19, 2024
0958375
Fix documentation errors.
breyerml Dec 20, 2024
ce34ba2
Add regression report class.
breyerml Dec 20, 2024
f47d639
Determine the predict data set based on the provided model file "svm_…
breyerml Dec 20, 2024
3d66e91
Add new derived classification and regression specific models and upd…
breyerml Dec 20, 2024
6ac8827
Fix doxygen warnings.
breyerml Dec 20, 2024
320468a
Remove temporary matrix.
breyerml Dec 20, 2024
0e25c33
Fix R^2 score.
breyerml Dec 20, 2024
bb7b478
Check whether the model file used to determine the C-SVM type could b…
breyerml Dec 20, 2024
9036261
Add force finite handling to the squared_correlation_coefficient.
breyerml Dec 20, 2024
7105b34
Explicitly default constructor and assignment operators.
breyerml Dec 20, 2024
31f8cb7
Remove friend declarations. Remove default template parameter type fr…
breyerml Dec 20, 2024
2f58eaa
Use default template type from the base data_set class. Update data_s…
breyerml Dec 20, 2024
1004710
Remove more friend declarations.
breyerml Dec 20, 2024
e8bb82a
Remove even more friend declarations.
breyerml Dec 21, 2024
44be3df
Remove even more friend declarations.
breyerml Dec 21, 2024
7ebb05c
Add code documentation.
breyerml Dec 21, 2024
a33f2df
Where possible, use member functions instead of member variables dire…
breyerml Dec 21, 2024
827d2c1
Where possible, use member functions instead of member variables dire…
breyerml Dec 21, 2024
5b0c65d
Update doxygen examples.
breyerml Dec 21, 2024
71f87f7
Update examples.
breyerml Dec 21, 2024
6b774a0
Fix compilation error.
breyerml Dec 22, 2024
7ef6687
Add support for generating regression data sets to the generate_data.…
breyerml Dec 22, 2024
908837e
Update examples to include classification and regression examples.
breyerml Dec 22, 2024
1d035a3
Explicitly use base data_set constructors in the classification and r…
breyerml Dec 22, 2024
eeed6e4
Add C-SVC and C-SVR support to the other backends.
breyerml Dec 23, 2024
ed4861d
Add missing include documentation.
breyerml Dec 23, 2024
9fea104
Fix unused variable compiler warning.
breyerml Dec 23, 2024
ee1e229
Conditionally re-enable the C-SVR score(model) member function.
breyerml Dec 23, 2024
c94c414
Fix model compilation error if the contained data set does not contai…
breyerml Dec 23, 2024
e02b69b
Add svm_types to Python bindings.
breyerml Jan 7, 2025
283f02f
Update sklearn.SVC and add sklearn.SVR bindings.
breyerml Jan 7, 2025
7a4bb55
Fix typo.
breyerml Jan 7, 2025
66717cc
Fix dynamic cast type.
breyerml Jan 7, 2025
5b18fd1
Fix implicit conversion compiler warnings.
breyerml Jan 7, 2025
ea4d079
Fix inheritance visibility problems.
breyerml Jan 7, 2025
db222f3
Add classification and regression model bindings.
breyerml Jan 7, 2025
056d8a2
Add new exception binding.
breyerml Jan 7, 2025
66d6421
Add classification and regression data set bindings.
breyerml Jan 7, 2025
ca74300
Add classification and regression CSVM bindings.
breyerml Jan 7, 2025
081de6c
Explicitly mention used scoring function in the regression task.
breyerml Jan 7, 2025
35cd4d3
Update Python examples to also include regression examples.
breyerml Jan 7, 2025
f081851
Add missing using directive.
breyerml Jan 7, 2025
2a87474
Fix doxygen warnings.
breyerml Jan 7, 2025
befeabd
Remove unused sklearn.SVR function.
breyerml Jan 7, 2025
098abe8
Update Python bindings README.md.
breyerml Jan 7, 2025
776cb4d
Move utility functions to own namespace.
breyerml Jan 7, 2025
28ea96b
Fix error in comment.
breyerml Jan 7, 2025
ab8505e
Rename instantiation functions and move two functions from the svm sp…
breyerml Jan 8, 2025
809bd52
Add bindings for the regression_report class.
breyerml Jan 8, 2025
558a329
Add svm_type enum tests.
breyerml Jan 9, 2025
47e5cf8
Add warning to the cmd train parser if a CSVR was requested but also …
breyerml Jan 9, 2025
e2093cf
Add new -s/--svm_type command line parser flag to the tests.
breyerml Jan 9, 2025
72b3dc1
Update data set factory tests (TODO: regression predict).
breyerml Jan 9, 2025
635eba9
Update scaling factor tests.
breyerml Jan 9, 2025
ee306fb
Add handling for the classification and regression test files.
breyerml Jan 9, 2025
571b627
Fix wrong include.
breyerml Jan 14, 2025
ae7a5c2
Fix usage of wrong data set.
breyerml Jan 14, 2025
58f033d
Move forward declaration from private to public part to be able to te…
breyerml Jan 14, 2025
be4efdb
Add regression support to the arff parsing.
breyerml Jan 14, 2025
a31b3e8
Update arff parsing tests after API change introducing regression sup…
breyerml Jan 14, 2025
b605a40
Update tests to support classification and regression data sets.
breyerml Jan 14, 2025
599a042
Update classification model tests.
breyerml Jan 14, 2025
3ba241e
Change EXPECT_TRUE to ASSERT_TRUE for labels().has_value() check.
breyerml Jan 14, 2025
e35d48e
Fix spelling error.
breyerml Jan 14, 2025
4a79b3d
Lift the restriction that a LIBSVM regression model must contain labe…
breyerml Jan 14, 2025
4ccb698
Add regression model tests.
breyerml Jan 14, 2025
547da80
Update CSVM factory tests.
breyerml Jan 14, 2025
66f93e8
Fix compiler warnings (also resulting in factory function compilation…
breyerml Jan 14, 2025
c67e577
Add C-SVC and C-SVR specific tests.
breyerml Jan 15, 2025
abad13e
Move classification IO tests to custom subdirectory.
breyerml Jan 16, 2025
5041eff
Add missing regression IO exception handling.
breyerml Jan 16, 2025
ff736e0
Remove unnecessary template parameter from regression header parsing …
breyerml Jan 16, 2025
5934b8d
Add regression IO tests.
breyerml Jan 16, 2025
8a9b2ab
Cleanup model test files.
breyerml Jan 16, 2025
8a21894
Cleanup LIBSVM and ARFF test files.
breyerml Jan 16, 2025
f66f2c9
Remove unnecessary includes.
breyerml Jan 17, 2025
972b37b
Remove unnecessary forwarding reference.
breyerml Jan 17, 2025
412ad75
Fix header include documentation and improve type_list implementation.
breyerml Jan 17, 2025
74ba17f
Update C-SVM tests to support C-SVCs and C-SVRs (CUDA backend only).
breyerml Jan 17, 2025
012394c
Move naming functionality to the naming header.
breyerml Jan 17, 2025
6032c6d
Add missing include.
breyerml Jan 17, 2025
9f8c9d6
Reduce code duplication.
breyerml Jan 17, 2025
f8f597a
Reduce backend CSVM constructor complexity (not necessary anymore).
breyerml Jan 17, 2025
cd3ea28
svr logic implementation
vancraar Jan 19, 2025
e5b0757
Merge branch 'regression' of github.com:SC-SGS/PLSSVM into regression
vancraar Jan 19, 2025
dbb05e0
Update OpenCL backend API + tests.
breyerml Jan 20, 2025
a2603b2
Update HIP backend API + tests.
breyerml Jan 20, 2025
f21905e
Update AdaptiveCpp backend API + tests.
breyerml Jan 20, 2025
8ecf021
Add new type_trait aliases.
breyerml Jan 20, 2025
b0c4538
Update DPC++ backend API + tests.
breyerml Jan 20, 2025
36355b3
Fix compilation warning.
breyerml Jan 20, 2025
88c3fd3
Remove default parameters from constructors.
breyerml Jan 21, 2025
fdda794
Update Kokkos backend API + tests.
breyerml Jan 21, 2025
54c77a3
Add the new tests to GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST.
breyerml Jan 21, 2025
32d93c7
Set OMP_PROC_BIND to false for the Kokkos tests (Kokkos always prints…
breyerml Jan 21, 2025
2723a92
Update OpenMP backend API + tests.
breyerml Jan 21, 2025
449014b
Update HPX backend API + tests.
breyerml Jan 21, 2025
ec86fe6
Update stdpar backend API + tests.
breyerml Jan 21, 2025
6c8b8d5
Rename CSVM, CSVC, and CSVR to C-SVM, C-SVC, and C-SVR respectively.
breyerml Jan 21, 2025
e7a6f19
The reduce the default epsilon (CG termination criterion) from 1e-3 t…
breyerml Jan 21, 2025
d9946e9
Correctly handle classification and regression data set output if the…
breyerml Jan 21, 2025
2604b68
Update and improve Python bindings. Add missing SYCL and Kokkos speci…
breyerml Jan 21, 2025
0f3a192
Rename generic test header.
breyerml Jan 21, 2025
580f56f
Reduce code duplication in tests.
breyerml Jan 21, 2025
5c93a2b
Merge remote-tracking branch 'origin/regression' into regression
breyerml Jan 21, 2025
0911868
Add copyright header to Python examples.
breyerml Jan 22, 2025
48256b2
Change sklearn like examples from completely artificial to better exa…
breyerml Jan 22, 2025
c03eea8
Add missing Python binding functionality to support more sklearn func…
breyerml Jan 22, 2025
409e233
Comment out assertion.
breyerml Jan 22, 2025
6b190f2
Update README.
breyerml Jan 22, 2025
06059d1
Rescale README images.
breyerml Jan 22, 2025
858f3b7
Add missing include documentation, fix formatting, and remove TODO.
breyerml Jan 22, 2025
8e99fde
Fix tests and remove unnecessary test files.
breyerml Jan 22, 2025
62a2b83
Enable score and score_model tests again for SVC.
breyerml Jan 22, 2025
e049ea3
Add additional constructor tests.
breyerml Jan 22, 2025
fdb2b5c
Improve our sklearn like SVC implementation.
breyerml Jan 23, 2025
7718e88
Replace wrong usage if .is with .equal to check for the different py:…
breyerml Jan 23, 2025
92e64c2
First (incomplete and partially wrong) decision_function implementation.
breyerml Jan 23, 2025
7994fc2
Remove unnecessary CMake compile definition.
breyerml Jan 24, 2025
a14c1f5
Further improve sklearn like Python bindings.
breyerml Jan 24, 2025
f548bd7
Add support for more different Python types for a call to fit, predic…
breyerml Jan 26, 2025
d09724f
Correctly set the gamma default to 'scale'. Fix a bug where the kerne…
breyerml Jan 26, 2025
19449c9
Mark the Python SVC dummy class as friend in order to use the private…
breyerml Jan 28, 2025
62e11cf
Implement the decision_function correctly for ovr and ovo.
breyerml Jan 28, 2025
d104e6c
Move get_params function to the svc class. Add new __repr__ function …
breyerml Jan 28, 2025
e5d36cb
Change exception message for constructor parameters that can't be mea…
breyerml Jan 28, 2025
7bf9a15
Implement basic coef_ and intercept_ attributes. Note that for ovr th…
breyerml Jan 28, 2025
c0d7a7b
Add missing (unimplemented) functions and update README.
breyerml Jan 28, 2025
df97f6b
Move scaling functionality from the base data_set class to a new inde…
breyerml Jan 30, 2025
4c5bf02
Improve Python bindings (now supporting all label_types out-of-the-bo…
breyerml Jan 30, 2025
28c7272
Fix compilation error in the Kokkos backend.
breyerml Jan 30, 2025
4bd1912
Add new specific rvalue constructor overloads for the data set classes.
breyerml Jan 30, 2025
aa186ca
Fix potential compilation errors.
breyerml Jan 30, 2025
41598a9
Fix compilation error implicitly capturing variables from a structure…
breyerml Jan 30, 2025
bba235b
Fix compilation error implicitly capturing variables from a structure…
breyerml Jan 30, 2025
53acd6b
Fix compilation error implicitly capturing variables from a structure…
breyerml Jan 30, 2025
ac1c886
Fix variant type trait usage error.
breyerml Feb 1, 2025
9033d3c
Implement custom Pybind11 type casters to improve the API readability.
breyerml Feb 2, 2025
b1c5259
Merge branch 'reduce_python_dependencies' into regression
breyerml Feb 3, 2025
967e723
Update module docstring and add Pythonic way of gathering the module …
breyerml Feb 4, 2025
663a521
Change relative links to absolute links.
breyerml Feb 4, 2025
4080ef4
Add support for the installation via pip.
breyerml Feb 4, 2025
c4a81bf
Change from () to {} in initialization.
breyerml Feb 4, 2025
6163b11
Set correct gamma default in der SVR implementation. Remove curly bra…
breyerml Feb 4, 2025
885e963
Remove static (sometimes) resulting in SegFaults.
breyerml Feb 4, 2025
4532587
Correctly escape strings with '' in the SVC and SVR __repr__ output.
breyerml Feb 5, 2025
cc12324
Add enum and class level docstrings to the Python bindings. Add missi…
breyerml Feb 5, 2025
c8e6039
Small include, parameter name, and order changes.
breyerml Feb 5, 2025
b6bf9da
Update README.
breyerml Feb 5, 2025
4bba737
Fix duplicated test class name.
breyerml Feb 5, 2025
3bc0137
Add explicit static_cast to bool in if constexpr.
breyerml Feb 5, 2025
d9b6778
Allow additional spelling versions of poly and chi_squared in SVC and…
breyerml Feb 5, 2025
b72ddfc
In the regression's task prediction, do not simply cast the predicted…
breyerml Feb 11, 2025
309a654
Change EXPECT_EXCLUSIVE_RANGE to EXPECT_INCLUSIVE_RANGE since 1.0 is …
breyerml Feb 11, 2025
8e87243
Enable regression predict test and set hyperparameters in such a way,…
breyerml Feb 11, 2025
063e0b2
Add a README paragraph noting that our regression model is not LIBSVM…
breyerml Feb 12, 2025
4890172
Reimplement the regression_report to be more in-line with sklearn's c…
breyerml Feb 12, 2025
a67f1bb
Add examples and results for our sklearn like SVC and SVR Python bind…
breyerml Feb 12, 2025
95efa6a
Update image sizes in README.
breyerml Feb 12, 2025
b689cfd
More precise GPU model.
breyerml Feb 12, 2025
bb720c4
Correctly use PLSSVM_GENERATE_TEST_FILES instead of PLSSVM_GENERATE_T…
breyerml Feb 14, 2025
1110da9
Merge branch 'develop' into regression
breyerml Feb 14, 2025
22c87e3
Use correct type lists in subtype list checking.
breyerml Feb 14, 2025
cf60875
Improve exception message to also include gamma's 'scale' value.
breyerml Feb 14, 2025
642342b
Add interactive live visualization comparing sklearn.svm with PLSSVM …
breyerml Feb 14, 2025
d3075bd
Update formatting via the clang-format and cmake-format targets.
breyerml Feb 14, 2025
22add51
Remove version specification from find_package(OpenMP).
breyerml Feb 14, 2025
8047d7f
Fix usage of wrong test files.
breyerml Feb 14, 2025
b1be015
Use smaller test files in MacOS action.
breyerml Feb 14, 2025
b75b8be
Potentially fix CMAKE_CXX_COMPILER_ID handling.
breyerml Feb 14, 2025
ce75ad6
Use correct file path.
breyerml Feb 14, 2025
3519e06
Change handling of collapse(2) OpenMP loops to support MSVC again.
breyerml Feb 16, 2025
411f4cd
Change handling of collapse(2) OpenMP loops to support MSVC again.
breyerml Feb 16, 2025
3aa2081
Check against correct _MSC_VER instead of MSC_VER.
breyerml Feb 16, 2025
20b1c8c
Better GoogleTest handling in case of MSVC.
breyerml Feb 17, 2025
47e82e9
Fix errors in the example performance analysis script due to new Pyth…
breyerml Feb 18, 2025
e274231
Codacy issue: fix single argument constructor by adding explicit.
breyerml Feb 18, 2025
19c9951
Codacy issue: fix unused variable.
breyerml Feb 18, 2025
ef70cb8
Codacy issue: use call-by-reference.
breyerml Feb 18, 2025
10654ca
Codacy issue: fix branch conditions by reordering.
breyerml Feb 18, 2025
ce9ff2e
Codacy issue: do not use except:.
breyerml Feb 18, 2025
0f92367
Codacy issue: do not use shell=True.
breyerml Feb 18, 2025
5d3cd05
Codacy issue: fix unused variables.
breyerml Feb 18, 2025
778cc04
Codacy issue: undo change for better readability.
breyerml Feb 18, 2025
00e8084
Codacy issue: subprocess call - check for execution of untrusted input.
breyerml Feb 18, 2025
a9b9e72
Codacy issue: try fixing may be undefined, or defined from star imports.
breyerml Feb 18, 2025
6d4bc4e
Correctly return non-zero exit code if script fails.
breyerml Feb 18, 2025
e8eca0d
Update GitHub action files.
breyerml Feb 18, 2025
255e4b4
Fix formatting.
breyerml Feb 18, 2025
1be8a55
Fix formatting.
breyerml Feb 18, 2025
a423189
Always run formatting steps.
breyerml Feb 18, 2025
0cabd97
Regenerate new classification test file with correct number of classes.
breyerml Feb 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added .figures/classification_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .figures/plssvm_bokeh.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .figures/regression_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .figures/sklearn_examples/face_recognition.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .figures/sklearn_examples/rbf_parameters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .figures/sklearn_examples/real_world/svhn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .figures/sklearn_examples/svm_anova.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .figures/sklearn_examples/svm_kernels_data.png
Binary file added .figures/sklearn_examples/svm_kernels_linear.png
Binary file added .figures/sklearn_examples/svm_kernels_poly.png
Binary file added .figures/sklearn_examples/svm_kernels_rbf.png
Binary file added .figures/sklearn_examples/svm_kernels_sigmoid.png
Binary file added .figures/sklearn_examples/svm_kernels_xor.png
Binary file added .figures/sklearn_examples/svm_margin.png
Binary file added .figures/sklearn_examples/svm_regression.png
46 changes: 46 additions & 0 deletions .github/workflows/clang_gcc_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Linux (Ubuntu) CPU
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
Linux-Test:
runs-on: ubuntu-latest
strategy:
matrix:
build_type: [Debug, Release]
compiler: [g++, clang++]
steps:
- name: "Update system"
run: |
sudo apt update
sudo apt upgrade
sudo apt autoremove
- name: "Install Compiler"
run: |
sudo apt install g++ clang libomp-dev
- name: "Install cmake 3.31.0"
uses: lukka/[email protected]
- name: "Clone the PLSSVM repository into PLSSVM/"
uses: actions/[email protected]
with:
path: PLSSVM
- name: "Install Python dependencies"
run: |
pip install --upgrade pip
pip install -r PLSSVM/install/python_requirements.txt
- name: "Configure PLSSVM using CMake"
run: |
cd PLSSVM
cmake --preset openmp_test -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DPLSSVM_TARGET_PLATFORMS="cpu" -DPLSSVM_ENABLE_LANGUAGE_BINDINGS=ON -DPLSSVM_ENABLE_PERFORMANCE_TRACKING=ON -DPLSSVM_TEST_FILE_NUM_DATA_POINTS=50 -DPLSSVM_TEST_FILE_NUM_FEATURES=20 -DPLSSVM_ENABLE_LTO=OFF
- name: "Build PLSSVM"
run: |
cd PLSSVM
cmake --build --preset openmp_test --config ${{ matrix.build_type }}
echo "${GITHUB_WORKSPACE}/PLSSVM/build" >> $GITHUB_PATH
- name: "Run tests"
run: |
cd PLSSVM
ctest --preset openmp_test -C ${{ matrix.build_type }} --parallel 2
14 changes: 11 additions & 3 deletions .github/workflows/clang_macos.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: macOS CPU
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
macOS-Test:
runs-on: macos-13
Expand All @@ -22,7 +25,12 @@ jobs:
brew install libomp
- name: "Install Python dependencies"
run: |
python3 -m pip install argparse scikit-learn humanize --break-system-packages
python3 -m pip install -U pip
pip install argparse scikit-learn humanize --break-system-packages
- name: "Set PYTHONPATH"
run: |
export PYTHONPATH=$(python3 -c "import site; print(site.getsitepackages()[0])")
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
- name: "Clone the PLSSVM repository into PLSSVM/"
uses: actions/[email protected]
with:
Expand All @@ -32,7 +40,7 @@ jobs:
cd PLSSVM
export LDFLAGS="-L/opt/homebrew/opt/libomp/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libomp/include"
cmake --preset openmp_test -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DPLSSVM_TARGET_PLATFORMS="cpu" -DPLSSVM_ENABLE_LANGUAGE_BINDINGS=ON -DPLSSVM_ENABLE_PERFORMANCE_TRACKING=ON -DPLSSVM_GENERATE_TEST_FILE=OFF -DPLSSVM_ENABLE_LTO=OFF
cmake --preset openmp_test -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DPLSSVM_TARGET_PLATFORMS="cpu" -DPLSSVM_ENABLE_LANGUAGE_BINDINGS=ON -DPLSSVM_ENABLE_PERFORMANCE_TRACKING=ON -DPLSSVM_TEST_FILE_NUM_DATA_POINTS=50 -DPLSSVM_TEST_FILE_NUM_FEATURES=20 -DPLSSVM_ENABLE_LTO=OFF
- name: "Build PLSSVM"
shell: bash
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
cmake --preset all -DPLSSVM_TARGET_PLATFORMS="cpu" -DPLSSVM_ENABLE_FORMATTING=ON
# check source file formatting
- name: "Check source file formatting via clang-format"
if: always()
run: |
set +e
cd PLSSVM
Expand All @@ -53,6 +54,7 @@ jobs:
if-no-files-found: ignore
# check CMake formatting
- name: "Check CMake formatting via cmake-format"
if: always()
run: |
set +e
cd PLSSVM
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/msvc_windows.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: Windows MSVC CPU
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
MSVC-Test:
runs-on: windows-latest
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: pip install
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
pip-Test:
runs-on: ubuntu-latest
steps:
- name: "Update system"
run: |
sudo apt update
sudo apt upgrade
sudo apt autoremove
- name: "Install new g++"
run: |
sudo apt install g++
- name: "Clone the PLSSVM repository into PLSSVM/"
uses: actions/[email protected]
with:
path: PLSSVM
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: "Create and activate virtual environment"
run: |
python -m venv venv
source venv/bin/activate
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
- name: "Install Python dependencies"
run: |
source $VIRTUAL_ENV/bin/activate
pip install --upgrade pip
pip install -r PLSSVM/install/python_requirements.txt
- name: "Build PLSSVM locally via pip"
run: |
source $VIRTUAL_ENV/bin/activate
cd PLSSVM
pip install .
- name: "Run examples"
env:
MPLBACKEND: Agg
run: |
source $VIRTUAL_ENV/bin/activate
set -e
cd PLSSVM/examples/python
python sklearn_like_svc.py
python sklearn_like_svr.py
cd sklearn
python plot_classifier_comparison.py
python plot_decision_boundaries_via_coef_and_intercept.py
python plot_decision_boundary_confidence.py
python plot_different_classifiers.py
python plot_digits_classification.py
python plot_face_recognition.py
python plot_feature_discretization.py
python plot_rbf_parameters.py
python plot_rbf_parameters_3_classes.py
python plot_separating_hyperplane.py
python plot_svm_anova.py
python plot_svm_kernels.py
python plot_svm_margin.py
python plot_svm_regression.py
23 changes: 8 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,22 @@ set(PLSSVM_BASE_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/detail/string_utility.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/detail/utility.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/exceptions/exceptions.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/svm/csvm.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/version/version.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/version/git_metadata/git_metadata.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/backend_types.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/classification_report.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/classification_types.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/csvm.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/file_format_types.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/gamma.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/kernel_function_types.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/matrix.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/parameter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/regression_report.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/shape.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/solver_types.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/target_platforms.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/svm_types.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/plssvm/verbosity_levels.cpp
)

Expand Down Expand Up @@ -166,7 +168,9 @@ target_compile_options(
/wd4005
/wd4702
/wd4849
/wd4127>
/wd4127
/wd4250 # disable multiple-inheritance dominance warning
/wd4589> # disable constructor inheritance warning
# /wd4849: ignore "OpenMP 'reduction' clause ignored in 'simd' directive" -> no SIMD clause currently effective in MSVC /wd4127: ignore "conditional
# expression is constant" from {fmt} ranges.h header
)
Expand Down Expand Up @@ -211,11 +215,11 @@ endif ()
########################################################################################################################
# check for OpenMP (not for the backend!) #
########################################################################################################################
find_package(OpenMP 4.0 QUIET)
find_package(OpenMP QUIET)
if (OpenMP_FOUND)
message(STATUS "Found OpenMP ${OpenMP_CXX_VERSION} to speed-up library utilities (like file parsing).")
set(PLSSVM_FOUND_OPENMP_FOR_UTILITY ON)
if (${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC")
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(${PLSSVM_BASE_LIBRARY_NAME} PUBLIC -openmp:llvm -openmp:experimental)
else ()
target_link_libraries(${PLSSVM_BASE_LIBRARY_NAME} PUBLIC OpenMP::OpenMP_CXX)
Expand Down Expand Up @@ -326,17 +330,6 @@ else ()
)
endif ()

include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/check_python_libs.cmake)
set(PLSSVM_TARGET_PLATFORMS_PYTHON_SCRIPT_REQUIRED_LIBS cpuinfo GPUtil pyamdgpuinfo pylspci)
message(
STATUS
"Checking required Python3 libraries (${PLSSVM_TARGET_PLATFORMS_PYTHON_SCRIPT_REQUIRED_LIBS}) to automatically determine the PLSSVM_TARGET_PLATFORMS."
)
set(PLSSVM_TARGET_PLATFORMS_PYTHON_SCRIPT_REQUIRED_LIBS_ERROR_MESSAGE
"or manually define PLSSVM_TARGET_PLATFORMS (e.g. -DPLSSVM_TARGET_PLATFORMS=\"cpu;nvidia:sm_70,sm_86;amd:gfx906;intel:skl\"!"
)
check_python_libs(${PLSSVM_TARGET_PLATFORMS_PYTHON_SCRIPT_REQUIRED_LIBS} ${PLSSVM_TARGET_PLATFORMS_PYTHON_SCRIPT_REQUIRED_LIBS_ERROR_MESSAGE})

# run our `plssvm_target_platforms.py` script to determine the PLSSVM_TARGET_PLATFORMS string
execute_process(
COMMAND ${Python3_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/utility_scripts/plssvm_target_platforms.py" "--quiet"
Expand Down
Loading
Loading