-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Support for Categorical features in CalculateFeatureContribution of LightGBM #5018
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
antoniovs1029
merged 4 commits into
dotnet:master
from
antoniovs1029:is3272LGBMFeatCont
Apr 21, 2020
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b7fa547
Add support for CategoricalFeatures in AppendFeatureContributions
antoniovs1029 fc58840
Added test
antoniovs1029 6b713f4
Error in docs?
antoniovs1029 a2d8779
Updated way of calculating feature contribution for categorical splits
antoniovs1029 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 hidden or 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 hidden or 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
29 changes: 29 additions & 0 deletions
29
test/BaselineOutput/Common/FeatureContribution/LightGbmRegressionWithCategoricalSplit.tsv
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#@ TextLoader{ | ||
#@ sep=tab | ||
#@ col=VendorId:TX:0 | ||
#@ col=RateCode:R4:1 | ||
#@ col=PassengerCount:R4:2 | ||
#@ col=PassengerCount:R4:3 | ||
#@ col=TripTime:R4:4 | ||
#@ col=TripTime:R4:5 | ||
#@ col=TripDistance:R4:6 | ||
#@ col=TripDistance:R4:7 | ||
#@ col=PaymentType:TX:8 | ||
#@ col=FareAmount:R4:9 | ||
#@ col=Label:R4:10 | ||
#@ col=VendorIdEncoded:U4[1]:11 | ||
#@ col=VendorIdEncoded:R4:12-12 | ||
#@ col=RateCodeEncoded:U4[2]:13 | ||
#@ col=RateCodeEncoded:R4:14-15 | ||
#@ col=PaymentTypeEncoded:U4[3]:16 | ||
#@ col=PaymentTypeEncoded:R4:17-19 | ||
#@ col=Features:R4:20-28 | ||
#@ col=FeatureContributions:R4:29-37 | ||
#@ col=FeatureContributions:R4:38-46 | ||
#@ col=FeatureContributions:R4:47-55 | ||
#@ col=FeatureContributions:R4:56-64 | ||
#@ } | ||
CMT 1 1 0.7088812 1271 1.64874518 3.8 1.0118916 CRD 17.5 17.5 0 1 0 1 0 0 1 0 0 1 1 0 1 0 0 0.7088812 1.64874518 1.0118916 36 4:0.107879594 7:0.725665748 8:1 15:-1 24:-0.0418495 26:1 33:-0.370121539 35:8.844109 | ||
CMT 1 1 0.7088812 474 0.6148743 1.5 0.3994309 CRD 8 8 0 1 0 1 0 0 1 0 0 1 1 0 1 0 0 0.7088812 0.6148743 0.3994309 36 4:1 15:-0.0364986733 16:-0.847436965 17:-1 22:0.011381451 26:-1 31:0.115415707 35:-10.1406841 | ||
CMT 1 1 0.7088812 637 0.8263184 1.4 0.372802168 CRD 8.5 8.5 0 1 0 1 0 0 1 0 0 1 1 0 1 0 0 0.7088812 0.8263184 0.372802168 36 4:1 15:-0.0366709046 16:-0.5593253 17:-1 22:0.0182117485 26:-1 31:0.183812216 35:-10.0930576 | ||
CMT 1 1 0.7088812 181 0.234793767 0.6 0.159772366 CSH 4.5 4.5 0 1 0 1 0 1 0 1 0 1 1 0 0 1 0 0.7088812 0.234793767 0.159772366 36 6:1 13:-0.293414325 16:-0.7202999 17:-1 24:0.0291313324 26:-1 33:0.33991462 35:-11.6683512 |
This file contains hidden or 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
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.
It looks to me this doc was wrong, as it's inconsistent with what these other lines below say:
machinelearning/src/Microsoft.ML.FastTree/RegressionTree.cs
Lines 76 to 80 in 8660ecc
machinelearning/src/Microsoft.ML.FastTree/RegressionTree.cs
Lines 100 to 106 in 8660ecc