Data and code for: Data-Driven Functional Classification and Explainable Predictive Modeling of Commercial MCC for Direct Compression
Description
This dataset contains the data and analysis code supporting the manuscript "Data-Driven Functional Classification and Explainable Predictive Modeling of Commercial Microcrystalline Cellulose (MCC) for Direct Compression". DATA FILES data.xlsx - Modelling dataset: 29 commercial MCC samples (sheet "ALL"). Columns: Sample ID; 11 physical parameters (rho_b, rho_ta, AR, CI, CFF, HR, Ie, %Pf, Span, %MC, %H); 11 functional (compression) parameters (k_sigma, kR-D, b, kUp, y0, a, kG, Py, f, kE2, kFES); and the two response variables TS (tablet tensile strength, MPa) and SF (solid fraction). sample_info.xlsx - Sample metadata for the same 29 samples in the same order: commercial product name (Model), grade (102/112/200/302/702/711/802), supplier (coded A-H), and the functional cluster label (1-4) used in the manuscript, followed by the same 22 parameters. CODE MATLAB scripts (R2016b or later, Statistics and Machine Learning Toolbox): parallel_coordinates.m: parallel-coordinates plots by grade, supplier and cluster; cluster x grade contingency analysis (Monte Carlo Fisher-Freeman-Halton test, adjusted Rand index). clustering_heatmap_andrews.m: clustered heatmaps and Andrews curves for the all/physical/functional parameter sets; colour-coded dendrogram. pca_clustering_validation.m: PCA of the three parameter sets; Ward clustering on functional parameters; validation by KMO, Bartlett's test, PERMANOVA (9999 permutations), silhouette, bootstrap Jaccard stability and Calinski-Harabasz index. model_screening.m: screening of four regressors (RF, SVR, GPR, XGBoost) over three parameter sets by repeated 5-fold cross-validation; Q2 distributions and RF learning curves. rf_modeling_matlab.m: random-forest modelling of TS and SF; stratified Monte Carlo cross-validation; per-cluster residual analysis; Y-randomization (permutation) test; predictor importance. Python scripts (see requirements.txt): alluvial_grade_cluster.py: alluvial diagram of commercial grade vs functional cluster. rf_modeling_python.py: Python implementation of the RF modelling and validation pipeline. shap_analysis.py: SHAP analysis of the RF models; global summary, dependence plots for the top-2 features, bootstrap threshold distributions (500 resamples) and multi-seed stability. scatter_selection_matrix.py: pairwise scatter matrix of functional parameters and predicted/observed TS-SF selection matrices with bootstrap prediction intervals. USAGE MATLAB scripts read sample_info.xlsx (metadata-dependent figures) or data.xlsx (modelling) from the working directory; parameter columns are located by column name or relative to the TS column, so the two files are not interchangeable. Python scripts write figures to ./Figures. All random procedures are seeded for full reproducibility. See README.md for the complete file-by-file description. Parameter definitions, experimental methods and the interpretation of all results are given in the associated manuscript.
Files
Steps to reproduce
1. Environment: MATLAB R2016b or later with the Statistics and Machine Learning Toolbox; Python 3.10 or later. Install Python dependencies with: pip install -r requirements.txt 2. Download all files into one working directory. Keep the original filenames: data.xlsx (modelling data, contains TS and SF) and sample_info.xlsx (sample metadata with Grade, Supplier and Cluster columns) are NOT interchangeable - metadata-dependent scripts (parallel_coordinates.m, alluvial_grade_cluster.py) read sample_info.xlsx, all other scripts read data.xlsx. Parameter columns are located by column name or relative to the TS column, so no path editing is required. 3. MATLAB: run the scripts in any order; each is self-contained. Suggested order: parallel_coordinates.m, clustering_heatmap_andrews.m, pca_clustering_validation.m, model_screening.m, rf_modeling_matlab.m. Figures (300 dpi PNG) are written to the working directory; statistical tables are printed to the console. 4. Python: run in any order; suggested order: alluvial_grade_cluster.py, rf_modeling_python.py, shap_analysis.py, scatter_selection_matrix.py. Figures are written to ./Figures. shap_analysis.py performs 500 bootstrap resamples and a 50-seed stability analysis and is the longest-running script (tens of minutes); rf_modeling_python.py runs 9999 permutations x 5 MC-CV repeats (also slow). 5. Reproducibility: all random procedures are seeded (rng(42) in MATLAB, random_state=42 in Python); repeated runs give identical results. Runtime of the remaining scripts is under a few minutes each.
Institutions
- Shanghai University of Traditional Chinese MedicineShanghai, Shanghai