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

Several functions in FCC scorer not used/tested #2120

Open
wschin opened this Issue Jan 11, 2019 · 0 comments

Comments

2 participants
@wschin
Copy link
Member

wschin commented Jan 11, 2019

As title. The functions below have zero reference counts.

        private static IDataScorerTransform Create(IHostEnvironment env, Arguments args, IDataView data, ISchemaBoundMapper mapper, RoleMappedSchema trainSchema)
        {
            Contracts.CheckValue(env, nameof(env));
            env.CheckValue(data, nameof(data));
            env.CheckValue(mapper, nameof(mapper));
            if (args.Top< 0)
                throw env.Except($"Number of top contribution must be non negative");
            if (args.Bottom < 0)
                throw env.Except($"Number of bottom contribution must be non negative");

            var contributionMapper = mapper as RowMapper;
            env.CheckParam(mapper != null, nameof(mapper), "Unexpected mapper");

            var scorer = ScoreUtils.GetScorerComponent(env, contributionMapper);
            var scoredPipe = scorer.CreateComponent(env, data, contributionMapper, trainSchema);
            return scoredPipe;
        }

        // Factory method for SignatureBindableMapper.
        private static ISchemaBindableMapper Create(IHostEnvironment env, Arguments args, IPredictor predictor)
        {
            Contracts.CheckValue(env, nameof(env));
            env.CheckValue(predictor, nameof(predictor));
            var pred = predictor as IFeatureContributionMapper;
            env.CheckParam(pred != null, nameof(predictor), "Predictor doesn't support getting feature contributions");
            return new BindableMapper(env, pred, args.Top, args.Bottom, args.Normalize, args.Stringify);
        }

        // Factory method for SignatureLoadModel.
        private static ISchemaBindableMapper Create(IHostEnvironment env, ModelLoadContext ctx)
            => new BindableMapper(env, ctx);

I further commented out the whole FeatureContributionCalculation.cs, rebuilt my solution, and ran all tests starting with FeatureCont. Surprisingly, all tests passed.

@zeahmed zeahmed added the test label Jan 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment