Skip to main content

Tools for online behavioral modeling

Project description

License: Apache-2.0

This project is licensed under the Apache License 2.0.
See LICENSE and NOTICE for details. © 2025 Noor Jamaludeen

Online-Behavioral-Modeling

This Python package enables the online discovery of behavioral patterns in trial-by-trial experiments. In trial-by-trial experiments, a participant (human/animal) is exposed to a series of stimuli and is expected to respond. The behavioral pattern is defined as the quantification of the contributions of stimulus features to the prediction of the response, taking into account the effects from prior trials.

Format of input data

The behavioral data should be formatted as a pandas dataframe where the trials are chronologically ordered. Each trial/row consists of a stimulus described by a set of features and a corresponding response.

An Example of usage:

Input arguments: par: Name/ID of participant, effect_var: response parent_cause_vars: stimulus features lags: list of numbers of prior trials simulator_types: list of simulator types to be employed [0='NP',1='OP',2='UP'] output_file: path of file to output the results of hyperparameter tuning default_missing_value: value to be used to refer to missing <stimulus feature value, response value> pairs. dt_runs: number of runs for the decision tree model to account for non-determinism, eval_method: evaluation method used to evaluate the performance of the simulator [Leave_one_out,KFold,StratifiedKFold,RepeatedStratifiedKFold], eval_method_model_selection: evaluation method used to select the best machine learning algorithm [Leave_one_out,KFold,StratifiedKFold,RepeatedStratifiedKFold], svm_model: Support vector machine classifier for categorical response and Support Vector machine Regressor for numeric response, dt_model: Decision Tree classifier for categorical response and Decision Tree Regressor for numeric response num_processes: Number of processes k: number of folds for evaluation r: number of repetitions for evaluation

behavioral_pattern_object = behaviour_constructor.behaviourConstructor(par, effect_var, parent_cause_vars, [lag], simulator_types=[simulator], output_file=directory, default_missing_value=0, dt_runs=runs, eval_method=LeaveOneOut(), category=None, eval_method_model_selection=RepeatedStratifiedKFold( n_splits=k, n_repeats=r), svm_model=svm.SVC, dt_model=tree.DecisionTreeClassifier , num_processes=processors, k=k, r=r,max_lag_var=max_lag)

behavioral_pattern,,,_=behavioral_pattern_object.generate_behavioural_pattern(data_window[parent_cause_vars+[effect_var]]) The object behavioral_pattern contains the quantification of the stimulus features to the response. Each value ranges from 0 to 1 with higher values indicating stronger contributions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

online_behavioral_modeling-0.1.2.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

online_behavioral_modeling-0.1.2-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file online_behavioral_modeling-0.1.2.tar.gz.

File metadata

File hashes

Hashes for online_behavioral_modeling-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b818a19bb45f14cd3fc58716a9a89203ccdc8f0a702c4af9f4f316c9b75c1585
MD5 23ed9da2584d8a36177dff3f3aceb012
BLAKE2b-256 138b1b60795009f7390543e92c94e4a9297066a9fb4ba97b8b7524bebc561699

See more details on using hashes here.

File details

Details for the file online_behavioral_modeling-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for online_behavioral_modeling-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 830a8aee1a12678cb4e28f9d76697075c9c0cdf9634fb8b3f1b595255447b2dc
MD5 8038bfe78029afa75520e64f363c15ef
BLAKE2b-256 8d62eb0a1081eb2724dc735aecaa1d02b4b8f1baf782bd22ba019cd1b4b4bfae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page