Skip to content

DirichletCalibrator with full l2 regularization throwing error on passing l2_list #5

Description

@shivamtundele

The DirichletCalibrator is throwing error on passing l2_list for reg_lambda parameter as you originally did in your experiment here and you passed your l2_list as here.

In my case, its throwing error as below

/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/dirichletcal/calib/fulldirichlet.pyinfit(self, X, y, X_val, y_val, *args, **kwargs)
46reg_norm=self.reg_norm,
47ref_row=self.ref_row)
--->48self.calibrator_.fit(_X, y, *args, **kwargs)
49final_loss=log_loss(y_val, self.calibrator_.predict_proba(_X_val))
50/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/dirichletcal/calib/multinomial.pyinfit(self, X, y, *args, **kwargs)
95reg_mu=self.reg_mu, ref_row=self.ref_row,
96initializer=self.initializer,
--->97reg_format=self.reg_format)
98else:
99res=scipy.optimize.fmin_l_bfgs_b(func=_objective, fprime=_gradient,
/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/dirichletcal/calib/multinomial.pyin_newton_update(weights_0, X, XX_T, target, k, method_, maxiter, ftol, gtol, reg_lambda, reg_mu, ref_row, initializer, reg_format)
233L_list= [raw_np.float(_objective(weights_0, X, XX_T, target, k, method_,
234reg_lambda, reg_mu, ref_row, initializer,
-->235reg_format))]
236237weights=weights_0.copy()
/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/dirichletcal/calib/multinomial.pyin_objective(params, *args)
151else:
152reg=np.zeros((k, k+1))
-->153loss=loss+reg_lambda*np.sum((weights-reg)**2)
154else:
155weights_hat=weights-np.hstack([weights[:, :-1] *np.eye(k),
/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/jax/interpreters/xla.pyin_forward_method(attrname, self, fun, *args)
985986def_forward_method(attrname, self, fun, *args):
-->987returnfun(getattr(self, attrname), *args)
988_forward_to_value=partial(_forward_method, "_value")
989TypeError: onlyintegerscalararrayscanbeconvertedtoascalarindex

Activity

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