Skip to content

'sample_weight' argument is not optional in multinomial functions #13020

Closed

Description

@david-cortes

The functions _multinomial_loss, _multinomial_loss_grad, _multinomial_grad_hess in sklearn.linear_model.logistic take an argument sample_weight which has the following documentation:

sample_weight : array-like, shape (n_samples,) optional
        Array of weights that are assigned to individual samples.

However, unlike in the functions _logistic_loss_and_grad, _logistic_loss, _logistic_grad_hess, this argument is not optional as the documentation says, and passing None or an empty array to it will throw an error.

Activity

  1. jnothman commented on Jan 20, 2019

    @jnothman
    Member

    Please submit a PR fixing the documentation

  2. david-cortes commented on Jan 21, 2019

    @david-cortes
    ContributorAuthor

    Please submit a PR fixing the documentation

    Done, but I'd rather have them be optional, so I made them optional instead of changing the documentation: #13024

  3. jnothman commented on Jan 21, 2019

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions