preprocess_focusE_weights¶
- ampligraph.utils.preprocess_focusE_weights(data, weights, normalize=True)¶
Preprocessing of focusE weights.
Extract weights from data, remove NaNs, average weights and normalize them if
self.focusE_params['normalize_numeric_values']==True.- Parameters:
data (array-like, shape (n,m)) – Array of shape (n,m) with \(m=4\). If
weights=None, data contains triples and weights (\(m>3\)). Ifweightsis passed,dataonly contains triples (\(m=3\)).weights (array-like) – If not None,
weightshas shape (n, m-3), with m>0.normalize (bool) – Specify whether to normalize the weights into the [0,1] range (default: True).
- Returns:
processed_weights – An array of weights properly preprocessed and averaged into a unique vector if more than one vector of weights were given.
- Return type:
np.array, shape (n, 1)