Package Details: python-scikit-surprise 1.1.4-1

Git Clone URL: https://aur.archlinux.org/python-scikit-surprise.git (read-only, click to copy)
Package Base: python-scikit-surprise
Description: Python scikit for building and analyzing recommender systems
Upstream URL: https://github.com/NicolasHug/Surprise
Keywords: learning machine recommender surpriselib system
Licenses: BSD-3-Clause
Submitter: edh
Maintainer: edh
Last Packager: edh
Votes: 1
Popularity: 0.000000
First Submitted: 2018-08-01 09:28 (UTC)
Last Updated: 2024-06-01 18:04 (UTC)

Dependencies (12)

Required by (0)

Sources (1)

Latest Comments

edh commented on 2025-03-11 00:40 (UTC)

@Pol_M Thank you for your detailed comments! Could you please upstream the patch? I'll gladly update the package once this is merged.

Pol_M commented on 2025-03-08 20:18 (UTC)

Part 2

diff --git a/python3_13.patch b/python3_13.patch
new file mode 100644
index 0000000..4c65b05
--- /dev/null
+++ b/python3_13.patch
@@ -0,0 +1,71 @@
+diff --color --unified --recursive --text Surprise-1.1.4/surprise/prediction_algorithms/co_clustering.pyx src/Surprise-1.1.4/surprise/prediction_algorithms/co_clustering.pyx
+--- Surprise-1.1.4/surprise/prediction_algorithms/co_clustering.pyx    2024-06-14 21:31:58.000000000 +0200
++++ src/Surprise-1.1.4/surprise/prediction_algorithms/co_clustering.pyx    2025-03-08 21:06:14.552774154 +0100
+@@ -73,19 +73,19 @@
+         AlgoBase.fit(self, trainset)
+ 
+         # User and item means
+-        cdef np.ndarray[np.double_t] user_mean
+-        cdef np.ndarray[np.double_t] item_mean
++        cdef np.ndarray[double] user_mean
++        cdef np.ndarray[double] item_mean
+ 
+         # User and items clusters
+-        cdef np.ndarray[np.int_t] cltr_u
+-        cdef np.ndarray[np.int_t] cltr_i
++        cdef np.ndarray[int] cltr_u
++        cdef np.ndarray[int] cltr_i
+ 
+         # Average rating of user clusters, item clusters and co-clusters
+-        cdef np.ndarray[np.double_t] avg_cltr_u
+-        cdef np.ndarray[np.double_t] avg_cltr_i
+-        cdef np.ndarray[np.double_t, ndim=2] avg_cocltr
++        cdef np.ndarray[double] avg_cltr_u
++        cdef np.ndarray[double] avg_cltr_i
++        cdef np.ndarray[double, ndim=2] avg_cocltr
+ 
+-        cdef np.ndarray[np.double_t] errors
++        cdef np.ndarray[double] errors
+         cdef int u, i, r, uc, ic
+         cdef double est
+ 
+@@ -154,8 +154,8 @@
+ 
+         return self
+ 
+-    def compute_averages(self, np.ndarray[np.int_t] cltr_u,
+-                         np.ndarray[np.int_t] cltr_i):
++    def compute_averages(self, np.ndarray[int] cltr_u,
++                         np.ndarray[int] cltr_i):
+         """Compute cluster averages.
+ 
+         Args:
+@@ -168,19 +168,19 @@
+         """
+ 
+         # Number of entities in user clusters, item clusters and co-clusters.
+-        cdef np.ndarray[np.int_t] count_cltr_u
+-        cdef np.ndarray[np.int_t] count_cltr_i
+-        cdef np.ndarray[np.int_t, ndim=2] count_cocltr
++        cdef np.ndarray[int] count_cltr_u
++        cdef np.ndarray[int] count_cltr_i
++        cdef np.ndarray[int, ndim=2] count_cocltr
+ 
+         # Sum of ratings for entities in each cluster
+-        cdef np.ndarray[np.int_t] sum_cltr_u
+-        cdef np.ndarray[np.int_t] sum_cltr_i
+-        cdef np.ndarray[np.int_t, ndim=2] sum_cocltr
++        cdef np.ndarray[int] sum_cltr_u
++        cdef np.ndarray[int] sum_cltr_i
++        cdef np.ndarray[int, ndim=2] sum_cocltr
+ 
+         # The averages of each cluster (what will be returned)
+-        cdef np.ndarray[np.double_t] avg_cltr_u
+-        cdef np.ndarray[np.double_t] avg_cltr_i
+-        cdef np.ndarray[np.double_t, ndim=2] avg_cocltr
++        cdef np.ndarray[double] avg_cltr_u
++        cdef np.ndarray[double] avg_cltr_i
++        cdef np.ndarray[double, ndim=2] avg_cocltr
+ 
+         cdef int u, i, r, uc, ic
+         cdef double global_mean = self.trainset.global_mean
-- 
2.48.1

Pol_M commented on 2025-03-08 20:17 (UTC)

Hi, the package no longer works. This is the patch I'm currently using to make things work: Part 1 (split due to comment limits)

From ec330b801c802ab06f42520b981bcd915f6dd225 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pol=20Marcet=20Sard=C3=A0?= <polmarcetsarda@gmail.com>
Date: Sat, 8 Mar 2025 21:13:18 +0100
Subject: [PATCH] Make package work with python 3.13

---
 .SRCINFO         |  4 ++-
 PKGBUILD         | 10 +++++--
 python3_13.patch | 71 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 82 insertions(+), 3 deletions(-)
 create mode 100644 python3_13.patch

diff --git a/.SRCINFO b/.SRCINFO
index 70d818a..5771e51 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -18,6 +18,8 @@ pkgbase = python-scikit-surprise
    optdepends = python-sphinx_rtd_theme: Read The Docs theme for documentation generator
    optdepends = python-sphinxcontrib-spelling: spelling extension for documentation generator
    source = python-scikit-surprise-1.1.4.tar.gz::https://github.com/NicolasHug/Surprise/archive/v1.1.4.tar.gz
-   sha512sums = ecb10c3da63ff5aa6968fd73fb2c23503e977309d47cad8e0be2d086d0a867b02a266933d0d5238d598410668c0d15450a338cc748ed5a75bca58048675ce75f
+   source = python3_13.patch
+   sha512sums = 8248bb2dbeccd5015dc9f1ecf9962e9c427b13e276670e2ab370cfbf560a707a2588127523a8ad0f8bc9340f63b40d581df0f63447decfa62a8821e8712417bd
+   sha512sums = 5c99c817d10122f655482c9d23b6f9676c1639770683f5973925cf86d1dd4055aac0af739baba1848ab0ef71ed3d49eeeedb4ea8ab4b0bdd4b90fdf768fd2cba

 pkgname = python-scikit-surprise
diff --git a/PKGBUILD b/PKGBUILD
index 959c729..3d597b3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -18,8 +18,14 @@ optdepends=("flake8: code linting to comply with contributing standards"
 makedepends=('python-setuptools' 'cython')
 provides=()
 conflicts=()
-source=("${pkgname}-${pkgver}.tar.gz"::"https://github.com/NicolasHug/${_reponame}/archive/v${pkgver}.tar.gz")
-sha512sums=('ecb10c3da63ff5aa6968fd73fb2c23503e977309d47cad8e0be2d086d0a867b02a266933d0d5238d598410668c0d15450a338cc748ed5a75bca58048675ce75f')
+source=("${pkgname}-${pkgver}.tar.gz"::"https://github.com/NicolasHug/${_reponame}/archive/v${pkgver}.tar.gz" "python3_13.patch")
+sha512sums=('8248bb2dbeccd5015dc9f1ecf9962e9c427b13e276670e2ab370cfbf560a707a2588127523a8ad0f8bc9340f63b40d581df0f63447decfa62a8821e8712417bd'
+           '5c99c817d10122f655482c9d23b6f9676c1639770683f5973925cf86d1dd4055aac0af739baba1848ab0ef71ed3d49eeeedb4ea8ab4b0bdd4b90fdf768fd2cba')
+
+prepare() {
+    cd "${srcdir}/${_reponame}-${pkgver}"
+    patch -Np1 -i ../../python3_13.patch
+}

 build() {
    cd "${srcdir}/${_reponame}-${pkgver}"

edh commented on 2020-01-11 12:05 (UTC)

@charlie Thanks for the comment! I made the change already locally a while back but forgot to actually commit and push it.

While being at it, I pruned the python2 version of the package due to python2's EOL.

charlie commented on 2020-01-10 11:11 (UTC) (edited on 2020-01-10 11:12 (UTC) by charlie)

I have errors when trying to create the package:

[code]

makepkg -sri

==> ERROR: conflicts is not allowed to be empty.

==> ERROR: depends is not allowed to be empty.

==> ERROR: provides is not allowed to be empty.

[/code]

It worked after I replaced the ("") and ('') by just ():

[code]

depends=()

...

provides=()

conflicts=()

[/code]