@@ -573,13 +573,13 @@ Classes
573573
574574 Attributes
575575 ----------
576- coef \_ : ndarray of shape (n_features,)
576+ coef _ : ndarray of shape (n_features,)
577577 Coefficients excluding the intercept.
578578
579- intercept \_ : float
579+ intercept _ : float
580580 Intercept term. 0.0 if ``fit_intercept=False ``.
581581
582- classes \_ : ndarray of shape (2,)
582+ classes _ : ndarray of shape (2,)
583583 Unique class labels in the original label space.
584584
585585 _label_encoder : LabelEncoder
@@ -692,7 +692,7 @@ Classes
692692 - ``{'name': 'nonnegative'} `` or ``{'name': '>=0'} ``
693693 - ``{'name': 'fair', 'sen_idx': list[int], 'tol_sen': list[float]} ``
694694 - ``{'name': 'custom', 'A': ndarray[K, d], 'b': ndarray[K]} ``
695-
695+
696696 Note: when ``fit_intercept=True ``, a constant column is appended **as the last column **;
697697 since you index sensitive columns by ``sen_idx `` on the *original * features, indices stay valid.
698698 C : float, default=1.0
@@ -722,11 +722,11 @@ Classes
722722
723723 Attributes
724724 ----------
725- coef \_ : ndarray of shape (n_features,)
725+ coef _ : ndarray of shape (n_features,)
726726 Learned linear coefficients (excluding the intercept term).
727- intercept \_ : float
727+ intercept _ : float
728728 Intercept term extracted from the last coefficient when ``fit_intercept=True ``, otherwise 0.0.
729- n_features_in \_ : int
729+ n_features_in _ : int
730730 Number of input features seen during :meth: `fit ` (before intercept augmentation).
731731
732732 Notes
@@ -748,7 +748,7 @@ Classes
748748 * - :py:obj: `fit <rehline.plq_Ridge_Regressor.fit> `\ (X, y, sample_weight)
749749 - If ``fit_intercept=True ``, a constant column (value = ``intercept_scaling ``) is appended
750750 * - :py:obj: `decision_function <rehline.plq_Ridge_Regressor.decision_function> `\ (X)
751- - Compute f(X) = X @ coef \_ + intercept \_ .
751+ - Compute f(X) = X @ coef _ + intercept _ .
752752 * - :py:obj: `predict <rehline.plq_Ridge_Regressor.predict> `\ (X)
753753 - Predict targets as the linear decision function.
754754
@@ -782,7 +782,7 @@ Classes
782782
783783 .. py :method :: decision_function(X)
784784
785- Compute f(X) = X @ coef \_ + intercept \_ .
785+ Compute f(X) = X @ coef _ + intercept _ .
786786
787787 Parameters
788788 ----------
@@ -798,6 +798,7 @@ Classes
798798 .. py :method :: predict(X)
799799
800800 Predict targets as the linear decision function.
801+
801802 Parameters
802803 ----------
803804 X : ndarray of shape (n_samples, n_features)
@@ -811,17 +812,17 @@ Classes
811812
812813
813814
814- .. py :class :: plqMF_Ridge(n_users, n_items, loss, constraint = [], biased = True , rank = 10 , C = 1.0 , rho = 0.5 , init_mean = 0.0 , init_sd = 0.1 , random_state = None , max_iter = 10000 , tol = 0.0001 , shrink = 1 , trace_freq = 100 , max_iter_CD = 10 , tol_CD = 0.0001 , verbose = 0 )
815+ .. py :class :: plqMF_Ridge(n_users, n_items, loss, biased = True , constraint_user = [], constraint_item = [] , rank = 10 , C = 1.0 , rho = 0.5 , init_mean = 0.0 , init_sd = 0.1 , random_state = None , max_iter = 10000 , tol = 0.0001 , shrink = 1 , trace_freq = 100 , max_iter_CD = 10 , tol_CD = 0.0001 , verbose = 0 )
815816
816817 Bases: :py:obj: `rehline._base._BaseReHLine `, :py:obj: `sklearn.base.BaseEstimator `
817818
818819 Matrix Factorization (MF) with a piecewise linear-quadratic objective and ridge penalty.
819820
820821 .. math ::
821822 \min _{\substack {
822- \mathbf {P} \in \mathbb {R}^{n \times r }\
823+ \mathbf {P} \in \mathbb {R}^{n \times k }\
823824 \pmb {\alpha } \in \mathbb {R}^n \\
824- \mathbf {Q} \in \mathbb {R}^{m \times r }\
825+ \mathbf {Q} \in \mathbb {R}^{m \times k }\
825826 \pmb {\beta } \in \mathbb {R}^m
826827 }}
827828 \left [
@@ -835,21 +836,15 @@ Classes
835836
836837 .. math ::
837838 \ \text { s.t. } \
838- \mathbf {A} \begin {bmatrix}
839- \pmb {\alpha } & \mathbf {P}
840- \end {bmatrix}^T +
841- \mathbf {b}\mathbf {1 }_{n}^T \geq \mathbf {0 }
842- \ \text { and } \
843- \mathbf {A} \begin {bmatrix}
844- \pmb {\beta } & \mathbf {Q}
845- \end {bmatrix}^T +
846- \mathbf {b}\mathbf {1 }_{m}^T \geq \mathbf {0 }
839+ \mathbf {A}_{\text {user}} \begin {pmatrix} \alpha _u \\ \mathbf {p}_u \end {pmatrix} + \mathbf {b}_{\text {user}} \geq \mathbf {0 },\ u = 1 ,\dots ,n
840+ \quad \text {and} \quad
841+ \mathbf {A}_{\text {item}} \begin {pmatrix} \beta _i \\ \mathbf {q}_i \end {pmatrix} + \mathbf {b}_{\text {item}} \geq \mathbf {0 },\ i = 1 ,\dots ,m
847842
848843 The function supports various loss functions, including:
849844 - 'hinge', 'svm' or 'SVM'
850845 - 'MAE' or 'mae' or 'mean absolute error'
851- - 'hinge square ' or 'svm square ' or 'SVM square '
852- - 'MSE' or 'mse' or 'mean square error'
846+ - 'squared hinge ' or 'squared svm ' or 'squared SVM '
847+ - 'MSE' or 'mse' or 'mean squared error'
853848
854849 The following constraint types are supported:
855850 * 'nonnegative' or '>=0': A non-negativity constraint.
@@ -867,8 +862,12 @@ Classes
867862 loss : dict
868863 A dictionary specifying the loss function parameters.
869864
870- constraint : list of dict
871- A list of dictionaries, where each dictionary represents a constraint.
865+ constraint_user : list of dict
866+ A list of dictionaries, where each dictionary represents a constraint to user side parameters.
867+ Each dictionary must contain a 'name' key, which specifies the type of constraint.
868+
869+ constraint_item : list of dict
870+ A list of dictionaries, where each dictionary represents a constraint to item side parameters.
872871 Each dictionary must contain a 'name' key, which specifies the type of constraint.
873872
874873 biased : bool, default=True
@@ -965,7 +964,7 @@ Classes
965964 decision_function(X)
966965 The decision function evaluated on the given dataset.
967966
968- obj(X, y, loss) )
967+ obj(X, y)
969968 Compute the values of loss term and objective function.
970969
971970 Notes
@@ -987,7 +986,7 @@ Classes
987986 - Fit the model based on the given training data.
988987 * - :py:obj: `decision_function <rehline.plqMF_Ridge.decision_function> `\ (X)
989988 - The decision function evaluated on the given dataset
990- * - :py:obj: `obj <rehline.plqMF_Ridge.obj> `\ (X, y, loss )
989+ * - :py:obj: `obj <rehline.plqMF_Ridge.obj> `\ (X, y)
991990 - Compute the values of loss term and objective function.
992991
993992
@@ -1034,7 +1033,7 @@ Classes
10341033 Predicted ratings for the input pairs.
10351034
10361035
1037- .. py :method :: obj(X, y, loss )
1036+ .. py :method :: obj(X, y)
10381037
10391038 Compute the values of loss term and objective function.
10401039
@@ -1045,9 +1044,6 @@ Classes
10451044
10461045 y : array-like of shape (n_ratings,)
10471046 Actual rating values.
1048-
1049- loss : dict
1050- A dictionary specifying the loss function parameters.
10511047
10521048 Returns
10531049 -------
0 commit comments