dasf.transforms
Init module for all transformation structures.
Submodules
Classes
Class representing a MappedTransform based on Transform |
|
Class representing a Reduction based on Transform |
|
Class representing a Targetered Transform operation of the pipeline. |
|
Class representing a Fit operation of the pipeline. |
|
Class representing a Fit with Predict operation of the pipeline. |
|
Class representing a Fit with Transform operation of the pipeline. |
|
Class representing a Get Parameters operation of the pipeline. |
|
Class representing a Predict operation of the pipeline. |
|
Allow persisting a dask array to memory. It will gather the data blocks |
|
Allow persisting a dask array to memory and return a copy of the object. |
|
Get a slice of a cube. An inline slice is a section over the x-axis. |
|
Class representing a Transform operation of the pipeline. |
|
Class representing a Transform operation of the pipeline. |
|
Class representing a Transform operation of the pipeline. |
|
Class representing a Transform operation of the pipeline. |
|
Class representing a Transform operation of the pipeline. |
|
Extract data from Dataset object |
|
Normalize data object |
|
Class representing a Transform operation of the pipeline. |
Package Contents
- class dasf.transforms.MappedTransform(function, depth=None, boundary=None, trim=True, output_chunk=None, drop_axis=None, new_axis=None)[source]
Bases:
Transform
Class representing a MappedTransform based on Transform object.
This object refers to any operation that can be done in blocks. In special, for Dask chunks. There are several ways of doing that. This class tries to simplify how the functions are applied into a block.
Parameters
- functionCallable
A function that will be applied in a block.
- depthtuple
The value of the boundary elements per axis (the default is None).
- boundarystr
The type of the boundary. See Dask boundaries for more examples (the default is None).
- trimbool
Option to trim the data after an overlap (the default is True).
- output_chunktuple
New shape of the output after computing the function (the default is None).
- drop_axistuple
Which axis should be deleted after computing the function (the default is None).
- new_axistuple
Which axis represent a new axis after computing the function (the default is None).
- function
- depth
- boundary
- trim
- output_chunk
- drop_axis
- new_axis
- __lazy_transform_generic(X, xp, **kwargs)
- _transform_cpu(X, **kwargs)[source]
Respective immediate transform mocked function for local CPU(s).
- class dasf.transforms.ReductionTransform(output_size, func_aggregate, func_chunk, func_combine=None)[source]
Bases:
Transform
Class representing a Reduction based on Transform object.
This is a simple MapReduction operation using Dask.
Parameters
- output_sizetuple
The size of the new output.
- func_aggregateCallable
The function called to aggregate the result of each chunk.
- func_chunkCallable
The function applied in each chunk.
- func_combineCallable
The function to combine each reduction of aggregate (the default is None).
- output_size
- func_aggregate
- func_chunk
- func_combine
- _lazy_transform_cpu(X, *args, **kwargs)[source]
Respective lazy transform mocked function for CPUs.
- _lazy_transform_gpu(X, *args, **kwargs)[source]
Respective lazy transform mocked function for GPUs.
- _transform_cpu(X, *args, **kwargs)[source]
Respective immediate transform mocked function for local CPU(s).
- class dasf.transforms.TargeteredTransform(run_local=None, run_gpu=None)[source]
Bases:
Transform
Class representing a Targetered Transform operation of the pipeline.
This specific transform operates according the parameters of the constructor.
Parameters
- run_localbool
Define that the operator will run locally and not distributed.
- run_gpubool
Define if the operator will use GPU(s) or not.
Constructor of the class TargeteredTransform.
- _run_local
- _run_gpu
- class dasf.transforms.Fit[source]
Bases:
Operator
Class representing a Fit operation of the pipeline.
- abstract _fit_cpu(X, y=None, **kwargs)[source]
Respective immediate fit mocked function for local CPU(s).
- class dasf.transforms.FitPredict[source]
Bases:
Operator
Class representing a Fit with Predict operation of the pipeline.
- abstract _lazy_fit_predict_cpu(X, y=None, **kwargs)[source]
Respective lazy fit with predict mocked function for CPUs.
- abstract _lazy_fit_predict_gpu(X, y=None, **kwargs)[source]
Respective lazy fit with predict mocked function for GPUs.
- abstract _fit_predict_cpu(X, y=None, **kwargs)[source]
Respective immediate fit with predict mocked function for local CPU(s).
- class dasf.transforms.FitTransform[source]
Bases:
Operator
Class representing a Fit with Transform operation of the pipeline.
- abstract _lazy_fit_transform_cpu(X, y=None, **kwargs)[source]
Respective lazy fit with transform mocked function for CPUs.
- abstract _lazy_fit_transform_gpu(X, y=None, **kwargs)[source]
Respective lazy fit with transform mocked function for GPUs.
- abstract _fit_transform_cpu(X, y=None, **kwargs)[source]
Respective immediate fit with transform mocked function for local CPU(s).
- class dasf.transforms.GetParams[source]
Bases:
Operator
Class representing a Get Parameters operation of the pipeline.
- abstract _lazy_get_params_cpu(deep=True, **kwargs)[source]
Respective lazy get_params mocked function for CPUs.
- abstract _lazy_get_params_gpu(deep=True, **kwargs)[source]
Respective lazy get_params mocked function for GPUs.
- abstract _get_params_cpu(deep=True, **kwargs)[source]
Respective immediate get_params mocked function for local CPU(s).
- class dasf.transforms.Predict[source]
Bases:
Operator
Class representing a Predict operation of the pipeline.
- abstract _lazy_predict_cpu(X, sample_weight=None, **kwargs)[source]
Respective lazy predict mocked function for CPUs.
- abstract _lazy_predict_gpu(X, sample_weight=None, **kwargs)[source]
Respective lazy predict mocked function for GPUs.
- abstract _predict_cpu(X, sample_weight=None, **kwargs)[source]
Respective immediate predict mocked function for local CPU(s).
- class dasf.transforms.ComputeDaskData[source]
Bases:
dasf.transforms.base.Transform
Allow persisting a dask array to memory. It will gather the data blocks from all workers and resembles locally.
- __lazy_transform_generic(X)
- class dasf.transforms.PersistDaskData[source]
Bases:
dasf.transforms.base.Transform
Allow persisting a dask array to memory and return a copy of the object. It will gather the data blocks from all workers and resembles locally.
- __lazy_transform_generic(X)
- class dasf.transforms.Reshape(shape=None)[source]
Bases:
dasf.transforms.base.Fit
Get a slice of a cube. An inline slice is a section over the x-axis.
Parameters
- iline_indexint
The index of the inline to get.
- shape
- Parameters:
shape (tuple)
- class dasf.transforms.SliceArray(output_size)[source]
Bases:
dasf.transforms.base.Transform
Class representing a Transform operation of the pipeline.
- x
- class dasf.transforms.SliceArrayByPercent(x=100.0, y=100.0, z=100.0)[source]
Bases:
dasf.transforms.base.Transform
Class representing a Transform operation of the pipeline.
- x
- y
- z
- class dasf.transforms.ArraysToDataFrame[source]
Bases:
dasf.transforms.base.Transform
Class representing a Transform operation of the pipeline.
- class dasf.transforms.ArrayToHDF5(dataset_path, chunks=None, save=True, filename=None)[source]
Bases:
dasf.transforms.base.Transform
Class representing a Transform operation of the pipeline.
- dataset_path
- chunks
- save = True
- filename
- class dasf.transforms.ArrayToZarr(chunks=None, save=True, filename=None)[source]
Bases:
dasf.transforms.base.Transform
Class representing a Transform operation of the pipeline.
- chunks
- save = True
- filename
- class dasf.transforms.ExtractData[source]
Bases:
dasf.transforms.base.Transform
Extract data from Dataset object
- class dasf.transforms.Normalize[source]
Bases:
dasf.transforms.base.Transform
Normalize data object