diff --git a/doc-sources/changelog.rst b/doc-sources/changelog.rst index dc35bf0e..5c812a70 100644 --- a/doc-sources/changelog.rst +++ b/doc-sources/changelog.rst @@ -4,14 +4,14 @@ Changelog ========= -Version 2.0.0a4 (planned 2024-11-09) -==================================== +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 (required for previous point) +- **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. diff --git a/doc-sources/conceptual-overview/conceptual-overview.ipynb b/doc-sources/conceptual-overview/conceptual-overview.ipynb index 6ec035e3..90be6224 100644 --- a/doc-sources/conceptual-overview/conceptual-overview.ipynb +++ b/doc-sources/conceptual-overview/conceptual-overview.ipynb @@ -21,7 +21,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "# Reproduction command (with lincs version 2.0.0a4.dev0): lincs classify problem.yml model.yml alternatives.csv\n", + "# Reproduction command (with lincs version 2.0.0a4): lincs classify problem.yml model.yml alternatives.csv\n", "name,Math,Physics,Literature,History,category\n", "A,1,1,1,1,\"Full scholarship\"\n", "B,1,1,1,0,\"Full scholarship\"\n", diff --git a/doc-sources/get-started.rst b/doc-sources/get-started.rst index 0fab63f1..14452f08 100644 --- a/doc-sources/get-started.rst +++ b/doc-sources/get-started.rst @@ -73,7 +73,7 @@ The generated ``problem.yml`` should look like: .. code:: yaml - # Reproduction command (with lincs version 2.0.0a4.dev0): 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: @@ -144,7 +144,7 @@ It should look like: .. code:: yaml - # Reproduction command (with lincs version 2.0.0a4.dev0): 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: @@ -217,7 +217,7 @@ It should start with something like this, and contain 1000 alternatives: .. code:: text - # Reproduction command (with lincs version 2.0.0a4.dev0): 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" @@ -253,7 +253,7 @@ so it is numerically different: .. code:: yaml - # Reproduction command (with lincs version 2.0.0a4.dev0): 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: diff --git a/doc-sources/get-started/get-started.ipynb b/doc-sources/get-started/get-started.ipynb index 7bfdddc4..82d944df 100644 --- a/doc-sources/get-started/get-started.ipynb +++ b/doc-sources/get-started/get-started.ipynb @@ -48,7 +48,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "# Reproduction command (with lincs version 2.0.0a4.dev0): lincs generate classification-problem 4 3 --random-seed 40\n", + "# Reproduction command (with lincs version 2.0.0a4): lincs generate classification-problem 4 3 --random-seed 40\n", "kind: classification-problem\n", "format_version: 1\n", "criteria:\n", @@ -126,7 +126,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "# Reproduction command (with lincs version 2.0.0a4.dev0): lincs generate classification-model problem.yml --random-seed 41 --model-type mrsort\n", + "# Reproduction command (with lincs version 2.0.0a4): lincs generate classification-model problem.yml --random-seed 41 --model-type mrsort\n", "kind: ncs-classification-model\n", "format_version: 1\n", "accepted_values:\n", @@ -211,7 +211,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "# Reproduction command (with lincs version 2.0.0a4.dev0): lincs generate classified-alternatives problem.yml model.yml 1000 --random-seed 42 --misclassified-count 0\n", + "# Reproduction command (with lincs version 2.0.0a4): lincs generate classified-alternatives problem.yml model.yml 1000 --random-seed 42 --misclassified-count 0\n", "name,\"Criterion 1\",\"Criterion 2\",\"Criterion 3\",\"Criterion 4\",category\n", "\"Alternative 1\",0.37454012,0.796543002,0.95071429,0.183434784,\"Best category\"\n", "\"Alternative 2\",0.731993914,0.779690981,0.598658502,0.596850157,\"Intermediate category 1\"\n", @@ -260,7 +260,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "# Reproduction command (with lincs version 2.0.0a4.dev0): 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\n", + "# 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\n", "kind: ncs-classification-model\n", "format_version: 1\n", "accepted_values:\n", diff --git a/doc-sources/user-guide.rst b/doc-sources/user-guide.rst index 190dca07..0c3fec3c 100644 --- a/doc-sources/user-guide.rst +++ b/doc-sources/user-guide.rst @@ -512,7 +512,7 @@ They produce a different kind of model, with the sufficient coalitions specified .. code:: yaml - # Reproduction command (with lincs version 2.0.0a4.dev0): lincs learn classification-model problem.yml learning-set.csv --model-type ucncs --ucncs.strategy sat-by-coalitions + # Reproduction command (with lincs version 2.0.0a4): lincs learn classification-model problem.yml learning-set.csv --model-type ucncs --ucncs.strategy sat-by-coalitions kind: ncs-classification-model format_version: 1 accepted_values: diff --git a/doc-sources/user-guide/alglib-learning/alglib-learning.ipynb b/doc-sources/user-guide/alglib-learning/alglib-learning.ipynb index b5232120..574b963b 100644 --- a/doc-sources/user-guide/alglib-learning/alglib-learning.ipynb +++ b/doc-sources/user-guide/alglib-learning/alglib-learning.ipynb @@ -27,7 +27,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "# Reproduction command (with lincs version 2.0.0a4.dev0): 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 alglib --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\n", + "# 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 alglib --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\n", "kind: ncs-classification-model\n", "format_version: 1\n", "accepted_values:\n", diff --git a/doc-sources/user-guide/gpu-learning/gpu-learning.ipynb b/doc-sources/user-guide/gpu-learning/gpu-learning.ipynb index dfd52bbe..7b3ca3bb 100644 --- a/doc-sources/user-guide/gpu-learning/gpu-learning.ipynb +++ b/doc-sources/user-guide/gpu-learning/gpu-learning.ipynb @@ -27,7 +27,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "# Reproduction command (with lincs version 2.0.0a4.dev0): 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 gpu --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\n", + "# 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 gpu --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\n", "kind: ncs-classification-model\n", "format_version: 1\n", "accepted_values:\n", diff --git a/doc-sources/user-guide/sat-learning/sat-learning.ipynb b/doc-sources/user-guide/sat-learning/sat-learning.ipynb index 6aa7ea63..99448789 100644 --- a/doc-sources/user-guide/sat-learning/sat-learning.ipynb +++ b/doc-sources/user-guide/sat-learning/sat-learning.ipynb @@ -22,7 +22,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "# Reproduction command (with lincs version 2.0.0a4.dev0): lincs learn classification-model problem.yml learning-set.csv --model-type ucncs --ucncs.strategy sat-by-coalitions\n", + "# Reproduction command (with lincs version 2.0.0a4): lincs learn classification-model problem.yml learning-set.csv --model-type ucncs --ucncs.strategy sat-by-coalitions\n", "kind: ncs-classification-model\n", "format_version: 1\n", "accepted_values:\n", @@ -58,7 +58,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "# Reproduction command (with lincs version 2.0.0a4.dev0): lincs learn classification-model problem.yml learning-set.csv --model-type ucncs --ucncs.strategy max-sat-by-separation --ucncs.max-sat-by-separation.solver eval-max-sat --ucncs.max-sat-by-separation.eval-max-sat.nb-minimize-threads 0 --ucncs.max-sat-by-separation.eval-max-sat.timeout-fast-minimize 60 --ucncs.max-sat-by-separation.eval-max-sat.coef-minimize-time 2\n", + "# Reproduction command (with lincs version 2.0.0a4): lincs learn classification-model problem.yml learning-set.csv --model-type ucncs --ucncs.strategy max-sat-by-separation --ucncs.max-sat-by-separation.solver eval-max-sat --ucncs.max-sat-by-separation.eval-max-sat.nb-minimize-threads 0 --ucncs.max-sat-by-separation.eval-max-sat.timeout-fast-minimize 60 --ucncs.max-sat-by-separation.eval-max-sat.coef-minimize-time 2\n", "kind: ncs-classification-model\n", "format_version: 1\n", "accepted_values:\n", diff --git a/doc-sources/user-guide/synthetic-data/synthetic-data.ipynb b/doc-sources/user-guide/synthetic-data/synthetic-data.ipynb index f6f756b1..cc6f48c3 100644 --- a/doc-sources/user-guide/synthetic-data/synthetic-data.ipynb +++ b/doc-sources/user-guide/synthetic-data/synthetic-data.ipynb @@ -14,7 +14,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "# Reproduction command (with lincs version 2.0.0a4.dev0): lincs generate classification-problem 4 3 --random-seed 57\n", + "# Reproduction command (with lincs version 2.0.0a4): lincs generate classification-problem 4 3 --random-seed 57\n", "kind: classification-problem\n", "format_version: 1\n", "criteria:\n", @@ -63,7 +63,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "# Reproduction command (with lincs version 2.0.0a4.dev0): lincs generate classification-model problem.yml --random-seed 58 --model-type mrsort\n", + "# Reproduction command (with lincs version 2.0.0a4): lincs generate classification-model problem.yml --random-seed 58 --model-type mrsort\n", "kind: ncs-classification-model\n", "format_version: 1\n", "accepted_values:\n", @@ -101,7 +101,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "# Reproduction command (with lincs version 2.0.0a4.dev0): lincs generate classified-alternatives problem.yml model.yml 100 --random-seed 59 --misclassified-count 0\n", + "# Reproduction command (with lincs version 2.0.0a4): lincs generate classified-alternatives problem.yml model.yml 100 --random-seed 59 --misclassified-count 0\n", "name,\"Criterion 1\",\"Criterion 2\",\"Criterion 3\",\"Criterion 4\",category\n", "\"Alternative 1\",0.924035132,0.804616809,0.157870576,0.637420833,\"Best category\"\n", "\"Alternative 2\",0.866915047,0.979161799,0.0841569453,0.397855282,\"Best category\"\n", @@ -224,7 +224,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "# Reproduction command (with lincs version 2.0.0a4.dev0): 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 60 --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\n", + "# 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 60 --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\n", "kind: ncs-classification-model\n", "format_version: 1\n", "accepted_values:\n", diff --git a/docs/.buildinfo b/docs/.buildinfo index 7d9a51a2..040df319 100644 --- a/docs/.buildinfo +++ b/docs/.buildinfo @@ -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 diff --git a/docs/.doctrees/changelog.doctree b/docs/.doctrees/changelog.doctree index 8f347bfa..b7c97a1b 100644 Binary files a/docs/.doctrees/changelog.doctree and b/docs/.doctrees/changelog.doctree differ diff --git a/docs/.doctrees/environment.pickle b/docs/.doctrees/environment.pickle index 63ab0db1..295f2638 100644 Binary files a/docs/.doctrees/environment.pickle and b/docs/.doctrees/environment.pickle differ diff --git a/docs/.doctrees/get-started.doctree b/docs/.doctrees/get-started.doctree index 3562a447..a701ff54 100644 Binary files a/docs/.doctrees/get-started.doctree and b/docs/.doctrees/get-started.doctree differ diff --git a/docs/.doctrees/python-api.doctree b/docs/.doctrees/python-api.doctree index 7b8b31f4..050293e0 100644 Binary files a/docs/.doctrees/python-api.doctree and b/docs/.doctrees/python-api.doctree differ diff --git a/docs/.doctrees/reference.doctree b/docs/.doctrees/reference.doctree index 49bfc90c..b590ced3 100644 Binary files a/docs/.doctrees/reference.doctree and b/docs/.doctrees/reference.doctree differ diff --git a/docs/.doctrees/reference/lincs.doctree b/docs/.doctrees/reference/lincs.doctree index ad20fccc..17f4df64 100644 Binary files a/docs/.doctrees/reference/lincs.doctree and b/docs/.doctrees/reference/lincs.doctree differ diff --git a/docs/.doctrees/user-guide.doctree b/docs/.doctrees/user-guide.doctree index cd39e7de..51316622 100644 Binary files a/docs/.doctrees/user-guide.doctree and b/docs/.doctrees/user-guide.doctree differ diff --git a/docs/README.html b/docs/README.html index c3004137..9d75b46e 100644 --- a/docs/README.html +++ b/docs/README.html @@ -5,11 +5,11 @@ - Contributors — lincs 2.0.0a3 documentation + Contributors — lincs 2.0.0a4 documentation - + diff --git a/docs/_downloads/019271a03d05a599bcfb6d68c868c86a/python-api.ipynb b/docs/_downloads/019271a03d05a599bcfb6d68c868c86a/python-api.ipynb index eb74b0f6..89a84040 100644 --- a/docs/_downloads/019271a03d05a599bcfb6d68c868c86a/python-api.ipynb +++ b/docs/_downloads/019271a03d05a599bcfb6d68c868c86a/python-api.ipynb @@ -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))" ] }, @@ -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", @@ -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, @@ -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]]" ] }, @@ -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" ] } @@ -2195,7 +2195,7 @@ { "data": { "text/plain": [ - "833" + "830" ] }, "execution_count": 77, @@ -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", @@ -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", @@ -2361,15 +2361,15 @@ "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", @@ -2377,7 +2377,7 @@ " - 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", @@ -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", @@ -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" ] } diff --git a/docs/_sources/changelog.rst.txt b/docs/_sources/changelog.rst.txt index 79a4a056..5c812a70 100644 --- a/docs/_sources/changelog.rst.txt +++ b/docs/_sources/changelog.rst.txt @@ -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) ============================ @@ -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 diff --git a/docs/_sources/get-started.rst.txt b/docs/_sources/get-started.rst.txt index 06850065..14452f08 100644 --- a/docs/_sources/get-started.rst.txt +++ b/docs/_sources/get-started.rst.txt @@ -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: @@ -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: @@ -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" @@ -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: diff --git a/docs/_sources/python-api.md.txt b/docs/_sources/python-api.md.txt index 3099fadd..8e7a3e47 100644 --- a/docs/_sources/python-api.md.txt +++ b/docs/_sources/python-api.md.txt @@ -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)) ``` @@ -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( @@ -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] ``` @@ -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]] ``` @@ -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 ``` @@ -1292,7 +1292,7 @@ models_being_learned.get_best_accuracy() ```text -833 +830 ``` @@ -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) @@ -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) @@ -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 @@ -1448,15 +1448,15 @@ 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 @@ -1464,7 +1464,7 @@ accepted_values: - kind: thresholds thresholds: [7.95116329, 3.74707603] - kind: thresholds - thresholds: [94, 99] + thresholds: [73, 99] - kind: thresholds thresholds: [B, B] sufficient_coalitions: @@ -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 ``` diff --git a/docs/_sources/reference/lincs.rst.txt b/docs/_sources/reference/lincs.rst.txt index dd5e0463..37870387 100644 --- a/docs/_sources/reference/lincs.rst.txt +++ b/docs/_sources/reference/lincs.rst.txt @@ -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. diff --git a/docs/_sources/user-guide.rst.txt b/docs/_sources/user-guide.rst.txt index 7d9f29d8..0c3fec3c 100644 --- a/docs/_sources/user-guide.rst.txt +++ b/docs/_sources/user-guide.rst.txt @@ -512,7 +512,7 @@ They produce a different kind of model, with the sufficient coalitions specified .. code:: yaml - # Reproduction command (with lincs version 2.0.0a3): lincs learn classification-model problem.yml learning-set.csv --model-type ucncs --ucncs.strategy sat-by-coalitions + # Reproduction command (with lincs version 2.0.0a4): lincs learn classification-model problem.yml learning-set.csv --model-type ucncs --ucncs.strategy sat-by-coalitions kind: ncs-classification-model format_version: 1 accepted_values: diff --git a/docs/_static/documentation_options.js b/docs/_static/documentation_options.js index 002500dd..c770ee08 100644 --- a/docs/_static/documentation_options.js +++ b/docs/_static/documentation_options.js @@ -1,6 +1,6 @@ var DOCUMENTATION_OPTIONS = { URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), - VERSION: '2.0.0a3', + VERSION: '2.0.0a4', LANGUAGE: 'en', COLLAPSE_INDEX: false, BUILDER: 'html', diff --git a/docs/changelog.html b/docs/changelog.html index e9da92ec..2c7034f8 100644 --- a/docs/changelog.html +++ b/docs/changelog.html @@ -5,11 +5,11 @@ - Changelog — lincs 2.0.0a3 documentation + Changelog — lincs 2.0.0a4 documentation - + @@ -34,6 +34,17 @@

Changelog

+
+

Version 2.0.0a4 (2024-11-08)

+ +

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

+

Version 2.0.0a3 (2024-10-10)