Introduction

This documentation provides detailed instructions on how to install, configure, and use TINTOlib—a Python library designed to transform tabular data into synthetic images, enabling the application of advanced vision-based machine learning models on traditional data sets.

Installation

To use TINTOlib, first install it using PyPi:

(.venv) $ pip install TINTOlib

For more details, visit: TINTOlib on PyPI <https://pypi.org/project/TINTOlib>

Importing Methods

TINTOlib offers a variety of state-of-the-art methods for constructing synthetic images from tabular data. To use these methods, import the required models as shown below:

>>> from TINTOlib.tinto import TINTO
>>> from TINTOlib.igtd import IGTD

All the methods requires the same input format and the responses outputs will have the same format.

Available Methods

Models

Class

Hyperparameters

TINTO

TINTO()

problem, normalize, verbose, pixels, algorithm, blur, submatrix, amplification, distance, steps, option, times, train_m, zoom, random_seed

IGTD

IGTD()

problem, normalize, verbose, scale, fea_dist_method, image_dist_method, error, max_step, val_step, switch_t, min_gain, zoom, random_seed

REFINED

REFINED()

problem, normalize, verbose, hcIterations, n_processors, zoom, random_seed

BarGraph

BarGraph()

problem, normalize, verbose, pixel_width, gap, zoom

DistanceMatrix

DistanceMatrix()

problem, normalize, verbose, zoom

Combination

Combination()

problem, normalize, verbose, zoom

SuperTML

SuperTML()

problem, normalize, verbose, pixels, feature_importance, font_size, random_seed

FeatureWrap

FeatureWrap()

problem, normalize, verbose, size, bins, zoom

BIE

BIE()

problem, normalize, verbose, precision, zoom

Input Format

TINTOlib supports two primary data input formats:

Pandas DataFrame

  • Use a Pandas DataFrame with the target variable in the last column and features in other columns, all in numerical format.

  • Follow the Tidy Data principles.

CSV Files

  • Format your CSV with commas as separators and the target variable in the last column.

  • Ensure the first row contains feature names and all data is numerical.

Example Usage:

model = TINTO()
model.fit_transform('path_to_csv_file', 'result_folder_path')

Generating Synthetic Images

To generate synthetic images, TINTOlib provides fit, transform, and fit_transform methods:

Fitting the Model: The fit method trains the model on the tabular data:

model.fit(data)

Generating Synthetic Images: After fitting, use transform to generate and save images:

model.transform(data, folder)

Combining Fit and Transform: The fit_transform method combines training and image generation:

model.fit_transform(data, folder)

Parameters for Methods: - data: A path to a CSV file or a Pandas DataFrame containing the features and targets. - folder: Path where the synthetic images will be saved.

Output Format

The output of the model.transform(data,folder)() and model.fit_transform(data,folder)() method are synthetic images grouped in folders depending on their class value.

For example:

If the dataset is composed of 3 different classes, the method will create 3 folders and each folder will contain one synthetic image for each instance with that class.

Example Generated Synthetic Images using TINTOlib

This section provides visual examples of synthetic images generated by different methods in TINTOlib.

TINTO Method

Synthetic image generated using the TINTO method with maximum blurring.

IGTD Method

Synthetic image produced by the IGTD method, showcasing feature organization based on similarity.

REFINED Method

Example of a synthetic image from the REFINED method, highlighting optimized feature placement.

BarGraph Method

Image created by the BarGraph method, visualizing data as a series of bars.

DistanceMatrix Method

DistanceMatrix method where distances represent feature relationships.

Combination Method

Combination method image, integrating features of the BarGraph and DistanceMatrix methods.

SuperTML Method

Synthetic image generated using the SuperTML-EF method, featuring uniform font size for all features.

FeatureWrap Method

FeatureWrap method image, encoding features as binary vectors transformed into pixel values.

BIE Method

BIE method image, depicting binary encoded floating-point representations as black and white pixels.