Skip to main content

Interpretable and reliable multivariate random forest for simultaneous classification and regression

Project description

MORGOTH

This is the implementation of our novel random forest (RF)-based approach for Multivariate classificatiOn and Regression increasinG trustwOrTHiness (MORGOTH). A detailed description and application of the model can be found in our pre-print `Increasing trustworthiness of machine learning-based drug sensitivity prediction with a multivariate random forest approach'. MORGOTH can be used to simultaneously perform classification and regression using a novel objective function during the training, which is a linear combination of classification and regression error. Moreover, it offers the possibility to perform conformal prediction (CP), which can be used to obtain reliable classification and regression results. A more detailed explanation of CP and the framework we use can be found in our article 'Reliable anti-cancer drug sensitivity prediction and prioritization'. Additionally, MORGOTH provides a graph representation of the random forest to address model interpretability, and a cluster analysis of the leaves to measure the dissimilarity of new inputs from the training data to account for its reliability.

For issues and questions, please contact Lisa-Marie Rolli (lisa-marie.rolli[at]uni-saarland.de) or Kerstin Lenhof (research[at]klenhof.de).

Installation

You can install our morgoth package using pip:

pip install morgoth

used python3 libraries: fireducks pandas numpy typing math bisect operator copy sklearn time scipy collections multiprocessing functools re

Usage

An exemplary use is running our provided main as a module, which you can call after downloading the Example_Data folder from our GitHub.

python3 -m morgoth Example_Data/example_Json_config.json

Note that the directory tree should be kept and the path to the output folder should be edited in the file Example_Data/example_JSON_config.json. The prediction results for classification will be found in <output_dir><analysis_name>_ClassificationResultsFile1.txt and the regression results are stored in <output_dir><analysis_name>_<1-error_rate>_RegressionResultsFile1.txt. If if the field swap_test_calibration in the config file is set to 'True' there will be one additional file per task, respectively, where the '1' in the file name is replaced by a '2'. If a distance measure is given in the config, <output_dir><analysis_name>_SilhouetteScoresTrainSamples_<distance>.txt and <output_dir><analysis_name>_SilhouetteScoresTestSamples_<distance>.txt will contain the silhouette scores for the training and test samples, respectively. If draw_graph is set to True, the files <output_dir>/<analysis_name>_<sample_name>.dot contain the sample specific graphs and <output_dir><analysis_name>__graph_whole_forest.dot and <output_dir><analysis_name>__graph_average_whole_forest.dot contain the graph for the whole test set with either the raw count across all samples as edge weight or averaged by the number of test samples, respectively.

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

morgoth-1.4.1.tar.gz (31.5 kB view details)

Uploaded Source

Built Distribution

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

morgoth-1.4.1-py3-none-any.whl (32.2 kB view details)

Uploaded Python 3

File details

Details for the file morgoth-1.4.1.tar.gz.

File metadata

  • Download URL: morgoth-1.4.1.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for morgoth-1.4.1.tar.gz
Algorithm Hash digest
SHA256 a4fcd2dab5cf70e622811614ec047a1fb5e927aba6b5d8bfc2b0c3911129ea5d
MD5 02df2520b845c2c053e63e372424cd06
BLAKE2b-256 c32d53c2ac8c080386b91c44227ea82aecb2ce3d7672e16e9bcd6db53bccc15b

See more details on using hashes here.

File details

Details for the file morgoth-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: morgoth-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 32.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for morgoth-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 786e0ee51de4e335516b3bc8ea1bb4e58570ed3f3d2a66838726c1b28bfa9ef6
MD5 a3e4a9cbb9b1c946634375300c78d481
BLAKE2b-256 aa3689cba7deb29d6c3a5f7308bf0a2ddce5704c9a7e380b8e1884e83a34ea60

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