Author: cpm_admin

  • NEW VERSION IS OUT NOW: cpm v0.25.6!

    https://github.com/DevComPsy/cpm/releases

    Install

    You can install the new release straight from the PyPi repository:

    pip install cpm-toolbox

    Added

    • Introduce a third-party connector for the cpm.generators.Wrapper class to facilitate integration with external optimisation procedures
    • Add validation for ‘observed’ column in Wrapper class to ensure it exists before running model or computing loss
    • Add warnings to inform users if ‘observed’ column is missing in the data provided to Wrapper class
    • Added detailed guidance on fitting the models (PTSM, PTSM1992, and PTSM2025) to data, including recommendations for setting the temperature parameter, handling overflow warnings, and normalizing utility values to avoid numerical instability.
    • Added documentations for the datasets included in cpm.datasets, detailing the experimental procedure, data structure and usage (#69) @FloorJBurghoorn
    • Added cpm.utils.data.convert_to_RLRW data conversion utility to create dataframes compatible with cpm.applications.reinforcement_learning.RLRW
    • Added cpm.utils.data.convert_to_PTSM data conversion utility to create dataframes compatible with cpm.applications.decision_makin.RLRW

    Changed

    • cpm.core.parallel.execute_parallel now suppresses ipyparallel cluster status messages by setting log level to ERROR
    • cpm.core.parallel.execute_parallel libraries parameter default is no longer a mutable list
    • Update cpm.applications.reinforcement_learning.RLRW class to use numpy.asarray for the values parameter, ensuring compatibility with numpy=>2.0
    • Increased bandit task dataset size
    • Update test units for cpm.applications.reinforcement_learning.RLRW to include handling of new changes, such as using numpy.asarray for values and adding an ‘observed’ column in the test dataset
    • Improved the error messages in check_nan_and_bounds_in_input to provide more actionable feedback when encountering NaN or Inf values in predicted or observed data, including likely causes and suggested remedies.
    • Display option now blocks all prints in optimization module (#71) @tzukpolinsky

    Fixed

    • Fix cpm.core.parallel.in_ipynb to correctly distinguish Jupyter notebooks from IPython terminal sessions by checking for ZMQInteractiveShell
    • Fix cpm.core.parallel.execute_parallel ipyparallel cluster not being shut down after execution, causing engine process leaks
    • Fix wrong probabilities for generating data in cpm.applications.decision_making.PTSM2025 model #67 @FloorJBurghoorn
    • Fix matplotlib>=3.10 dependency mismatch errors upon loading cpm by removing unused imports in cpm.utils.metad
    • Fix the usage of ppt_identifier in Minimize class (#72) @tzukpolinsky
    • Fix usage of NaN in cpm.models.decision.SoftMax
    • Fix the import for cpm.models.learning

    Removed

    • Removed unused imports in cpm.utils.metad to prevent dependency issues with matplotlib>=3.10
    • Removed cpm.models.learning.KernelUpdate due to inconsistencies between equations reported in paper and code available in GitHub
  • v0.23.18 – New Prospect Models, improved parameter management, and a few bug fixes

    New models (three variants of Prospect Theory), new features (more ways to manage parameters, more model components to use), and of course bug fixes. If you want to make your computational modelling reproducible and robust, check out and install the new version of *cpm*:

    https://github.com/DevComPsy/cpm/releases/tag/0.23.18

    Install

    You can install the new release straight from the PyPi repository:

    pip install cpm-toolbox
    

    Added

    • Add input validation and error handling in all cpm.optimisation.minimise methods
    • Add test units for cpm.optimisation.minimise
    • Added three models based on Prospect Theory: cpm.applications.decision_making.PTSM, cpm.applications.decision_making.PTSM1992, and cpm.applications.decision_making.PTSM2025 with the help of @BenJonathanWagner
    • The cpm.generators.Parameters class now supports None-type parameters, allowing for more flexible model configurations
    • The cpm.generators.Parameters class now supports the use of user-defined functions as attributes in addition to freely-varying parameters
    • Add cpm.datasets.load_risky_choices function to load built-in risky choices dataset from @BenJonathanWagner and @tuhauser
    • Expanded cpm.models.activation.ProspectUtility class to include additional parameters for more flexible modeling of decision-making under risk, more closely approximating Tversky & Kahneman’s (1992) version of Prospect Theory

    Fixed

    • Fix simulation_export function to handle DataFrame output correctly
    • Fix detailed_pandas_compiler function to support new numpy versions
    • Fix probability adjustements in cpm.optimisation.minimise.LogLikelihood method to ensure correct parameter estimates pointed out by @BenJonathanWagner and @tuhauser
    • Resolved a bug in the detailed_pandas_compiler function to handle various data types and ensure proper DataFrame formatting in cpm/core/data.py.