scikit-learn VS Surprise

Compare scikit-learn vs Surprise and see what are their differences.

scikit-learn

scikit-learn: machine learning in Python (by scikit-learn)

Surprise

A Python scikit for building and analyzing recommender systems (by NicolasHug)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
scikit-learn Surprise
80 8
57,747 6,153
1.0% -
9.9 0.0
6 days ago 11 months ago
Python Python
BSD 3-clause "New" or "Revised" License GNU General Public License v3.0 or later
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

scikit-learn

Posts with mentions or reviews of scikit-learn. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-01-08.
  • Polars
    11 projects | news.ycombinator.com | 8 Jan 2024
    sklearn is adding support through the dataframe interchange protocol (https://github.com/scikit-learn/scikit-learn/issues/25896). scipy, as far as I know, doesn't explicitly support dataframes (it just happens to work when you wrap a Series in `np.array` or `np.asarray`). I don't know about PyTorch but in general you can convert to numpy.
  • [D] Major bug in Scikit-Learn's implementation of F-1 score
    2 projects | /r/MachineLearning | 8 Dec 2023
    Here is the (as of posting time) still un-merged fix to the bug in question. Note that this bug also affects sklearn.metrics.classification_report. I think you you can temporarily get around this by using sklearn version 1.2.2. Anyway, if you use Scikit-Learn's metrics for evaluation, go double check your scores!
    2 projects | /r/MachineLearning | 8 Dec 2023
    Wow, from the upvotes on this comment, it really seems like a lot of people think that this is the correct behavior! I have to say I disagree, but if that's what you think, don't just sit there upvoting comments on Reddit; instead go to this PR and tell the Scikit-Learn maintainers not to "fix" this "bug", which they are currently planning to do!
  • Ask HN: Learning new coding patterns – how to start?
    3 projects | news.ycombinator.com | 10 Nov 2023
    I was in a similar boat to yours - Worked in data science and since then have made a move to data engineering and software engineering for ML services.

    I would recommend you look into the Design Patterns book by the Gang of Four. I found it particularly helpful to make extensible code that doesn't break specially with abstract classes, builders and factories. I would also recommend looking into the book The Object Oriented Thought Process to understand why traditional OOP is build the way it is.

    You can also look into the source code of popular data science libraries such as sklearn (https://github.com/scikit-learn/scikit-learn/tree/main/sklea...) and see how a lot of them have Base classes to define shared functionality between object of the same nature.

    As others mentioned, I would also encourage you to try and implement design patterns in your everyday work - maybe you can make a Factory to load models or preprocessors that follow the same Abstract class?

  • How to Build and Deploy a Machine Learning model using Docker
    5 projects | dev.to | 30 Jul 2023
    Scikit-learn Documentation
  • Link Prediction With node2vec in Physics Collaboration Network
    4 projects | dev.to | 16 Jun 2023
    Firstly, we need a connection to Memgraph so we can get edges, split them into two parts (train set and test set). For edge splitting, we will use scikit-learn. In order to make a connection towards Memgraph, we will use gqlalchemy.
  • List of AI-Models
    14 projects | /r/GPT_do_dah | 16 May 2023
    Click to Learn more...
  • PSA: You don't need fancy stuff to do good work.
    10 projects | /r/datascience | 9 May 2023
    Finally, when it comes to building models and making predictions, Python and R have a plethora of options available. Libraries like scikit-learn, statsmodels, and TensorFlowin Python, or caret, randomForest, and xgboostin R, provide powerful machine learning algorithms and statistical models that can be applied to a wide range of problems. What's more, these libraries are open-source and have extensive documentation and community support, making it easy to learn and apply new techniques without needing specialized training or expensive software licenses.
  • Mastering Data Science: Top 10 GitHub Repos You Need to Know
    10 projects | dev.to | 24 Apr 2023
    1. Scikit-learn Scikit-learn is a must-know Python library for any data scientist. It offers a wide range of machine learning algorithms, data preprocessing tools, and model evaluation metrics that are easy to use and highly efficient. Whether you’re working on regression, classification, or clustering tasks, Scikit-learn has got you covered.
  • We are the developers behind pandas, currently preparing for the 2.0 release :) AMA
    9 projects | /r/Python | 1 Mar 2023
    There's an issue here about that https://github.com/scikit-learn/scikit-learn/discussions/25450

Surprise

Posts with mentions or reviews of Surprise. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-10-16.
  • Dislike button would improve Spotify's recommendations
    4 projects | news.ycombinator.com | 16 Oct 2021
    I spent the latter half of 2019 trying to build this as a startup. Ultimately I pivoted (now I do newsletter recommendations instead), but if I hadn't made some mistakes I think it could've gotten more traction. Mostly I should've simplified the idea to make it easier to build. If anyone's interested in working on this, here's what I would do:

    (But first some background: The way I saw it, you can split music recommendation into two tasks: (1) picking a song you already know that should be played right now, and (2) picking a new song you've never heard of before. (Music recommendation is unique in this way since in most other domains there isn't much value in re-recommending items). I think #1 is more important, and if you nail that, you can do a so-so job of #2 and still have a good system.)

    Make a website that imports your Last.fm history. Organize the history into sessions (say, groups of listen events with a >= 30 minute gap in between). Feed those sessions into a collaborative filtering library like Surprise[1], as a CSV of `, , 1` (1 being a rating--in this case we only have positive ratings). Then make some UI that lets people create and export playlists. e.g. I pick a couple seed songs from my listening history, then the app uses Surprise to suggest more songs. Present a list of 10 songs at a time. Click a song to add it, and have a "skip all" button that gets a new list of songs. Save these interactions as ratings--e.g. if I skip a song, that's a -1 rating for this playlist. For some percentage of the suggestions (20% by default? Make it configurable), use Last.fm's or Spotify's API to pick a new song not in your history, based on the songs in the current playlist. Also sometimes include songs that were added to the playlist previously--if you skip them, they get removed from the playlist. Then you can spend a couple minutes every week refreshing your playlists. Export the playlists to Spotify/Apple Music/whatever.

    As you get more users, you can do "regular" collaborative filtering (i.e. with different users) to recommend new songs instead of relying on external APIs. There are probably lots of other things you could do too--e.g. scrape wikipedia to figure out what artists have done collaborations or something. In general I think the right approach is to build a model for artist similarity rather than individual song similarity. At recommendation time, you pick an artist and then suggest their top songs (and sometimes pick an artist already in the user's history, and suggest songs they haven't heard yet--that's even easier).

    This is the simplest thing I can think of that would solve my "I love music but I listen to the same old songs everyday because I'm busy and don't want to futz around with curating my music library" problem. You wouldn't have to waste time building a crappy custom music app, and users won't have to use said crappy custom music app (speaking from personal experience...). You wouldn't have to deal with music rights or integrating with Spotify/Apple Music since you're not actually playing any music.

    If you want to go further with it, you could get traction first and then launch your own streaming service or something. (Reminds me a bit of Readwise starting with just highlights and then launching their own reader recently). I think it'd be neat to make an indie streaming service--kind of like Bandcamp but with an algorithm to help you find the good stuff. Let users upload and listen to their own MP3s so it can still work with popular music. Of course it'd be nicer for users in the short term if you just made deals with the big record labels, however this would help you not end up in Spotify's position of pivoting to podcasts so you can get out of paying record labels. And then maybe in a few decades all the good music won't be on the big labels anyway :).

    Anyway if anyone is remotely interested in building something like this, I'll be your first user. I really need it. Otherwise I'll probably build it myself at some point in the next year or two as a side project.

    [1] http://surpriselib.com/

What are some alternatives?

When comparing scikit-learn and Surprise you can also consider the following projects:

LightFM - A Python implementation of LightFM, a hybrid recommendation algorithm.

Prophet - Tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth.

Keras - Deep Learning for humans

tensorflow - An Open Source Machine Learning Framework for Everyone

gensim - Topic Modelling for Humans

H2O - H2O is an Open Source, Distributed, Fast & Scalable Machine Learning Platform: Deep Learning, Gradient Boosting (GBM) & XGBoost, Random Forest, Generalized Linear Modeling (GLM with Elastic Net), K-Means, PCA, Generalized Additive Models (GAM), RuleFit, Support Vector Machine (SVM), Stacked Ensembles, Automatic Machine Learning (AutoML), etc.

PyBrain

seqeval - A Python framework for sequence labeling evaluation(named-entity recognition, pos tagging, etc...)

python-recsys - A python library for implementing a recommender system

MLflow - Open source platform for the machine learning lifecycle

xgboost - Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM) Library, for Python, R, Java, Scala, C++ and more. Runs on single machine, Hadoop, Spark, Dask, Flink and DataFlow