-
Notifications
You must be signed in to change notification settings - Fork 1.9k
updating namespaces #2914
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
updating namespaces #2914
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
bf7fa28
Microsoft.ML.LightGBM -> changes to Microsoft.ML.Trainers.LightGBM
sfilipi 629c39c
ImageAnalytics -> Transforms.Images
sfilipi 00ac2ef
LightGBM -> LightGbm for namespace, assembly and package.
sfilipi 3d181b9
renaming the LightGBM project, and packages.
sfilipi 739913b
moving the few public types outside of ML.Model
sfilipi cfcc7d8
updating the casing on LightGbm project and assembly references
sfilipi a11f63a
Regenerate the catalog, and rename the csproj in LightGBM to fix the …
sfilipi 28debb3
fixing the casing on the package urls and the csproj file.
sfilipi 14a7d5b
merging from master
sfilipi 8a05426
regenerating the catalog
sfilipi 30d1e73
nit
sfilipi 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
1 change: 1 addition & 0 deletions
1
docs/samples/Microsoft.ML.Samples/Dynamic/FeatureContributionCalculationTransform.cs
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
6 changes: 3 additions & 3 deletions
6
...samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/LightGbmWithOptions.cs
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
6 changes: 3 additions & 3 deletions
6
...les/Microsoft.ML.Samples/Dynamic/Trainers/MulticlassClassification/LightGbmWithOptions.cs
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
6 changes: 3 additions & 3 deletions
6
docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/Ranking/LightGbmWithOptions.cs
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
6 changes: 3 additions & 3 deletions
6
docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/Regression/LightGbmWithOptions.cs
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
2 changes: 1 addition & 1 deletion
2
docs/samples/Microsoft.ML.Samples/Static/LightGBMBinaryClassification.cs
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
2 changes: 1 addition & 1 deletion
2
docs/samples/Microsoft.ML.Samples/Static/LightGBMMulticlassWithInMemoryData.cs
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
4 changes: 2 additions & 2 deletions
4
docs/samples/Microsoft.ML.Samples/Static/LightGBMRegression.cs
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
5 changes: 0 additions & 5 deletions
5
pkg/Microsoft.ML.LightGBM/Microsoft.ML.LightGBM.symbols.nupkgproj
This file was deleted.
Oops, something went wrong.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
pkg/Microsoft.ML.LightGbm/Microsoft.ML.LightGbm.symbols.nupkgproj
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,5 @@ | ||
<Project DefaultTargets="Pack"> | ||
|
||
<Import Project="Microsoft.ML.LightGbm.nupkgproj" /> | ||
|
||
</Project> |
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
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
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
43 changes: 43 additions & 0 deletions
43
src/Microsoft.ML.Data/Prediction/ICalculateFeatureContribution.cs
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,43 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Microsoft.ML.Data; | ||
|
||
namespace Microsoft.ML.Trainers | ||
{ | ||
/// <summary> | ||
/// Interface for mapping input values to corresponding feature contributions. | ||
/// This interface is commonly implemented by predictors. | ||
/// </summary> | ||
[BestFriend] | ||
internal interface IFeatureContributionMapper : IPredictor | ||
{ | ||
/// <summary> | ||
/// Get a delegate for mapping Contributions to Features. | ||
/// Result will contain vector with topN positive contributions(if available) and | ||
/// bottomN negative contributions (if available). | ||
/// For example linear predictor will have both negative and positive contributions. | ||
/// For trees we will not have negative contributions, so bottom param will be ignored. | ||
/// If normalization is requested that resulting values will be normalized to [-1, 1]. | ||
/// </summary> | ||
ValueMapper<TSrc, VBuffer<float>> GetFeatureContributionMapper<TSrc, TDst>(int top, int bottom, bool normalize); | ||
} | ||
|
||
/// <summary> | ||
/// Allows support for feature contribution calculation by model parameters. | ||
/// </summary> | ||
public interface ICalculateFeatureContribution | ||
{ | ||
FeatureContributionCalculator FeatureContributionCalculator { get; } | ||
} | ||
|
||
/// <summary> | ||
/// Support for feature contribution calculation. | ||
/// </summary> | ||
public sealed class FeatureContributionCalculator | ||
{ | ||
internal IFeatureContributionMapper ContributionMapper { get; } | ||
internal FeatureContributionCalculator(IFeatureContributionMapper contributionMapper) => ContributionMapper = contributionMapper; | ||
} | ||
} |
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
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
Oops, something went wrong.
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.
I'm not seeing how this class is used anywhere in the code.
Can it be deleted?
It appears the way this is working is that we have a public API that takes in a
ICalculateFeatureContribution
(the public interface above) object, and then we internally cast that same object toIFeatureContributionMapper
(the internal interface above that). I don't see where we are using this public class anywhere in our code.cc @TomFinley @rogancarr
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.
tried to remove it, and just use the IFeatureContributionMapper, but it will need the GetFeatureContributionMapper, and the ValueMapper to be public too. The ValueMapper is internal atm.
In reply to: 265147046 [](ancestors = 265147046)
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.
I was able to remove it, and make the solution build successfully:
eerhardt@cd1ac9f
(Obviously this is outside of the scope of this current PR - which is just moving namespaces. Maybe we should open an issue for this design, as I think it kind of "smells".)
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.
oh ic, you've removed it completely. I was merging it with the IFeatureContributionMapper. I'll create an issue.