Skip to content

Commit

Permalink
Add docs for v2.0.0a4 on GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquev6 committed Nov 8, 2024
1 parent f9f7b9d commit b932c7a
Show file tree
Hide file tree
Showing 32 changed files with 144 additions and 118 deletions.
2 changes: 1 addition & 1 deletion docs/pre/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: cded3a427bff386c9945aacc676c5163
config: b8b49b2c9835f2e65ccc23820533afe5
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file modified docs/pre/.doctrees/changelog.doctree
Binary file not shown.
Binary file modified docs/pre/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/pre/.doctrees/get-started.doctree
Binary file not shown.
Binary file modified docs/pre/.doctrees/python-api.doctree
Binary file not shown.
Binary file modified docs/pre/.doctrees/reference.doctree
Binary file not shown.
Binary file modified docs/pre/.doctrees/reference/lincs.doctree
Binary file not shown.
Binary file modified docs/pre/.doctrees/user-guide.doctree
Binary file not shown.
4 changes: 2 additions & 2 deletions docs/pre/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<title>Contributors &#8212; lincs 2.0.0a3 documentation</title>
<title>Contributors &#8212; lincs 2.0.0a4 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css?v=039e1c02" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=eafc0fe6" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js?v=50df3787"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js?v=9b56a74a"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="genindex.html" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
"profiles_initialization_strategy = lc.InitializeProfilesForProbabilisticMaximalDiscriminationPowerPerCriterion(preprocessed_learning_set, models_being_learned)\n",
"weights_optimization_strategy = lc.OptimizeWeightsUsingGlop(preprocessed_learning_set, models_being_learned)\n",
"profiles_improvement_strategy = lc.ImproveProfilesWithAccuracyHeuristicOnCpu(preprocessed_learning_set, models_being_learned)\n",
"breeding_strategy = lc.ReinitializeLeastAccurate(models_being_learned, profiles_initialization_strategy=profiles_initialization_strategy, count=4)\n",
"breeding_strategy = lc.ReinitializeLeastAccurate(models_being_learned, profiles_initialization_strategy, weights_optimization_strategy, count=4)\n",
"termination_strategy = lc.TerminateAtAccuracy(models_being_learned, target_accuracy=len(learning_set.alternatives))"
]
},
Expand Down Expand Up @@ -1970,7 +1970,7 @@
"profiles_initialization_strategy = lc.InitializeProfilesForProbabilisticMaximalDiscriminationPowerPerCriterion(preprocessed_learning_set, models_being_learned)\n",
"weights_optimization_strategy = lc.OptimizeWeightsUsingGlop(preprocessed_learning_set, models_being_learned)\n",
"profiles_improvement_strategy = lc.ImproveProfilesWithAccuracyHeuristicOnCpu(preprocessed_learning_set, models_being_learned)\n",
"breeding_strategy = lc.ReinitializeLeastAccurate(models_being_learned, profiles_initialization_strategy=profiles_initialization_strategy, count=4)\n",
"breeding_strategy = lc.ReinitializeLeastAccurate(models_being_learned, profiles_initialization_strategy, weights_optimization_strategy, count=4)\n",
"termination_strategy = lc.TerminateAfterIterations(models_being_learned, max_iterations_count=1)\n",
"\n",
"lc.LearnMrsortByWeightsProfilesBreed(\n",
Expand Down Expand Up @@ -2032,7 +2032,7 @@
{
"data": {
"text/plain": [
"[728, 593, 725, 671, 637, 609, 676, 833, 640]"
"[764, 595, 725, 666, 637, 609, 676, 830, 640]"
]
},
"execution_count": 72,
Expand Down Expand Up @@ -2127,14 +2127,14 @@
{
"data": {
"text/plain": [
"[[1.0132789611816406e-06, 0.9999989867210388, 1.0132789611816406e-06],\n",
" [0.9999989867210388, 0.9999989867210388, 1.0132789611816406e-06],\n",
"[[0.5, 0.5, 0.5],\n",
" [1.0, 0.9999989867210388, 1.0132789611816406e-06],\n",
" [1.0, 0.0, 0.9999989867210388],\n",
" [1.0, 0.0, 0.9999989867210388],\n",
" [0.5000004768371582, 0.4999994933605194, 0.4999994933605194],\n",
" [1.0132789611816406e-06, 0.9999989867210388, 0.0],\n",
" [0.9999989867210388, 0.0, 1.0132789611816406e-06],\n",
" [1.0, 0.0, 0.0],\n",
" [1.0, 0.9999989867210388, 1.0132789611816406e-06],\n",
" [1.0132789611816406e-06, 0.0, 0.9999989867210388],\n",
" [1.0, 0.0, 0.9999989867210388],\n",
" [1.0, 0.0, 1.0],\n",
" [0.9999989867210388, 0.0, 0.9999989867210388]]"
]
},
Expand Down Expand Up @@ -2177,7 +2177,7 @@
"sufficient_coalitions:\n",
" - &coalitions\n",
" kind: weights\n",
" criterion_weights: [1, 0.999998987, 1.01327896e-06]\n",
" criterion_weights: [1, 0, 1]\n",
" - *coalitions\n"
]
}
Expand All @@ -2195,7 +2195,7 @@
{
"data": {
"text/plain": [
"833"
"830"
]
},
"execution_count": 77,
Expand Down Expand Up @@ -2281,7 +2281,7 @@
"profiles_initialization_strategy = lc.InitializeProfilesForProbabilisticMaximalDiscriminationPowerPerCriterion(preprocessed_learning_set, models_being_learned)\n",
"weights_optimization_strategy = lc.OptimizeWeightsUsingGlop(preprocessed_learning_set, models_being_learned)\n",
"profiles_improvement_strategy = lc.ImproveProfilesWithAccuracyHeuristicOnCpu(preprocessed_learning_set, models_being_learned)\n",
"breeding_strategy = lc.ReinitializeLeastAccurate(models_being_learned, profiles_initialization_strategy=profiles_initialization_strategy, count=4)\n",
"breeding_strategy = lc.ReinitializeLeastAccurate(models_being_learned, profiles_initialization_strategy, weights_optimization_strategy, count=4)\n",
"termination_strategy = lc.TerminateAtAccuracy(models_being_learned, target_accuracy=len(learning_set.alternatives))\n",
"observer = VerboseObserver(models_being_learned)\n",
"\n",
Expand Down Expand Up @@ -2327,7 +2327,7 @@
"sufficient_coalitions:\n",
" - &coalitions\n",
" kind: weights\n",
" criterion_weights: [1, 0.999998987, 1.01327896e-06]\n",
" criterion_weights: [1, 0, 1]\n",
" - *coalitions\n",
"kind: ncs-classification-model\n",
"format_version: 1\n",
Expand Down Expand Up @@ -2361,23 +2361,23 @@
"format_version: 1\n",
"accepted_values:\n",
" - kind: thresholds\n",
" thresholds: [7.96338844, 3.74707603]\n",
" thresholds: [7.93314505, 3.74707603]\n",
" - kind: thresholds\n",
" thresholds: [94, 99]\n",
" thresholds: [9, 9]\n",
" - kind: thresholds\n",
" thresholds: [B, B]\n",
"sufficient_coalitions:\n",
" - &coalitions\n",
" kind: weights\n",
" criterion_weights: [1, 0, 1]\n",
" criterion_weights: [1, 0.999998987, 1]\n",
" - *coalitions\n",
"kind: ncs-classification-model\n",
"format_version: 1\n",
"accepted_values:\n",
" - kind: thresholds\n",
" thresholds: [7.95116329, 3.74707603]\n",
" - kind: thresholds\n",
" thresholds: [94, 99]\n",
" thresholds: [73, 99]\n",
" - kind: thresholds\n",
" thresholds: [B, B]\n",
"sufficient_coalitions:\n",
Expand Down Expand Up @@ -2410,7 +2410,7 @@
"profiles_initialization_strategy = lc.InitializeProfilesForProbabilisticMaximalDiscriminationPowerPerCriterion(preprocessed_learning_set, models_being_learned)\n",
"weights_optimization_strategy = lc.OptimizeWeightsUsingGlop(preprocessed_learning_set, models_being_learned)\n",
"profiles_improvement_strategy = lc.ImproveProfilesWithAccuracyHeuristicOnCpu(preprocessed_learning_set, models_being_learned)\n",
"breeding_strategy = lc.ReinitializeLeastAccurate(models_being_learned, profiles_initialization_strategy=profiles_initialization_strategy, count=4)\n",
"breeding_strategy = lc.ReinitializeLeastAccurate(models_being_learned, profiles_initialization_strategy, weights_optimization_strategy, count=4)\n",
"termination_strategy = lc.TerminateAtAccuracy(models_being_learned, target_accuracy=len(learning_set.alternatives))\n",
"observer = IntermediatesObserver(problem, models_being_learned)\n",
"\n",
Expand Down Expand Up @@ -2634,18 +2634,19 @@
"initialize_profiles 0 9\n",
"optimize_weights 0 9\n",
"improve_profiles 0 9\n",
"optimize_weights 0 9\n",
"terminate\n",
"breed\n",
"optimize_weights 0 9\n",
"improve_profiles 0 9\n",
"optimize_weights 0 9\n",
"terminate\n",
"breed\n",
"optimize_weights 0 9\n",
"improve_profiles 0 9\n",
"optimize_weights 0 9\n",
"terminate\n",
"breed\n",
"optimize_weights 0 9\n",
"improve_profiles 0 9\n",
"optimize_weights 0 9\n",
"terminate\n"
]
}
Expand Down
15 changes: 13 additions & 2 deletions docs/pre/_sources/changelog.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@
Changelog
=========

Version 2.0.0a4 (2024-11-08)
============================

- **Changes behavior slightly** Optimize WPB model weights before evaluating and returning them
- **Breaking** Add parameter ``weights_optimization_strategy`` to the ``ReinitializeLeastAccurate`` breeding strategy (required to fix previous point)
- **Changes behavior slightly** Always keep the best model during WPB
- Fix the ``universal2`` wheels for macOS to actually run on M1 Macs
- **Changes behavior slightly** Upgrade OR-Tools from 8.2 to 9.11 on Linux and macOS (required for previous point)

**Note** On Windows, the package still uses OR-Tools 8.2.

Version 2.0.0a3 (2024-10-10)
============================

Expand All @@ -14,8 +25,8 @@ Version 2.0.0a3 (2024-10-10)
- exposed on the command-line with the ``--mrsort.weights-profiles-breed.linear-program.solver`` and ``--mrsort.weights-profiles-breed.linear-program.experimental-in-house-simplex.processor`` options
- very EXPERIMENTAL, with unsatisfactory results for now

Version 2.0.0 (2024-XX-YY)
==========================
Version 2.0.0 (planned 2024-12-05)
==================================

- Support Python 3.12

Expand Down
8 changes: 4 additions & 4 deletions docs/pre/_sources/get-started.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ The generated ``problem.yml`` should look like:

.. code:: yaml
# Reproduction command (with lincs version 2.0.0a3): lincs generate classification-problem 4 3 --random-seed 40
# Reproduction command (with lincs version 2.0.0a4): lincs generate classification-problem 4 3 --random-seed 40
kind: classification-problem
format_version: 1
criteria:
Expand Down Expand Up @@ -144,7 +144,7 @@ It should look like:

.. code:: yaml
# Reproduction command (with lincs version 2.0.0a3): lincs generate classification-model problem.yml --random-seed 41 --model-type mrsort
# Reproduction command (with lincs version 2.0.0a4): lincs generate classification-model problem.yml --random-seed 41 --model-type mrsort
kind: ncs-classification-model
format_version: 1
accepted_values:
Expand Down Expand Up @@ -217,7 +217,7 @@ It should start with something like this, and contain 1000 alternatives:

.. code:: text
# Reproduction command (with lincs version 2.0.0a3): lincs generate classified-alternatives problem.yml model.yml 1000 --random-seed 42 --misclassified-count 0
# Reproduction command (with lincs version 2.0.0a4): lincs generate classified-alternatives problem.yml model.yml 1000 --random-seed 42 --misclassified-count 0
name,"Criterion 1","Criterion 2","Criterion 3","Criterion 4",category
"Alternative 1",0.37454012,0.796543002,0.95071429,0.183434784,"Best category"
"Alternative 2",0.731993914,0.779690981,0.598658502,0.596850157,"Intermediate category 1"
Expand Down Expand Up @@ -253,7 +253,7 @@ so it is numerically different:

.. code:: yaml
# Reproduction command (with lincs version 2.0.0a3): lincs learn classification-model problem.yml learning-set.csv --model-type mrsort --mrsort.strategy weights-profiles-breed --mrsort.weights-profiles-breed.models-count 9 --mrsort.weights-profiles-breed.accuracy-heuristic.random-seed 43 --mrsort.weights-profiles-breed.initialization-strategy maximize-discrimination-per-criterion --mrsort.weights-profiles-breed.weights-strategy linear-program --mrsort.weights-profiles-breed.linear-program.solver glop --mrsort.weights-profiles-breed.profiles-strategy accuracy-heuristic --mrsort.weights-profiles-breed.accuracy-heuristic.processor cpu --mrsort.weights-profiles-breed.breed-strategy reinitialize-least-accurate --mrsort.weights-profiles-breed.reinitialize-least-accurate.portion 0.5 --mrsort.weights-profiles-breed.target-accuracy 1.0
# Reproduction command (with lincs version 2.0.0a4): lincs learn classification-model problem.yml learning-set.csv --model-type mrsort --mrsort.strategy weights-profiles-breed --mrsort.weights-profiles-breed.models-count 9 --mrsort.weights-profiles-breed.accuracy-heuristic.random-seed 43 --mrsort.weights-profiles-breed.initialization-strategy maximize-discrimination-per-criterion --mrsort.weights-profiles-breed.weights-strategy linear-program --mrsort.weights-profiles-breed.linear-program.solver glop --mrsort.weights-profiles-breed.profiles-strategy accuracy-heuristic --mrsort.weights-profiles-breed.accuracy-heuristic.processor cpu --mrsort.weights-profiles-breed.breed-strategy reinitialize-least-accurate --mrsort.weights-profiles-breed.reinitialize-least-accurate.portion 0.5 --mrsort.weights-profiles-breed.target-accuracy 1.0
kind: ncs-classification-model
format_version: 1
accepted_values:
Expand Down
43 changes: 22 additions & 21 deletions docs/pre/_sources/python-api.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ models_being_learned = lc.LearnMrsortByWeightsProfilesBreed.ModelsBeingLearned(p
profiles_initialization_strategy = lc.InitializeProfilesForProbabilisticMaximalDiscriminationPowerPerCriterion(preprocessed_learning_set, models_being_learned)
weights_optimization_strategy = lc.OptimizeWeightsUsingGlop(preprocessed_learning_set, models_being_learned)
profiles_improvement_strategy = lc.ImproveProfilesWithAccuracyHeuristicOnCpu(preprocessed_learning_set, models_being_learned)
breeding_strategy = lc.ReinitializeLeastAccurate(models_being_learned, profiles_initialization_strategy=profiles_initialization_strategy, count=4)
breeding_strategy = lc.ReinitializeLeastAccurate(models_being_learned, profiles_initialization_strategy, weights_optimization_strategy, count=4)
termination_strategy = lc.TerminateAtAccuracy(models_being_learned, target_accuracy=len(learning_set.alternatives))
```

Expand Down Expand Up @@ -1146,7 +1146,7 @@ models_being_learned = lc.LearnMrsortByWeightsProfilesBreed.ModelsBeingLearned(p
profiles_initialization_strategy = lc.InitializeProfilesForProbabilisticMaximalDiscriminationPowerPerCriterion(preprocessed_learning_set, models_being_learned)
weights_optimization_strategy = lc.OptimizeWeightsUsingGlop(preprocessed_learning_set, models_being_learned)
profiles_improvement_strategy = lc.ImproveProfilesWithAccuracyHeuristicOnCpu(preprocessed_learning_set, models_being_learned)
breeding_strategy = lc.ReinitializeLeastAccurate(models_being_learned, profiles_initialization_strategy=profiles_initialization_strategy, count=4)
breeding_strategy = lc.ReinitializeLeastAccurate(models_being_learned, profiles_initialization_strategy, weights_optimization_strategy, count=4)
termination_strategy = lc.TerminateAfterIterations(models_being_learned, max_iterations_count=1)

lc.LearnMrsortByWeightsProfilesBreed(
Expand Down Expand Up @@ -1189,7 +1189,7 @@ list(models_being_learned.accuracies) # Indexed by model_index


```text
[728, 593, 725, 671, 637, 609, 676, 833, 640]
[764, 595, 725, 666, 637, 609, 676, 830, 640]
```


Expand Down Expand Up @@ -1245,14 +1245,14 @@ Its `weights` attribute holds the MR-Sort weight of each criterion in each in-pr


```text
[[1.0132789611816406e-06, 0.9999989867210388, 1.0132789611816406e-06],
[0.9999989867210388, 0.9999989867210388, 1.0132789611816406e-06],
[[0.5, 0.5, 0.5],
[1.0, 0.9999989867210388, 1.0132789611816406e-06],
[1.0, 0.0, 0.9999989867210388],
[1.0, 0.0, 0.9999989867210388],
[0.5000004768371582, 0.4999994933605194, 0.4999994933605194],
[1.0132789611816406e-06, 0.9999989867210388, 0.0],
[0.9999989867210388, 0.0, 1.0132789611816406e-06],
[1.0, 0.0, 0.0],
[1.0, 0.9999989867210388, 1.0132789611816406e-06],
[1.0132789611816406e-06, 0.0, 0.9999989867210388],
[1.0, 0.0, 0.9999989867210388],
[1.0, 0.0, 1.0],
[0.9999989867210388, 0.0, 0.9999989867210388]]
```

Expand All @@ -1278,7 +1278,7 @@ accepted_values:
sufficient_coalitions:
- &coalitions
kind: weights
criterion_weights: [1, 0.999998987, 1.01327896e-06]
criterion_weights: [1, 0, 1]
- *coalitions
```

Expand All @@ -1292,7 +1292,7 @@ models_being_learned.get_best_accuracy()


```text
833
830
```


Expand Down Expand Up @@ -1327,7 +1327,7 @@ We can now pass it to a learning and perform that learning to observe its effect
profiles_initialization_strategy = lc.InitializeProfilesForProbabilisticMaximalDiscriminationPowerPerCriterion(preprocessed_learning_set, models_being_learned)
weights_optimization_strategy = lc.OptimizeWeightsUsingGlop(preprocessed_learning_set, models_being_learned)
profiles_improvement_strategy = lc.ImproveProfilesWithAccuracyHeuristicOnCpu(preprocessed_learning_set, models_being_learned)
breeding_strategy = lc.ReinitializeLeastAccurate(models_being_learned, profiles_initialization_strategy=profiles_initialization_strategy, count=4)
breeding_strategy = lc.ReinitializeLeastAccurate(models_being_learned, profiles_initialization_strategy, weights_optimization_strategy, count=4)
termination_strategy = lc.TerminateAtAccuracy(models_being_learned, target_accuracy=len(learning_set.alternatives))
observer = VerboseObserver(models_being_learned)

Expand Down Expand Up @@ -1381,7 +1381,7 @@ models_being_learned = lc.LearnMrsortByWeightsProfilesBreed.ModelsBeingLearned(p
profiles_initialization_strategy = lc.InitializeProfilesForProbabilisticMaximalDiscriminationPowerPerCriterion(preprocessed_learning_set, models_being_learned)
weights_optimization_strategy = lc.OptimizeWeightsUsingGlop(preprocessed_learning_set, models_being_learned)
profiles_improvement_strategy = lc.ImproveProfilesWithAccuracyHeuristicOnCpu(preprocessed_learning_set, models_being_learned)
breeding_strategy = lc.ReinitializeLeastAccurate(models_being_learned, profiles_initialization_strategy=profiles_initialization_strategy, count=4)
breeding_strategy = lc.ReinitializeLeastAccurate(models_being_learned, profiles_initialization_strategy, weights_optimization_strategy, count=4)
termination_strategy = lc.TerminateAtAccuracy(models_being_learned, target_accuracy=len(learning_set.alternatives))
observer = IntermediatesObserver(problem, models_being_learned)

Expand Down Expand Up @@ -1414,7 +1414,7 @@ accepted_values:
sufficient_coalitions:
- &coalitions
kind: weights
criterion_weights: [1, 0.999998987, 1.01327896e-06]
criterion_weights: [1, 0, 1]
- *coalitions
kind: ncs-classification-model
format_version: 1
Expand Down Expand Up @@ -1448,23 +1448,23 @@ kind: ncs-classification-model
format_version: 1
accepted_values:
- kind: thresholds
thresholds: [7.96338844, 3.74707603]
thresholds: [7.93314505, 3.74707603]
- kind: thresholds
thresholds: [94, 99]
thresholds: [9, 9]
- kind: thresholds
thresholds: [B, B]
sufficient_coalitions:
- &coalitions
kind: weights
criterion_weights: [1, 0, 1]
criterion_weights: [1, 0.999998987, 1]
- *coalitions
kind: ncs-classification-model
format_version: 1
accepted_values:
- kind: thresholds
thresholds: [7.95116329, 3.74707603]
- kind: thresholds
thresholds: [94, 99]
thresholds: [73, 99]
- kind: thresholds
thresholds: [B, B]
sufficient_coalitions:
Expand Down Expand Up @@ -1605,18 +1605,19 @@ learned_model = lc.LearnMrsortByWeightsProfilesBreed(
initialize_profiles 0 9
optimize_weights 0 9
improve_profiles 0 9
optimize_weights 0 9
terminate
breed
optimize_weights 0 9
improve_profiles 0 9
optimize_weights 0 9
terminate
breed
optimize_weights 0 9
improve_profiles 0 9
optimize_weights 0 9
terminate
breed
optimize_weights 0 9
improve_profiles 0 9
optimize_weights 0 9
terminate
```

Expand Down
2 changes: 1 addition & 1 deletion docs/pre/_sources/reference/lincs.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@

The breeding strategy described in Olivier Sobrie's PhD thesis: re-initializes ``count`` in-progress models.

.. method:: __init__(models_being_learned: ModelsBeingLearned, profiles_initialization_strategy: ProfilesInitializationStrategy, count: int)
.. method:: __init__(models_being_learned: ModelsBeingLearned, profiles_initialization_strategy: ProfilesInitializationStrategy, weights_optimization_strategy: WeightsOptimizationStrategy, count: int)

Constructor. Keeps references to the profiles initialization strategy and the learning data.

Expand Down
Loading

0 comments on commit b932c7a

Please sign in to comment.