Install and configure PLATCOM, train compression models, process deployment data, validate decompression, and manage release files.
The package includes all scripts, configuration files, and setup utilities.
Note: The PLATCOM package is protected with basic authentication. If you would like to test PLATCOM, please email us at info@rinnoco.com to receive your access credentials.
PLATCOM analyzes PostgreSQL tables or CSV files, groups columns into clusters, and compares compression schemes by output size. Setup trains decision trees from cluster statistics and measured compression results. Deployment evaluates compression predictions alongside measured results and writes cluster files.
Built-in choices: GZIP, ZSTD, LZMA, BZIP2, and RAW (uncompressed cluster CSV). External compressors can be configured in platcom_config.txt.
Extract PLATCOM_[version].zip (for example, PLATCOM_v1.0.1.zip) and open the PLATCOM/ folder. The release package contains:
Six compiled executables:
setup — training pipelinedeployment — compression predictiondecompress — deployment decompressionvalidate_decompression — comparison with original dataclean_inputs — input CSV and setup output cleanupsubmit — submission packagingHelper scripts for dependency installation, data import, cleanup, and CSV preparation
External compressor tools. Included when the source tree has a plugins/ folder; enable and configure them in platcom_config.txt.
Installs dependencies; default cleanup also removes helper binaries. Use --no-clean to retain the packaged executables. Start PostgreSQL separately for database mode.
Downloads Envmon CSVs, configures database mode, and loads demo data. Its cleanup truncates every table in the target database's public schema.
Main runner for training, prediction, decompression, validation, submission, and cleanup
Updates to newer version (creates backup first)
Shared database connection, data source mode, CSV directory, table selection, and external compressor settings
Training settings, including clustering, aggregation, sampling, and full-table compression results
Prediction settings, including clustering, aggregation, sampling, cluster count, and decision tree selection
PostgreSQL container configuration
Database schema (tables structure)
Setup and deployment load shared settings from platcom_config.txt, then apply their respective configuration file. Program-specific values override shared values with the same key.
Documentation for CSV file mode (no database required)
Current version information
Created by the Envmon demo installer, or supplied by you for CSV input. The release archive does not include the dataset; csv_directory can point to another location.
Tracks installation progress (allows resuming if interrupted)
Installer and runtime logs, respectively
apt-getBuilding from source requires a C++17 compiler, CMake 3.22 or newer, pkg-config, and the libraries below. Packaged binaries need compatible runtime libraries and CPU architecture. Package names below follow the Ubuntu/Debian installer; availability depends on the distribution.
| Dependency | Ubuntu/Debian package |
|---|---|
| Build tools | build-essential, cmake (3.22+), pkg-config |
| OpenMP | Compiler OpenMP support and its runtime library |
| ZLIB | zlib1g-dev |
| BZip2 | libbz2-dev |
| LZMA | liblzma-dev |
| libzip | libzip-dev |
| Zstandard | libzstd-dev |
| PostgreSQL client library | libpq-dev, postgresql-client |
| Boost | libboost-all-dev |
| Armadillo | libarmadillo-dev |
| mlpack | libmlpack-dev |
| Eigen (installed by the dependency helper) | libeigen3-dev |
The scripts also use curl, jq, pv, wget, unzip, tar, and standard shell utilities. Submission token generation uses openssl; the submission archive uses tar with gzip. The dependency helper installs the gzip, zstd, xz-utils, and bzip2 command-line tools.
Install dependencies while retaining the release binaries:
bash install_project.sh --no-clean
The installer does not explicitly install every build prerequisite listed above. Review installation output and install any missing development packages before configuring a source build.
From the extracted PLATCOM/ folder, install dependencies and retain all six packaged binaries:
bash install_project.sh --no-clean
Edit platcom_config.txt, setup_config.txt, and deployment_config.txt for your data. For CSV input, supply the files and set file_mode=true and csv_directory. For database input, use file_mode=false and configure the connection and existing tables.
For database mode, start PostgreSQL before setup:
docker compose up -d
Alternatively, the Envmon demo installer downloads eight CSVs, installs requirements with --no-clean, configures database mode, and starts PostgreSQL. It imports the schema and truncates every table in the target database's public schema with identity reset and cascade before importing data. Use a database reserved for the demo:
bash install_demo.sh
Analyzes your data and trains ML models
bash run_platcom.sh --setup
Output: output_[version]/output/
Report: results_[version]/setup_report.txt
Processes deployment data, compares compression schemes, and evaluates trained models
bash run_platcom.sh --deploy
Output: output_[version]/output_deployment/
Report: results_[version]/deploy_report.txt
results_[version]/ in database mode or results_[version]_file/ in file mode. File mode also uses output_[version]_file/ for training and deployment output. Here [version] includes the v prefix from VERSION.txt.
After running setup and deployment, these folders are created. The paths below show database mode; file mode adds _file to the output_[version] and results_[version] folder names.
output_[version]/ | +-- output/ ← Created by --setup | +-- tables_statistics.csv Column stats from configured tables and sampled rows | +-- best_results.csv Best compression per table | +-- decision_trees/ Trained ML models | +-- best_decision_trees/ Selected aggregation models | +-- compressors_used.txt Scheme-to-label mapping used by setup | +-- cluster_signatures.csv Cluster membership, statistics, and measured scheme | +-- [table_name]/ Per-table analysis files | +-- output_deployment/ ← Created by --deploy | +-- deployment_labels/ | | +-- [table_name]/ | | +-- labels Measured best scheme labels (comma-separated, one per cluster) | +-- deployment_aggregated_stats/ | +-- [table_name]/[criterion]/[K]/ Cluster CSVs, compressed files, and columns_manifest.csv results_[version]/ ← Human-readable reports +-- setup_report.txt Training summary & statistics +-- deploy_report.txt Prediction results & recommendations +-- compression_method_comparison.csv Per-table comparison of compression methods +-- method_comparison_report.txt Comparison summary +-- debug_setup.log, debug_deploy.log Native pipeline diagnostics
--decompress writes decompressed_columns_[version]/[table_name]/new_column_cluster_[id].csv. Both modes share this decompression folder, and each runner decompression call replaces it. --submit writes under submit_output_db/[token]/ or submit_output_file/[token]/.
manage.log, native debug logs, and cluster manifests to check the underlying results. See Understanding Results for the distinction between measured labels and model predictions.
| Feature | Database Mode | File Mode |
|---|---|---|
| Data Source | PostgreSQL database | [table_name].csv files in the configured csv_directory (default data/) |
| Docker Usage | The runner checks or starts PostgreSQL in Docker; native binaries can connect directly to PostgreSQL | No |
| Primary/Foreign Keys | Detected from schema | Not available |
| Best For | Data already in PostgreSQL, with schema metadata | CSV exports and runs without a database |
| Install Command | bash install_project.sh --no-clean |
bash install_project.sh --no-clean --file-mode |
| Run Command | bash run_platcom.sh --setup --db-mode |
bash run_platcom.sh --setup --file-mode |
The runner uses file_mode in platcom_config.txt by default (database mode if unset). Place --file-mode or --db-mode after the action to override it.
The installer sets file_mode=true when --file-mode is given. Running it without that flag leaves the existing mode setting unchanged.
FILE_MODE.md for details.
Use this installer for the project environment. It does not download or import the demo dataset, and it does not start PostgreSQL.
| Command | Description |
|---|---|
bash install_project.sh |
Install dependencies and clean previous artifacts, including helper binaries in bins/ |
bash install_project.sh --file-mode |
Install dependencies and set file_mode=true; default cleanup still runs. Alias: -f. |
bash install_project.sh --no-clean |
Skip cleanup and retain all packaged binaries |
bash install_project.sh --help |
Show all options. Alias: -h. |
The installer records completed steps in .setup_state and skips them on later runs. It installs dependencies; it does not rebuild or restore removed PLATCOM executables. If helper binaries were removed, restore them from the release archive or rebuild and package from source.
| Command | Description |
|---|---|
bash install_demo.sh |
Download missing or empty Envmon CSV files, update platcom_config.txt for database mode, install requirements with --no-clean, start PostgreSQL, import envmon.sql, prepare CSVs, truncate all tables in the public schema with identity reset and cascade, and import demo data |
The demo uses POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_HOST, and POSTGRES_PORT environment variables when set. It maps POSTGRES_PORT to Compose's DB_PORT. The normal Compose file uses DB_PORT for the host port and runs postgres:15. Match the shared connection settings to the database credentials and port; environment variables are not automatically substituted into the C++ configuration files.
The demo's schema file assigns ownership to the postgres role, and its truncation helper changes session_replication_role. A custom database user needs the roles and privileges required by those statements. The PostgreSQL image's initialization variables apply to an empty data directory; editing them does not change users or passwords already stored in an existing volume. See the official PostgreSQL image documentation.
Usage: bash run_platcom.sh <action> [flags]. Choose one action per call and place its flags after the action.
| Command | Description |
|---|---|
bash run_platcom.sh --setup |
Train models (required first) |
bash run_platcom.sh --deploy |
Process deployment data, test compression schemes, and evaluate model predictions; requires setup artifacts for the same version and mode |
bash run_platcom.sh --decompress |
Decompress deployment output into decompressed_columns_[version]/, replacing its previous contents. This folder is shared by both modes. |
bash run_platcom.sh --validate |
Validate original input against deployment cluster CSVs and deployment cluster CSVs against decompressed files; requires deployment output, decompressed files, and the original data |
bash run_platcom.sh --decompress-validate |
Decompress and then validate |
bash run_platcom.sh --submit |
Package submission metadata, models, labels, and clustering artifacts locally; requires deployment output |
Maintenance actions accept no mode or token flags. Setup/deployment cleanup spans versioned outputs in both modes; --clean-inputs targets only the current version's setup folders.
| Command | Description |
|---|---|
bash run_platcom.sh --clean-deployment |
Remove deployment artifacts (keeps setup, data, and results) |
bash run_platcom.sh --clean-setup |
Remove setup and deployment outputs in both modes (keeps data and results) |
bash run_platcom.sh --clean-project |
Remove setup/deployment outputs, temporary files, and setup/management logs (keeps data, results, decompressed files, and submission output) |
bash run_platcom.sh --reset-project |
Remove data/, temp_data/, results_*, output_*, .setup_state, root *.log files, and Docker Compose volumes; asks for confirmation. Keeps configs, binaries, decompressed files, and submission output. |
bash run_platcom.sh --reinstall |
Clean, reinstall dependencies, and run setup (keeps data and results). Cleanup removes helper binaries; the installer does not restore them. |
bash run_platcom.sh --clean-inputs |
Remove .csv files directly in data/ and current-version setup output folders in both modes (keeps output_deployment). Runs without a confirmation prompt. |
Binary cleanup: --clean-deployment, --clean-setup, and --clean-project also remove entries in bins/ except setup, deployment, and *.sh scripts. This includes the decompress, validate_decompression, clean_inputs, and submit binaries if present.
| Flag | Description |
|---|---|
--file-mode, -f |
Read from CSV files |
--db-mode, -d |
Read from PostgreSQL |
--token <value> |
Set the submission token (--submit only; generated if omitted) |
Choose at most one data source mode. Mode flags are supported by --setup, --deploy, --decompress, --validate, --decompress-validate, and --submit. Without an override, the runner uses file_mode in platcom_config.txt (database mode if unset).
Submission output goes to submit_output_file/<token>/ or submit_output_db/<token>/, depending on the selected mode.
Submission creates a local bundle with available models, label mappings, centroids, manifests, metadata, and logs. It attempts to create platcom_submit_<token>.tar.gz inside that folder; check the output for archive warnings. It does not upload the bundle.
The current submission helper takes models from best_decision_trees/ and looks for centroids under ALL_FEATURES. Review its missing-file warnings, particularly when using another clustering criterion.
| Command | Description |
|---|---|
bash run_platcom.sh --help or bash run_platcom.sh -h |
Show all actions and flags (also shown when no arguments are given) |
bash run_platcom.sh --setup --file-mode
bash run_platcom.sh --deploy --db-mode
bash run_platcom.sh --decompress-validate --file-mode
bash run_platcom.sh --submit --file-mode --token my_submission
bash run_platcom.sh --clean-deployment
Run the updater from the extracted installation folder. It downloads the protected latest release, checks ZIP integrity, and replaces installation files:
bash update_platcom.sh
backup_YYYYMMDD_HHMM/backup.tar. The backup excludes data, output*, results*, existing backup_* entries, and ZIP files.
data, output*, results*, backup_*, and ZIP entries are retained. Other installation entries are removed before the new release files are copied.
platcom_config.txt, setup_config.txt, and deployment_config.txt. Recover your settings from the backup and review them before running the new version.
VERSION.txt. Run setup for the new version and selected mode before deploying. Data stored outside the retained root data/ folder needs its own backup plan.
Choose the actual timestamped archive and restore it from the installation folder:
# List backups
ls -l backup_*/backup.tar
# Inspect the selected archive
tar -tf backup_YYYYMMDD_HHMM/backup.tar
# Restore archived installation files over the current installation
tar -xf backup_YYYYMMDD_HHMM/backup.tar -C .
Replace YYYYMMDD_HHMM with the selected backup timestamp. This overwrites matching files and restores archived settings; it does not remove files introduced by the newer release. The backup does not contain the excluded data, output, or results folders.
Run this first. It analyzes your data and builds ML models.
Output: output_[version]/output/
Report: results_[version]/setup_report.txt
Runtime: Depends on row count, column count, sampling, clustering criteria, compressors, and hardware; the project does not establish a fixed range.
Run after setup for the same version and data mode. Keep clustering criteria and aggregation choices compatible with the saved models and centroids.
cluster_amountmanage.logOutput: output_[version]/output_deployment/
Report: results_[version]/deploy_report.txt
With sampling enabled, deployment rewrites the selected cluster files using all input rows allowed by limit, compressing them with the schemes selected from the sample.
The output and report paths above show database mode; file mode adds _file to the versioned output and results folder names. The current implementation looks up model files by table name, so an arbitrary new table name needs matching training artifacts.
Built-in compression labels are fixed at 0–4. Each label applies to a cluster of columns, which can contain one or several columns:
| Label | Scheme | Meaning |
|---|---|---|
| 0 | GZIP | GZIP-compressed cluster file |
| 1 | ZSTD | Zstandard-compressed cluster file |
| 2 | LZMA | LZMA-compressed cluster file |
| 3 | BZIP2 | BZip2-compressed cluster file (internal scheme name: bzip) |
| 4 | RAW | Uncompressed cluster CSV |
External compressors receive labels 5, 6, and onward in external_compressors list order. Setup records the mapping in output_[version]/output/compressors_used.txt (or the file-mode equivalent). Deployment checks that the configured compressor mapping matches setup.
output_deployment/deployment_labels/[table_name]/labels contains one comma-separated measured best scheme label per cluster. The code uses these as expected labels for model evaluation and for decompression and submission. Decision-tree predictions are printed in manage.log; they are not written into that labels file.
Read columns_manifest.csv in the selected cluster folder to map cluster IDs to zero-based input column indices. Some generated reports call these labels columns or predictions; use the manifest and runtime log to distinguish cluster labels from model predictions.
Setup's model-selection accuracy is measured on its training data. Deployment accuracy compares printed model predictions with the measured cluster labels for the deployment data; neither value alone establishes accuracy on independent future data.
--validate checks both original-input-to-deployment and deployment-to-decompressed values. It compares the pipeline's serialized representation, including numeric formatting and time conversion; decompression produces cluster CSVs rather than recreating the original input file byte for byte.
These examples show valid settings, rather than a promise of the values in every release. Edit the three files in the installation root. Setup and deployment first read platcom_config.txt, then merge their own settings over it.
# Database connection: match your PostgreSQL instance
dbname=postgres
user=postgres
password=replace_with_your_database_password
hostaddr=127.0.0.1
port=5432
options=
schema=public
# Input row pool for setup and deployment; empty means all rows
limit=LIMIT 5000
# Tables to analyze (comma-separated; no spaces)
table_names=measurements_basic,measurements_dust,battery
# File mode (set to true for CSV mode)
file_mode=false
csv_directory=data/
# Optional comma-separated external compressor names
external_compressors=
In file mode, each table name maps to csv_directory + table_name + ".csv". Include a trailing slash in csv_directory. Relative paths resolve from the project root. CSVs need a header row and consistent column order.
The runner takes its default mode from the shared file_mode setting and passes that mode explicitly to each binary. Command-line mode flags override it. Keep connection and data-source settings in the shared file unless you intentionally need a program-specific override.
cluster_mode=ALL_FEATURES
aggregation_model=average
sampling_method=uniform
sample_size=7%
sampling_seed=0
strata_column=
num_strata=5
full_table_results=false
cluster_mode=ALL_FEATURES
aggregation_model=average
cluster_amount=4
decision_trees_group=BEST
sampling_method=uniform
sample_size=7%
sampling_seed=0
strata_column=
num_strata=5
| Setting | Behavior |
|---|---|
cluster_mode | ALL_FEATURES clusters column statistics, ENTROPY uses column entropy, and DATA uses the read data matrix. Setup runs all three for an empty or unrecognized value; deployment should select one criterion generated by setup. |
aggregation_model | sum, average, min, or max aggregates column statistics into cluster signatures. ALL (also an empty or unrecognized value) uses all four. Deployment needs the matching saved models. |
cluster_amount | Deployment fallback cluster count when setup's best_results.csv has no entry for the table; an existing setup entry takes precedence. Later model evaluation still needs matching training artifacts. |
decision_trees_group | Deployment accepts ALL for decision_trees/ or BEST for best_decision_trees/; other values cause an error. |
| Setting | Behavior |
|---|---|
sampling_method | first, uniform, stratified, hash_distinct, or extremes. Empty defaults to first; unknown methods cause an error. |
sample_size | Row count (1000), fraction (0.25), or percentage (25%) of the rows allowed by limit. Empty or 0 disables sampling. Fractions and percentages must be greater than zero and at most 100%. |
sampling_seed | Nonnegative integer for repeatable sampling; empty defaults to 0. random draws and prints a seed once per process run. |
strata_column, num_strata | For enabled stratified sampling, name a numeric/date/time column and use a positive number of equal-width bins. Empty num_strata defaults to 5. |
full_table_results | Setup only. With sampling enabled, true also measures all rows allowed by limit for whole-table, selected-cluster, and per-column comparisons. The clustering choices remain based on the sample. Empty defaults to false. |
hash_distinct can return fewer rows than requested because it removes duplicate rows. extremes needs a sample large enough to retain every distinct row containing a column minimum or maximum. With DATA clustering, the saved centroid feature count also depends on the sampled row count; a different deployment sample shape can trigger the K-means fallback.
List enabled compressor names in external_compressors and provide <name>.compress and <name>.decompress command templates in platcom_config.txt. Each template must contain {input} and {output}. Names use lowercase letters, digits, and underscores and must be unique. Executables are searched in plugins/ before the normal PATH. Keep the list and its order consistent between setup, deployment, and decompression.
limit=LIMIT 5000 limits the input pool in both setup and deployment; it also limits the rows compressed and validated. Leave limit= empty for all rows. Sampling selects from that pool. Keep the original data, connection, and deployment limit unchanged when validating an existing deployment.
# Check Docker is running
docker ps
docker compose ps
docker compose logs db
Start Docker Desktop when using its WSL integration, or start the Docker service using your Linux installation's service manager. Confirm the configured database host, credentials, and port. The runner waits up to 30 seconds for PostgreSQL readiness; the demo installer waits up to 120 seconds. For a custom Compose host port, set DB_PORT consistently with the shared connection's port.
Inspect the input and results_[version]/debug_setup.log (or its file-mode equivalent) for non-finite values or empty statistics. This message alone does not establish the cause. Correct the input or configuration before rerunning setup; clearing outputs alone does not fix invalid values.
The decision-tree feature matrix and label count differ. Check that statistics, manifests, compression results, and model settings belong to the same dataset, version, and mode. Inspect the debug log before regenerating training output with bash run_platcom.sh --setup.
Default installer cleanup and several maintenance commands remove helper executables. Restore the missing executable from the release archive, or rebuild and package from source. Use bash install_project.sh --no-clean when installing dependencies while retaining the packaged binaries. Reinstalling dependencies does not recreate a missing executable.
Use the same version and data mode as training. Check the table names, clustering criterion, aggregation choice, and saved models. If the configured external compressor list or its label order changed, rerun setup with the intended configuration before deployment. Restore the configuration files after an update before deciding which artifacts can be reused.
Decompression discovers cluster CSV files and their column mappings. Preserve columns_manifest.csv alongside the cluster files. The current file finder recognizes [table]_cluster_[id].csv (and the older column-index filename format); whole-table [table]_full.csv files are not recognized as cluster mappings. Inspect the deployment's selected clustering layout when this error occurs.
Check permissions on both shell scripts and the requested executable:
chmod +x *.sh scripts/*.sh
chmod +x bins/setup bins/deployment bins/decompress \
bins/validate_decompression bins/clean_inputs bins/submit
If a binary reports a missing shared library, inspect it with ldd bins/setup (or the affected executable) and install the corresponding runtime library. Review dependency installation output; some installer steps continue after a failed package command.
From the project root, python3 scripts/fix_csvs.py modifies CSV files recursively under data/: it removes a UTF-8 BOM, normalizes line endings, converts decoded text to UTF-8, and removes embedded newlines when rewriting multiline fields. It does not validate arbitrary data against the database schema.
[table_name].csv and include a trailing slash in csv_directoryThe demo import script uses a simple comma-based transformation when stripping a leading # column. Files that also contain quoted commas need a CSV-aware preparation step before that transformation.