Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Microsoft.ML.EntryPoints/PermutationFeatureImportance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ internal static IDataView GetMetrics(
RoleMappedData roleMappedData,
PermutationFeatureImportanceArguments input)
{
Contracts.Check(roleMappedData.Schema.Feature != null, "Feature column not found.");
Contracts.Check(roleMappedData.Schema.Label != null, "Label column not found.");
IDataView result;
if (predictor.PredictionKind == PredictionKind.BinaryClassification)
result = GetBinaryMetrics(env, predictor, roleMappedData, input);
Expand Down Expand Up @@ -252,6 +254,7 @@ private static IDataView GetRankingMetrics(
RoleMappedData roleMappedData,
PermutationFeatureImportanceArguments input)
{
Contracts.Check(roleMappedData.Schema.Group != null, "Group ID column not found.");
var roles = roleMappedData.Schema.GetColumnRoleNames();
var featureColumnName = roles.Where(x => x.Key.Value == RoleMappedSchema.ColumnRole.Feature.Value).First().Value;
var labelColumnName = roles.Where(x => x.Key.Value == RoleMappedSchema.ColumnRole.Label.Value).First().Value;
Expand Down