Metadata-Version: 2.4
Name: trust-free
Version: 0.9.0
Summary: Transparent, Robust & Ultra-Sparse Trees (TRUST) - Free Version
Home-page: https://adc-trust-ai.github.io/trust/
Author: Albert Dorador Chalar
License: Proprietary - Permissive Binary Only
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: MacOS
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: numpy<2.0.0,>=1.26.4
Requires-Dist: scipy>=1.16.0
Requires-Dist: alibi>=0.9.6
Requires-Dist: category_encoders>=2.8.1
Requires-Dist: joblib>=1.4.2
Requires-Dist: matplotlib>=3.10.3
Requires-Dist: pandas>=2.3.1
Requires-Dist: pydot>=4.0.1
Requires-Dist: scikit_learn>=1.7.0
Requires-Dist: shap>=0.47.2
Requires-Dist: statsmodels>=0.14.4
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# trust

Transparent, Robust & Ultra-Sparse Trees (TRUST) - Free Version

This package provides the free version of our TRUST algorithm, a SOTA interpretable machine learning model.

## Installation

You can install this package using pip:

```bash
pip install trust
```

Note: This package includes a precompiled binary and is currently only compatible with macOS 11+ on ARM64 architecture.

## Usage

Here are two basic examples of how to use the TRUST algorithm:

```python
from trust import TRUST
import pandas as pd
from sklearn import datasets

Diabetes = pd.DataFrame(datasets.load_diabetes().data)
Diabetes.columns = datasets.load_diabetes().feature_names
diab_target = datasets.load_diabetes().target
Diabetes.insert(len(Diabetes.columns), "Disease_marker", diab_target)
Diabetes_X = Diabetes.iloc[:,:-1]
Diabetes_y = Diabetes.iloc[:,-1]
RLT_Diabetes = TRUST()
RLT_Diabetes.fit(Diabetes_X,Diabetes_y)
y_pred_TRUST = RLT_Diabetes.predict(Diabetes_X)

from sklearn.datasets import make_regression
from sklearn.model_selection import train_test_split
from sklearn.metrics import r2_score, mean_squared_error

# Generate synthetic regression data
X, y, coefs = make_regression(n_samples=5000, n_features=20, n_informative=10, coef=True, noise=0.1, random_state=123)
coefs
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=123)
# Instantiate and fit your model
model = TRUST()
model.fit(X_train, y_train)
# Predict and print results
y_pred = model.predict(X_test)
print("Predictions:", y_pred[:5])
print("True y values:", y_test[:5])
print("test R^2:", r2_score(y_test, y_pred))
model.explain(X_test[0,:], y_pred[0], actual=y_test[0]) 
model.varImp(X_test, y_test, model, corAnalysis=True)
```

## License

This software is provided under a Proprietary - Permissive Binary Only license. For detailed terms, please refer to the LICENSE file included with the distribution.

## More Information

For more details, documentation, and information about the full (paid) version of the TRUST algorithm, please visit our official website:

https://adc-trust-ai.github.io/trust/

Further details can be found in our preprint on arxiv:

https://www.arxiv.org/abs/2506.15791
