-
Notifications
You must be signed in to change notification settings - Fork 2k
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
GH-15940 Added kolmogorov-Smirnov statistic method to H2OBinomialModelMetrics #16353
Open
Shashank1202
wants to merge
10
commits into
h2oai:master
Choose a base branch
from
Shashank1202:add-ks-method
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+40
−1
Open
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c4b9bf0
Added kolmogorov-Smirnov statistic method to H2OBinomialModelMetrics
Shashank1202 b98bbfc
Test for Kolmogorov Smirnov added
Shashank1202 ba451f5
Delete h2o/pyvenv.cfg
Shashank1202 bd4dfb3
Delete h2o/Scripts/Activate.ps1
Shashank1202 25923a5
Delete h2o/Scripts/activate
Shashank1202 e051e6f
Delete h2o/Scripts/activate.bat
Shashank1202 969fab5
Delete h2o/Scripts/deactivate.bat
Shashank1202 19167a5
GH-15940 Added Kolmogorov-Smirnov statistic method and Test to H2OBin…
Shashank1202 d9f5935
Merge branch 'add-ks-method' of https://github.com/Shashank1202/h2o-3…
Shashank1202 714c6e9
Merge branch 'h2oai:master' into add-ks-method
Shashank1202 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -976,3 +976,26 @@ def thresholds_and_metric_scores(self): | |||||
if 'thresholds_and_metric_scores' in self._metric_json: | ||||||
return self._metric_json['thresholds_and_metric_scores'] | ||||||
return None | ||||||
|
||||||
def kolmogorov_smirnov(self, thresholds= None): | ||||||
""" | ||||||
:param thresholds: thresholds parameter must be a list (e.g. ``[0.01, 0.5, 0.99]``). | ||||||
If None, then the threshold maximizing the KS statistic will be used. | ||||||
:returns: The Kolmogorov-Smirnov statistic for this set of metrics and thresholds. | ||||||
|
||||||
:examples: | ||||||
|
||||||
>>> from h2o.estimators.gbm import H2OGradientBoostingEstimator | ||||||
>>> cars = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/junit/cars_20mpg.csv") | ||||||
>>> cars["economy_20mpg"] = cars["economy_20mpg"].asfactor() | ||||||
>>> predictors = ["displacement","power","weight","acceleration","year"] | ||||||
>>> response = "economy_20mpg" | ||||||
>>> train, valid = cars.split_frame(ratios = [.8], seed = 1234) | ||||||
>>> cars_gbm = H2OGradientBoostingEstimator(seed = 1234) | ||||||
>>> cars_gbm.train(x = predictors, | ||||||
... y = response, | ||||||
... training_frame = train, | ||||||
... validation_frame = valid) | ||||||
>>> cars_gbm.kolmogorov_smirnov() | ||||||
""" | ||||||
return self.metric("ks", thresholds=thresholds) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The goal is something like this:
Suggested change
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.