Skip to content

Add custom estimator for IP Insights algorithm #493

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

Merged
merged 4 commits into from
Nov 16, 2018

Conversation

jaredleekatzman
Copy link
Contributor

Issue #, if available:

Description of changes:

  • Add custom estimators for IP Insights algorithm

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have updated the changelog with a description of my changes (if appropriate)
  • I have updated any necessary documentation (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov-io
Copy link

codecov-io commented Nov 16, 2018

Codecov Report

Merging #493 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #493      +/-   ##
==========================================
+ Coverage   94.18%   94.24%   +0.06%     
==========================================
  Files          58       59       +1     
  Lines        4400     4448      +48     
==========================================
+ Hits         4144     4192      +48     
  Misses        256      256
Impacted Files Coverage Δ
src/sagemaker/amazon/amazon_estimator.py 88.97% <ø> (ø) ⬆️
src/sagemaker/amazon/ipinsights.py 100% <100%> (ø)
src/sagemaker/__init__.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c32dec0...e3a2e51. Read the comment docs.

Copy link
Contributor

@laurenyu laurenyu left a comment

Choose a reason for hiding this comment

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

looks good! just a small handful of nitpicky comments

batch_metrics_publish_interval=None, epochs=None, learning_rate=None,
num_ip_encoder_layers=None, random_negative_sampling_rate=None,
shuffled_negative_sampling_rate=None, weight_decay=None, **kwargs):
"""IP Insights is :class:`Estimator` used for unsupervised learning.
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: change this to either

``IPInsights`` is a :class:`Estimator` used for unsupervised learning.

or something like

This estimator is for IP Insights, an algorithm for unsupervised learning.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to:

This estimator is for IP Insights, an unsupervised algorithm that learns usage patterns of IP addresses.

weight_decay (float): Optional. Weight decay coefficient. Adds L2 regularization.
**kwargs: base class keyword argument values.
"""

Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: don't need this newline

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

self.weight_decay = weight_decay

def create_model(self, vpc_config_override=VPC_CONFIG_DEFAULT):
"""Return a :class:`~sagemaker.amazon.IPInsightsModel`referencing the latest
Copy link
Contributor

Choose a reason for hiding this comment

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

this can go in a Returns section after Args. also, add a space after the last backtick

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -0,0 +1,235 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

remove the newline

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@jesterhazy jesterhazy merged commit 537ba79 into aws:master Nov 16, 2018
metrizable added a commit to metrizable/sagemaker-python-sdk that referenced this pull request Dec 1, 2020
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.

4 participants