Package: PsyML 2.4.2.9000

PsyML: Machine Learning Workflows for Supervised, Unsupervised, and Causal Analysis

Provides single-function pipelines for applied machine learning with tabular data, as commonly found in psychological, behavioral, and health research. The supervised pipeline, supervised_ml(), performs exploratory checks, preprocessing, training of several models with cross-validation, hyperparameter tuning, test-set evaluation, threshold optimization, calibration, fairness analysis, decision curve analysis, and model interpretation with permutation importance and Shapley values. The unsupervised pipeline, unsupervised_ml(), covers k-means, hierarchical, DBSCAN, Gaussian mixture, and latent class clustering with selection of the number of clusters, dimensionality reduction (PCA, t-SNE, UMAP), and anomaly detection (isolation forest, local outlier factor, Mahalanobis distance). The causal pipeline, causal_ml(), estimates treatment effects with propensity scores, meta-learners, double machine learning, causal forests, and targeted maximum likelihood estimation. Also includes learning-curve based sample size estimation, block and diversity-based data splitting, and export of results to text and JSON.

Authors:Jose Ventura-Leon [aut, cre]

PsyML_2.4.2.9000.tar.gz
PsyML_2.4.2.9000.zip(r-4.7-any)PsyML_2.4.2.9000.zip(r-4.6-any)PsyML_2.4.2.9000.zip(r-4.5-any)
PsyML_2.4.2.9000.tgz(r-4.6-any)PsyML_2.4.2.9000.tgz(r-4.5-any)
PsyML_2.4.2.9000.tar.gz(r-4.7-any)PsyML_2.4.2.9000.tar.gz(r-4.6-any)
PsyML_2.4.2.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
PsyML/json (API)

# Install 'PsyML' in R:
install.packages('PsyML', repos = c('https://jventural.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/jventural/psyml/issues

On CRAN:

Conda:

4.00 score 87 exports 106 dependencies

Last updated from:992d6b7852. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK221
source / vignettesOK296
linux-releaseOK229
macos-releaseOK151
macos-oldrelOK138
windows-develOK314
windows-releaseOK293
windows-oldrelOK311
wasm-releaseOK158

Exports:advanced_residual_analysisanalyze_dcaanalyze_fairnessanalyze_interactions_splinesapply_custom_featuresapply_thresholdauto_feature_engineeringblock_splitcalculate_shapcalibrate_probabilitiescausal_mlcluster_profilecompare_modelscorrect_fairness_thresholdcv_feature_selectiondefine_modelsdetect_data_leakagediversity_spliteda_basiceda_categoricaleda_categorical_basiceda_correlationeda_correlation_basiceda_leakageeda_missingeda_normalityeda_numericeda_numeric_basiceda_outlierseda_structureeda_summaryeda_target_classificationeda_target_regressioneda_vifestimate_nestimate_n_plateaueval_calibrationeval_confusioneval_metricseval_pred_vs_obseval_predictionseval_residualseval_rocevaluate_modelexplain_with_aiexport_verbose_jsonexport_verbose_txtfit_models_cvgenerate_all_plotsgenerate_report_from_jsongenerate_report_with_aiget_figures_catalogget_importanceinterpret_modellaunch_report_generatorlaunch_supervisedml_appml_sample_sizeoptimize_thresholdplot_allplot_calibration_curveplot_distributionplot_importanceplot_learning_curveplot_metrics_profileplot_residual_diagnosticsplot_shap_barplot_shap_dependenceplot_shap_summaryplot_threshold_optimizationplot_tuningprep_feature_selectionprep_recipeprep_splitprep_targetpreprocess_dataprint_figures_catalogresample_fairnessrun_nested_cvsave_all_plotssave_unsupervised_plotssetup_cvsupervised_mlsupervised_ml_capturesupervised_ml_exporttrain_modelstune_best_modelunsupervised_ml

Dependencies:base64encbslibcachemclasscliclockcodetoolscpp11data.tablediagramdialsDiceDesigndigestdplyrevaluatefarverfastmapfontawesomefsfurrrfuturefuture.applyGauProgenericsggplot2globalsgluegowergtablehardhathighrhtmltoolsipredisobandjquerylibjsonliteKernSmoothknitrlabelinglatticelavalbfgslifecyclelistenvlubridatemagrittrMASSMatrixmemoisemimemixoptmodelenvnnetnumDerivparallellyparsnippillarpkgconfigprettyunitspROCprodlimprogressrpurrrR6rangerrappdirsRColorBrewerRcppRcppArmadilloRcppEigenrecipesrlangrmarkdownrpartrsampleS7sassscalessfdshapeslidersparsevctrssplitfngrSQUAREMstringistringrsurvivaltailortibbletidyrtidyselecttimechangetimeDatetinytextunetzdbutf8vctrsviridisLitewarpwithrworkflowsxfunxgboostyamlyardstick

Sample Size Estimation for Machine Learning
Introduction | Quick Start | Core Concepts | The Learning Curve | Power-Law Model | Decision Criteria | Example 1: Basic Classification | Interpreting the Output | Key Output Components | Visualizing the Learning Curve | Example 2: Choosing the Number of Repetitions (R) | Example 3: Small Datasets (N < 1000) | Interpreting Multiple Partition Results | Example 4: Bootstrap Confidence Intervals | Example 5: Comparing Multiple Models | Example 6: Checking Fit Quality Before Extrapolation | Example 7: Extrapolation Functions | Estimating N for a Specific Target | Finding the Plateau | Example 8: Regression Tasks | Best Practices | 1. Start with Exploration | 2. Always Check Diagnostics | 3. Report Uncertainty | 4. Consider Hyperparameter Tuning | Troubleshooting | Curve Fit Fails | High Variability in n* | Target Seems Unachievable | Summary Table | References | Session Info

Last update: 2026-10-27
Started: 2026-10-27

Three Approaches: Supervised, Unsupervised, and Causal
1. Supervised learning: predicting a known outcome | 2. Unsupervised learning: finding groups without an outcome | 3. Causal inference: estimating the effect of a treatment | Tools shared by the three approaches

Last update: 2026-10-27
Started: 2026-10-27

Readme and manuals

Help Manual

Help pageTopics
Advanced Residual Analysisadvanced_residual_analysis
Clinical Utility Analysis (Decision Curve Analysis)analyze_dca
Fairness Analysis of a Classification Modelanalyze_fairness
Analyze Interactions and Nonlinear Effectsanalyze_interactions_splines
Domain Feature Engineeringapply_custom_features
Apply a Classification Thresholdapply_threshold
Automatic Feature Engineeringauto_feature_engineering
Block-Based Train/Test Split for Enhanced Generalizationblock_split
SHAP Values of a Fitted Workflowcalculate_shap
Calibrate Predicted Probabilitiescalibrate_probabilities
Automated Causal Inference Pipelinecausal_ml
Cluster Profilescluster_profile
Compare Cross-Validated Modelscompare_models
Fairness Correction with Group-Specific Thresholdscorrect_fairness_threshold
Feature Selection with Cross-Validationcv_feature_selection
Define Model Specificationsdefine_models
Detect Possible Data Leakage (Post-Model Checks)detect_data_leakage
Diversity-Based Train/Test Split for True Generalizationdiversity_split
Basic Exploratory Data Analysiseda_basic
Categorical Variable Analysiseda_categorical
Basic Categorical Variable Analysiseda_categorical_basic
Correlation Matrixeda_correlation
Basic Correlation Matrixeda_correlation_basic
Basic Data Leakage Checkeda_leakage
Missing Value Analysiseda_missing
Normality Test of the Targeteda_normality
Numeric Variable Analysiseda_numeric
Basic Numeric Variable Analysiseda_numeric_basic
Outlier Detectioneda_outliers
Data Structureeda_structure
Exploratory Data Analysiseda_summary
Target Distribution for Classificationeda_target_classification
Target Distribution for Regressioneda_target_regression
Variance Inflation Factor Analysiseda_vif
Estimate N for a Target Metric Using the Curve Fitestimate_n
Estimate N to Reach the Plateau (Near Maximum Performance)estimate_n_plateau
Calibration Analysis by Probability Binseval_calibration
Compute the Confusion Matrixeval_confusion
Compute Performance Metricseval_metrics
Compare Predicted and Observed Valueseval_pred_vs_obs
Generate Predictions on a Data Seteval_predictions
Residual Analysiseval_residuals
Compute the ROC Curveeval_roc
Evaluate the Final Model on the Test Setevaluate_model
Interpret Results of supervised_ml() with a Large Language Modelexplain_with_ai
Export the Results of an Analysis as a JSON Fileexport_verbose_json
Export the Console Output of an Analysis as a TXT Fileexport_verbose_txt
Fit Models with Cross-Validationfit_models_cv
Generate All Plots of a supervisedml Objectgenerate_all_plots
Generate a Report from an Exported JSON Filegenerate_report_from_json
Generate a Scientific Report with AIgenerate_report_with_ai
Get the Catalog of Figuresget_figures_catalog
Variable Importance of a Fitted Workflowget_importance
Model Interpretability Analysisinterpret_model
Launch the Shiny Report Generatorlaunch_report_generator
Launch the Integrated PsyML Shiny Applaunch_supervisedml_app
Sample Size Estimation for Machine Learning via Monte Carlo Simulationml_sample_size
Optimize the Classification Thresholdoptimize_threshold
Plot a Summary Panel of All Resultsplot_all plot_all.supervisedml
Plot All Graphs for Sample Size Resultsplot_all.ml_sample_size
Plot the Calibration Curveplot_calibration_curve
Plot the Metric Distribution by Sample Sizeplot_distribution
Plot Variable Importanceplot_importance
Plot the Learning Curve of a Sample Size Analysisplot_learning_curve
Plot the Profile of Performance Metricsplot_metrics_profile
Residual Diagnostic Plotsplot_residual_diagnostics
Plot SHAP Feature Importanceplot_shap_bar
Plot SHAP Dependence for One Variableplot_shap_dependence
Plot a SHAP Summary (Beeswarm)plot_shap_summary
Plot the Threshold Optimizationplot_threshold_optimization
Plot the Hyperparameter Tuning Resultsplot_tuning
Plot a causalml Objectplot.causalml
Plot a supervisedml Objectplot.supervisedml
Plot an unsupervisedml Objectplot.unsupervisedml
Predict Conditional Average Treatment Effects from a causalml Objectpredict.causalml
Predict with a supervisedml Modelpredict.supervisedml
Assign New Observations to Clusterspredict.unsupervisedml
Feature Selection with Borutaprep_feature_selection
Create the Preprocessing Recipeprep_recipe
Train/Test Splitprep_split
Prepare the Target Variableprep_target
Preprocessing Pipelinepreprocess_data
Print the Catalog of Figuresprint_figures_catalog
Print a Block-Based Splitprint.block_split
Print a causalml Objectprint.causalml
Print a Diversity-Based Splitprint.diversity_split
Print ML Sample Size Resultsprint.ml_sample_size
Print a supervisedml Objectprint.supervisedml
Print an unsupervisedml Objectprint.unsupervisedml
Fairness-Oriented Stratified Resamplingresample_fairness
Nested Cross-Validationrun_nested_cv
Save All Plots to PNG Filessave_all_plots
Save All Figures of an Unsupervised Analysissave_unsupervised_plots
Set Up Cross-Validation Foldssetup_cv
Summarize a causalml Objectsummary.causalml
Summarize a supervisedml Objectsummary.supervisedml
Summarize an unsupervisedml Objectsummary.unsupervisedml
Supervised Machine Learning for Classification and Regressionsupervised_ml
Run supervised_ml() and Capture Its Console Outputsupervised_ml_capture
Run and Export a Complete Analysissupervised_ml_export
Train and Compare Models with Cross-Validationtrain_models
Tune the Hyperparameters of the Best Modeltune_best_model
Automated Unsupervised Learning Pipelineunsupervised_ml