Skip to main content

A tool to convert tabular data into images, in order to be used by CNN. Inspired by the 'DeepInsight' paper.

Project description

Tab2Img: from tabular data to images

A tool to convert tabular data into images for CNN. Inspired by the DeepInsight paper.

Installation

pip install tab2img

Background

In the paper "DeepInsight: A methodology to transform a non-image data to an image for convolution neural network architecture" the autors propose a method to convert tabular data into images, in order to utilize the power of convolutional neural network (CNN) for non-image structured data.

The Figure illustrates the main idea: given a training dataset equation with equation samples and equation features, we are required to find a function equation, where equation.

There are numerous ways to choose equation. In this implementation, the features are organized with respect to the correlation vector equation, where equation is the target vector. Given equation and equation as

the vector equation express the Pearson correlation coefficient*

where

At this point equation is sorted from the greatest to the smallest, generating the vector of indices

Eventually, the final tensor equation is

The function that maps equation to the right row and column equation of equation is


In this case, being equation a sample, the coefficient is implemented as

Example

from sklearn.datasets import fetch_covtype
from tab2img.converter import Tab2Img

dataset = fetch_covtype()

train = dataset.data
target = dataset.target

model = Tab2Img()
images = model.fit_transform(train, target)

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

tab2img-0.0.2.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

tab2img-0.0.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file tab2img-0.0.2.tar.gz.

File metadata

  • Download URL: tab2img-0.0.2.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for tab2img-0.0.2.tar.gz
Algorithm Hash digest
SHA256 606815115472422c3992d36e3d7a0b4793cc906d6b132c7f599f9d233ffb975b
MD5 149e1b136676d3e4eac2ed10f2ebe7a4
BLAKE2b-256 893f8150f700470d490754cca8dab05f7962b2bb79eb40b94b192ceb76d4b455

See more details on using hashes here.

File details

Details for the file tab2img-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: tab2img-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for tab2img-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 916d3ea54fe0d3e088970dd86d306d6b49f5ae5e9b14e78d3f3f09e075de99a5
MD5 c1f60ed68bde49a1bf506c5fe3143004
BLAKE2b-256 3b17d0dec94d9c064842cfc0139a3c55821d8505ac59e1575c6dec9a890e85c1

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