Skip to main content

pyspace is a tool set of data science python functions

Project description

pyspace

requirements

sklearn
pandas
tensorflow
keras
# pytorch
# pytorch-pretrained-bert
# transformers

dataset wrapper

  • class import
from pyspace.wrapper.dataset_wrapper import dataset_container
# parameters with defaults
d1 = dataset_container(self, dataset, valid=True, test=True, valid_size=0.2, test_size=0.2, random_state=42)

# output object
d1.dfX # pandas dataframe of features
d1.y   # list of labels
  • parameters

    • dataset : list # [X, y] or [X]
    • valid # True, False, [X,y] or [X]
      • True : valid_size parameter will be used for valid subset from dataset
      • False : There will be no valid subset
      • [X,y] or [X] : valid subset will constructed from this input, no data from dataset parameter
    • valid_size : float between 0.0 and 1.0 # valid data ratio from dataset
    • test and test_size are similar to valid and valid_size
    • random_state : random state used in train_test_split
  • examples

    •   from pyspace.wrapper.dataset_wrapper import dataset_container
      
        # example 1
        X = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]
        y = [0,0,0,0,0,0,0,0,0, 0, 0, 0, 1, 1, 1, 1]
      
        d1 = dataset_container([X,y], valid_size = 0.3, test=False)
      
    •   d1.train.dfX.values[:,0].tolist() # [15, 1, 11, 13, 14, 2, 3, 9, 12, 10, 6]
        d1.train.y # [1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0]
      
    •   d1.valid.dfX.values[:,0].tolist() # [4, 5, 16, 8, 7]
        d1.valid.y # [0, 0, 1, 0, 0]
      
    •   d1.test # False
      

future work

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

pyspace_toolkit-1.0.2-py3-none-any.whl (88.6 kB view details)

Uploaded Python 3

File details

Details for the file pyspace_toolkit-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyspace_toolkit-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 88.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.4

File hashes

Hashes for pyspace_toolkit-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a78e93766df0630410f52e1f12a146b1785413249de5759804dcde81479037ab
MD5 e37880ae9b71ea94d2a539f4ab0cd2d7
BLAKE2b-256 7258555d87244e6e2f1793d6bfc2dbfad57df6fa1069388a5ac726a44c46bcaa

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