FactorizationMachine¶
- class FactorizationMachine¶
Bases:
objectFactorization Machine model implemented in pure NumPy.
Methods
Initializes the Factorization Machine model.
Computes the forward pass of the model.
Attributes
Returns the bias term of the model.
Returns the linear weights of the model.
Returns the number of factors in the model.
Returns the number of input features in the model.
Returns the quadratic weights of the model.
- __call__(x: ndarray) ndarray¶
Computes the forward pass of the model.
- Parameters:
x (np.ndarray) – The input array of shape (n_samples, n_features).
- Returns:
The output array of shape (n_samples,).
- Return type:
np.ndarray
- __init__(d: int, k: int, seed: int | SeedSequence | None = None) None¶
Initializes the Factorization Machine model.
- forward(x: ndarray) ndarray¶
Computes the forward pass of the model.
- Parameters:
x (np.ndarray) – The input array of shape (n_samples, n_features).
- Returns:
The output array of shape (n_samples,).
- Return type:
np.ndarray
- __dict__ = mappingproxy({'__module__': 'amplify_bbopt.trainer', '__doc__': 'Factorization Machine model implemented in pure NumPy.', '__init__': <function FactorizationMachine.__init__>, 'num_factors': <property object>, 'num_features': <property object>, 'quadratic': <property object>, 'linear': <property object>, 'bias': <property object>, 'forward': <function FactorizationMachine.forward>, '__call__': <function FactorizationMachine.forward>, '__dict__': <attribute '__dict__' of 'FactorizationMachine' objects>, '__weakref__': <attribute '__weakref__' of 'FactorizationMachine' objects>, '__annotations__': {}})¶
- __weakref__¶
list of weak references to the object (if defined)