Scaling

class hdnnpy.preprocess.scaling.Scaling(min_=-1.0, max_=1.0)[source]

Bases: hdnnpy.preprocess.preprocess_base.PreprocessBase

Scale all feature values into the certain range.

Parameters:
  • min_ (float) – Target minimum value of scaling.
  • max_ (float) – Target maximum value of scaling.
apply(dataset, elemental_composition, verbose=True)[source]

Apply the same pre-processing for each element to dataset.

It accepts 1 or 2 for length of dataset, each element of which is regarded as 0th-order, 1st-order, …

Parameters:
  • dataset (list [ndarray]) – Input dataset to be scaled.
  • elemental_composition (list [str]) – Element symbols corresponding to 1st dimension of dataset.
  • verbose (bool, optional) – Print log to stdout.
Returns:

Processed dataset into the same min-max range.

Return type:

list [ndarray]

dump_params()[source]

Dump its own parameters as str.

Returns:Formed parameters.
Return type:str
load(file_path, verbose=True)[source]

Load internal parameters for each element.

Only root MPI process loads parameters.

Parameters:
  • file_path (Path) – File path to load parameters.
  • verbose (bool, optional) – Print log to stdout.
save(file_path, verbose=True)[source]

Save internal parameters for each element.

Only root MPI process saves parameters.

Parameters:
  • file_path (Path) – File path to save parameters.
  • verbose (bool, optional) – Print log to stdout.
elements

List of elements whose parameters have already been initialized.

Type:list [str]
max

Initialized maximum values in each feature dimension and each element.

Type:dict [ndarray]
min

Initialized minimum values in each feature dimension and each element.

Type:dict [ndarray]
name = 'scaling'

Name of this class.

Type:str
target

Target min & max values of scaling.

Type:tuple [float, float]