DataFusionTools package#

Subpackages#

Submodules#

DataFusionTools.data_input module#

class datafusiontools._core.data_input.Data(location: datafusiontools._core.data_input.Geometry, independent_variable: typing.Optional[datafusiontools._core.data_input.Variable] = None, variables: typing.List[datafusiontools._core.data_input.Variable] = <property object>)[source]#

Bases: object

Class that contains values of one location

Parameters
  • location – The location the data

  • variables – Variables that are contain in the data

  • independent_variable – Independent variable that is connected to all the data

get_variable(name: str)[source]#

Function that returns variable based on its name

independent_variable: Optional[datafusiontools._core.data_input.Variable] = None#
location: datafusiontools._core.data_input.Geometry#
update_variable(name: str, value: numpy.ndarray)[source]#

Function that updates variable

property variables#
class datafusiontools._core.data_input.Geometry(x: float, y: float, z: Optional[float] = None, label: Optional[float] = None)[source]#

Bases: object

label: Optional[float] = None#
x: float#
y: float#
z: Optional[float] = None#
class datafusiontools._core.data_input.Variable(label: str, value: <built-in function array>)[source]#

Bases: object

label: str#
value: numpy.array#

datafusiontools._core.utils module#

class datafusiontools._core.utils.AggregateMethod(value)[source]#

Bases: enum.Enum

An enumeration.

MAX = 'max'#
MEAN = 'mean'#
MIN = 'min'#
SUM = 'sum'#
class datafusiontools._core.utils.CreateInputsML[source]#

Bases: object

Utils class that creates features and targets for machine learning class

add_features(input: datafusiontools._core.data_input.Data, variable_names: List[str], use_independent_variable: bool = True, use_location_as_input: Tuple[bool, bool, bool] = (False, False, False))[source]#

Method that creates features based on the inputs given.

add_location_to_features(name_dict, value, length, dictionary=None)[source]#
add_targets(input: datafusiontools._core.data_input.Data, variable_names: List[str])[source]#

Static method that creates features based on the inputs given.

aggregate_extracted_features(agrregate_method: datafusiontools._core.utils.AggregateMethod, aggregate_variable: str, closer_extracted_features: List[datafusiontools._core.data_input.Data])[source]#
append_features(input: datafusiontools._core.data_input.Data, variable_names: List[str], use_independent_variable: bool = True, use_location_as_input: Tuple[bool, bool, bool] = (False, False, False))[source]#

Function that appends features in private class properties.

Parameters
  • input – data class to be added as feature

  • variable_names – list of strings that represents the features that should be extracted from the dataclass

  • use_independent_variable – If true then the independent variable of the data class is used as a feature

  • use_location_as_input – If true the location attribute of the data class is used as a feature

find_closer_points(input_data: List[datafusiontools._core.data_input.Data], combined_data: List[datafusiontools._core.data_input.Data], aggregate_method: datafusiontools._core.utils.AggregateMethod, aggregate_variable: str, number_of_points: int = 1, interpolate_on_independent_variable: bool = False, bounds_error: bool = False, fill_value: Union[str, numpy.array, List] = 'extrapolate')[source]#

Function that finds the closest point and aggregates results and returns those aggregated results

get_all_features(flatten: bool)[source]#

Function that returns all features in a form of a numpy.array

Parameters

flatten – the returned array is flattened per feature

get_all_targets(flatten: bool)[source]#
get_feature_names()[source]#

All the names of features are returned.

get_features(features: dict, flatten: bool)[source]#

Function that returns features from dict

Parameters
  • features – a dictionary of features to be combined

  • flatten – the returned array is flattened per feature

get_features_test(flatten: bool)[source]#

Function that returns features that are used for testing in a form of a numpy.array

Parameters

flatten – the returned array is flattened per feature

get_features_train(flatten: bool)[source]#

Function that returns features that are used for training in a form of a numpy.array

Parameters

flatten – the returned array is flattened per feature

get_features_validation(flatten: bool)[source]#

Function that returns features that are used for validation in a form of a numpy.array

Parameters

flatten – the returned array is flattened per feature

get_k_closest_features(point_compare: datafusiontools._core.data_input.Geometry, combined_data: List[datafusiontools._core.data_input.Data], number_of_points: int)[source]#
get_targets(targets: dict, flatten: bool)[source]#
get_targets_test(flatten: bool)[source]#
get_targets_train(flatten: bool)[source]#
get_targets_validation(flatten: bool)[source]#
interpolate_on_independent_variable(closer_extracted_features: List[datafusiontools._core.data_input.Data], main_features: datafusiontools._core.data_input.Data, aggregate_method: datafusiontools._core.utils.AggregateMethod, aggregate_variable: str, bounds_error: bool = False, fill_value: Union[str, numpy.array, List] = 'extrapolate')[source]#
split_train_test_data(train_percentage=0.7, validation_percentage_on_test=0.5)[source]#

Method that splits training and testing data.

Parameters
  • train_percentage – Percentage of train samples

  • validation_percentage_on_test – Percentage of validation samples taken from test samples

Module contents#