Skip to content

Commit

Permalink
add foreward reduction, increase fileversion number
Browse files Browse the repository at this point in the history
  • Loading branch information
conradhuebler committed May 20, 2019
1 parent 52af2ea commit b837247
Show file tree
Hide file tree
Showing 30 changed files with 344 additions and 266 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ add_library(models ${models_SRC})

target_link_libraries(models Qt5::Core)
set(utils_SRC
src/capabilities/reductionanalyse.cpp
src/capabilities/resampleanalyse.cpp
src/capabilities/abstractsearchclass.cpp
src/capabilities/modelcomparison.cpp
src/capabilities/montecarlostatistics.cpp
Expand Down
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# SupraFit 2.0 pre-Alpha

- add foreward reduction analysis to input keywords
- add command line option for suprafit_cli for execute jobfile
- Input variable randomisation for meta models enabled
- data points colors in meta models follow the series color definition
Expand Down
36 changes: 34 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,20 @@ git clones automatically fisher_dist and libpeakpick.
- [fisher_dis](https://github.com/conradhuebler/fisher_dist) provides the finv-function like in octave to calculate the quantiles of the F distribution
- [libpeakpick](https://github.com/conradhuebler/libpeakpick) provides some basic peak picking, peak integration and regression tools. It retrives a copy of eigen from official git mirror, that is used by SupraFit as well.

SupraFit comes with the some selected [Google Noto Fonts](https://github.com/googlei18n/noto-fonts). They are optional and can be included into the binary during compile-time (set `-Dnoto_font=true\false` as cmake argument).

## Compiling
To compile SupraFit you will need CMake 3 or newer, a C++11-capable compiler and a recent Qt version. Soon, Qt 5.12 LTS will be focused.

SupraFit has been successfully compilied with:
- gcc 5.2, gcc 6.3, gcc 7.3 and gcc 8.3
- clang 3.9

on linux systems and windows systems using
- mingw 5.3
- MSVC 2015


> Windows 7 or higher is mandatory.
> MacOS has not been tested yet.
Expand All @@ -36,15 +41,40 @@ The deprecated, not recommended version SupraFit 1 can be obtained with
git clone -b suprafit-v1 --recursive git@github.com:conradhuebler/SupraFit.git
```

Compile it as follows:
Compile it as follows on Unix Platform:
```sh
cd suprafit
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake .. -DCMAKE_BUILD_TYPE=Release -Dnoto_font=true/false
make
```

On Windows Systems use for example
```sh
cd suprafit
mkdir build
cd build
```
For Visual Studio use
```sh
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Release -Dnoto_font=true/false ..
```


> openMP is disabled when compiling with Visual Studio

or for MinGW (openMP is enabled, libgomp-1.dll is expected) use

```sh
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -Dnoto_font=true/false ..
```

```sh
cmake --build . --config Release
```

>Please note, that the current development version is still in alpha stage. Some features are not ready yet and some changes might break compatibility of the SupraFit file format.
## Running
Expand Down Expand Up @@ -90,5 +120,7 @@ A detailed handbook will be provided as soon as possbile.

## Citation
If you obtain results with SupraFit, please cite for now:

... coming soon ...

After release of the detailed articles describing the used methods, please refer to them as well.
9 changes: 9 additions & 0 deletions input/MonteCarlo_10000_1e-3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Bootstrap": false,
"IndependentRowVariance": "0 0",
"MaxSteps": 1000,
"OriginalData": false,
"Variance": 0.000989,
"VarianceSource": 1,
"method": 1
}
8 changes: 8 additions & 0 deletions input/MonteCarlo_1000_SEy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Bootstrap": false,
"IndependentRowVariance": "0 0",
"MaxSteps": 1000,
"OriginalData": false,
"VarianceSource": "SEy",
"method": 1
}
5 changes: 5 additions & 0 deletions input/ReductionBackward.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"ReductionRuntype": 1,
"cutoff": 2,
"method": 5
}
5 changes: 5 additions & 0 deletions input/ReductionForeward.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"ReductionRuntype": 2,
"cutoff": 2,
"method": 5
}
4 changes: 2 additions & 2 deletions scripts/build_windows.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ git submodule update --init --recursive
git pull --recurse-submodules
mkdir build
cd build
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Release ..
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Release -Dnoto_font=true ..
cmake --build . --config Release


Expand All @@ -18,7 +18,7 @@ copy suprafit.exe SupraFit
copy suprafit_cli.exe SupraFit

cd SupraFit
windeployqt --release SupraFit.exe
windeployqt --release suprafit.exe

echo Copying project files for archival...
copy "%project_dir%\README.md" "%project_dir%\build\Release\SupraFit\README.md"
Expand Down
61 changes: 17 additions & 44 deletions src/capabilities/jobmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "globalsearch.h"
#include "modelcomparison.h"
#include "montecarlostatistics.h"
#include "reductionanalyse.h"
#include "resampleanalyse.h"
#include "weakenedgridsearch.h"

#include "src/core/models.h"
Expand All @@ -43,10 +43,10 @@ JobManager::JobManager(QObject* parent)
connect(m_gridsearch_handler, SIGNAL(IncrementProgress(int)), this, SIGNAL(incremented(int)), Qt::DirectConnection);
connect(m_gridsearch_handler, SIGNAL(setMaximumSteps(int)), this, SIGNAL(prepare(int)), Qt::DirectConnection);

m_reduction_handler = new ReductionAnalyse();
connect(this, SIGNAL(Interrupt()), m_reduction_handler, SLOT(Interrupt()), Qt::DirectConnection);
connect(m_reduction_handler, SIGNAL(IncrementProgress(int)), this, SIGNAL(incremented(int)), Qt::DirectConnection);
connect(m_reduction_handler, SIGNAL(setMaximumSteps(int)), this, SIGNAL(prepare(int)), Qt::DirectConnection);
m_resample_handler = new ResampleAnalyse();
connect(this, SIGNAL(Interrupt()), m_resample_handler, SLOT(Interrupt()), Qt::DirectConnection);
connect(m_resample_handler, SIGNAL(IncrementProgress(int)), this, SIGNAL(incremented(int)), Qt::DirectConnection);
connect(m_resample_handler, SIGNAL(setMaximumSteps(int)), this, SIGNAL(prepare(int)), Qt::DirectConnection);

m_modelcomparison_handler = new ModelComparison(this);
connect(this, SIGNAL(Interrupt()), m_modelcomparison_handler, SLOT(Interrupt()), Qt::DirectConnection);
Expand All @@ -68,32 +68,28 @@ void JobManager::RunJobs()
for (const QJsonObject& object : m_jobs) {
SupraFit::Method method = static_cast<SupraFit::Method>(object["method"].toInt());
QJsonObject result;
qDebug() << object;
// qDebug() << object;
switch (method) {
case SupraFit::Method::WeakenedGridSearch:
result = RunGridSearch(object);
break;

case SupraFit::Method::ModelComparison:
case SupraFit::Method::FastConfidence:

result = RunModelComparison(object);
break;

case SupraFit::Method::FastConfidence:
result = RunFastConfidence(object);
break;

case SupraFit::Method::Reduction:
result = RunReduction(object);
case SupraFit::Method::CrossValidation:
result = RunResample(object);
break;

case SupraFit::Method::MonteCarlo:
result = RunMonteCarlo(object);
break;

case SupraFit::Method::CrossValidation:
result = RunCrossValidation(object);
break;

case SupraFit::Method::GlobalSearch:
result = RunGlobalSearch(object);
break;
Expand All @@ -108,7 +104,7 @@ QJsonObject JobManager::RunModelComparison(const QJsonObject& job)
{
m_modelcomparison_handler->setModel(m_model);
m_modelcomparison_handler->setController(job);
m_modelcomparison_handler->Confidence();
m_modelcomparison_handler->Run();

QJsonObject result = m_modelcomparison_handler->Result();
m_modelcomparison_handler->clear();
Expand All @@ -130,17 +126,6 @@ QJsonObject JobManager::RunMonteCarlo(const QJsonObject& job)
return result;
}

QJsonObject JobManager::RunCrossValidation(const QJsonObject& job)
{
m_reduction_handler->setModel(m_model);
m_reduction_handler->setController(job);
m_reduction_handler->Run();

QJsonObject result = m_reduction_handler->Result();
m_reduction_handler->clear();
return result;
}

QJsonObject JobManager::RunGridSearch(const QJsonObject& job)
{

Expand All @@ -153,25 +138,13 @@ QJsonObject JobManager::RunGridSearch(const QJsonObject& job)
return result;
}

QJsonObject JobManager::RunFastConfidence(const QJsonObject& job)
{
m_modelcomparison_handler->setModel(m_model);
m_modelcomparison_handler->setController(job);
m_modelcomparison_handler->Run();

QJsonObject result = m_modelcomparison_handler->Result();
m_modelcomparison_handler->clear();

return result;
}

QJsonObject JobManager::RunReduction(const QJsonObject& job)
QJsonObject JobManager::RunResample(const QJsonObject& job)
{
m_reduction_handler->setModel(m_model);
m_reduction_handler->setController(job);
m_reduction_handler->Run();
QJsonObject result = m_reduction_handler->Result();
m_reduction_handler->clear();
m_resample_handler->setModel(m_model);
m_resample_handler->setController(job);
m_resample_handler->Run();
QJsonObject result = m_resample_handler->Result();
m_resample_handler->clear();
return result;
}

Expand Down
Loading

0 comments on commit b837247

Please sign in to comment.