Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/boosting rules #111

Merged
merged 9 commits into from Apr 9, 2020
Merged

Feature/boosting rules #111

merged 9 commits into from Apr 9, 2020

Conversation

JakubTesarek
Copy link
Contributor

No description provided.

src/Model/Command/UserRecommendation.php Outdated Show resolved Hide resolved
@@ -239,6 +265,13 @@ protected function getCommandType(): string
return 'user-based-recommendations';
}

protected function serializeBoosts(): array
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
protected function serializeBoosts(): array
protected function getSerializedBoosts(): array

To make it clear from the name the method does not have sideffects.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

tests/unit/Model/Command/BoostTest.php Outdated Show resolved Hide resolved
tests/unit/Model/Command/BoostTest.php Outdated Show resolved Hide resolved
README.md Outdated
@@ -227,6 +227,15 @@ $recommendations = $response->getRecommendation()->getData();
// }
```

You can further modify which items will be reccomended by providing boosting rules. Priority of items matching the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can further modify which items will be reccomended by providing boosting rules. Priority of items matching the
You can further modify which items will be recommended by providing boosting rules. Priority of items matching the

README.md Outdated Show resolved Hide resolved
README.md Outdated
@@ -227,6 +227,15 @@ $recommendations = $response->getRecommendation()->getData();
// }
```

You can further modify which items will be reccomended by providing boosting rules. Priority of items matching the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd move this whole added section right before "From $response, you can also access rest of the data:".

Or maybe better merge it with the example following "You can also set more granular options of the recommendation command", something like this:

$recommendation = UserRecommendation::create('user-id', 5, 'test-scenario', 1.0, 3600);
$recommendation->setFilters(['for_recommendation = 1'])
    ->addBoost(Boost::create('valid_to >= NOW()', 2)) // Priority of items matching the Booster criteria will be multiplied by the value of multiplier
    ->addBoost(Boost::create('for_recommendation = 1', 3.5))
    ->setMinimalRelevance(MinimalRelevance::HIGH())
    ->enableHardRotation();

$response = $matej->request()
    ->recommendation($recommendation)
    ->send();

@OndraM OndraM linked an issue Mar 31, 2020 that may be closed by this pull request
@OndraM OndraM added this to the 2.0 milestone Mar 31, 2020
JakubTesarek and others added 6 commits April 2, 2020 21:53
Co-Authored-By: Ondřej Machulda <ondrej.machulda@lmc.eu>
Co-Authored-By: Ondřej Machulda <ondrej.machulda@lmc.eu>
Co-Authored-By: Ondřej Machulda <ondrej.machulda@lmc.eu>
Co-Authored-By: Ondřej Machulda <ondrej.machulda@lmc.eu>
@JakubTesarek
Copy link
Contributor Author

All fixed. I'll squash on merge

Copy link
Member

@OndraM OndraM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found just one glitch in readme, otherwise ✅

Thanks 👍

README.md Outdated Show resolved Hide resolved
Co-Authored-By: Ondřej Machulda <ondrej.machulda@lmc.eu>
@OndraM OndraM merged commit f9ff273 into master Apr 9, 2020
@JakubTesarek JakubTesarek deleted the feature/boosting-rules branch April 12, 2020 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for boosting rules
2 participants