1
$\begingroup$

I have binary classification method name Fclassifier I need to apply it in a multi-class classification problem, this classifier doesn't have any decision_function (or predict_proba) and its core only accept {1,-1} as class labels! I am trying to use OneVsRestClassifier multi-classifier from sklearn so that I can tune the Fclassifier into multi-class classifier:

fm = FClassification(n_iter=1000, init_stdev=0.1, rank=2, random_state=123,l2_reg_w=0, l2_reg_V=0, l2_reg=0, step_size=0.1)
OneVsRestClassifier(fm).fit(X_train,y_train)

but I am facing the following error:

RuntimeError: Cannot clone object FClassification(init_stdev=0.1, l2_reg=None, l2_reg_V=0, l2_reg_w=0, n_iter=1000, random_state=123, rank=2, step_size=0.1), as the constructor does not seem to set parameter l2_reg_V

do you think if it is the problem of Fclassifier that can not satisfy the expectation of OneVsRestClassifier and if I should define a customized predict_proba which can fit my data to the classifier in order to solve the problem? or if the error may have other reasons and solutions?

$\endgroup$
1
  • $\begingroup$ Have you solved this question? I have a same question now $\endgroup$
    – gubobo
    Mar 3, 2017 at 1:41

1 Answer 1

1
$\begingroup$

Hi you need to implement get_params method to export all your hyper-parameters or inherit your classifier from sklearn.base.BaseEstimator since under hood of OneVsRestClassifier, every classifier is being distributed. so your classifier is being cloned.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.