Skip to content

Commit

Permalink
Merge branch 'ARPmetric' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesokolovv authored Feb 21, 2024
2 parents 059de1c + c77932f commit 9fe2985
Show file tree
Hide file tree
Showing 13 changed files with 2,294 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased

### Added
- VisualApp and ItemToItemVisualApp widgets for visual comparison of recommendations ([#80](https://github.com/MobileTeleSystems/RecTools/pull/80), [#82](https://github.com/MobileTeleSystems/RecTools/pull/82)) (Need examples and readme update)
- Methods for conversion `Interactions` to raw form and for getting raw interactions from `Dataset` ([#69](https://github.com/MobileTeleSystems/RecTools/pull/69))
- `AvgRecPopularity (Average Recommendation Popularity)` to `metrics` ([#81](https://github.com/MobileTeleSystems/RecTools/pull/81))
- Added `normalized` parameter to `AvgRecPopularity` metric ([#89](https://github.com/MobileTeleSystems/RecTools/pull/89))
Expand Down
1 change: 1 addition & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ API
rectools.model_selection
rectools.models
rectools.tools
rectools.visuals
3 changes: 3 additions & 0 deletions docs/source/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,6 @@ Oops, yeah, can't forget about them.


.. include:: tools.rst


.. include:: visuals.rst
20 changes: 20 additions & 0 deletions docs/source/visuals.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Visuals
===============

.. _visuals:

.. currentmodule:: rectools

Details of RecTools Visuals
-----------------------------------

See the API documentation for further details on Visuals:

.. currentmodule:: rectools

.. moduleautosummary::
:toctree: api/
:template: custom-module-template.rst
:recursive:

rectools.visuals
1,415 changes: 1,399 additions & 16 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,19 @@ pytorch-lightning = [
{version = ">=1.6.0, <3.0.0", python = ">=3.8", optional = true}
]

ipywidgets = {version = ">=7.7,<8.2", optional = true}


[tool.poetry.extras]
lightfm = ["lightfm"]
nmslib = ["nmslib"]
torch = ["torch", "pytorch-lightning"]
visuals = ["ipywidgets"]
all = [
"lightfm",
"nmslib",
"torch", "pytorch-lightning",
"ipywidgets"
]

[tool.poetry.group.dev.dependencies]
Expand Down
1 change: 1 addition & 0 deletions rectools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
model_selection - Cross-validation
models - Recommendation models
tools - Useful instruments
visuals - Visualization apps
"""

from .columns import Columns
Expand Down
12 changes: 12 additions & 0 deletions rectools/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,15 @@ class UserToItemAnnRecommender(RequirementUnavailable):
"""Dummy class, which is returned if there are no dependencies required for the model"""

requirement = "nmslib"


class VisualApp(RequirementUnavailable):
"""Dummy class, which is returned if there are no dependencies required for the model"""

requirement = "ipywidgets"


class ItemToItemVisualApp(RequirementUnavailable):
"""Dummy class, which is returned if there are no dependencies required for the model"""

requirement = "ipywidgets"
32 changes: 32 additions & 0 deletions rectools/visuals/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2024 MTS (Mobile Telesystems)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
Visualization tools (:mod:`rectools.visuals`)
=======================================================
Instruments to visualize recommender models performance
Recommendations visualization
---------
`visuals.VisualApp` - Jupyter app for visual comparison of recommendations
`visuals.ItemToItemVisualApp` - Jupyter app for visual comparison of item-to-item recommendations
"""

try:
from .visual_app import ItemToItemVisualApp, VisualApp
except ImportError: # pragma: no cover
from ..compat import ItemToItemVisualApp, VisualApp # type: ignore

__all__ = ("VisualApp", "ItemToItemVisualApp")
Loading

0 comments on commit 9fe2985

Please sign in to comment.