Ritam-Guha / Py_FS

A Python Package for Feature Selection
MIT License
57 stars 38 forks source link

Unable to use SCC or PCC #36

Open sk-mohiuddin opened 1 year ago

sk-mohiuddin commented 1 year ago

from Py_FS.filter import SCC fs=SCC(x.values,target) print(fs.scores)

Above code shows 'None'. Is there anything that needs to change? How to calculate the score for either SCC or PCC?

Ritam-Guha commented 1 year ago

Thanks for the issue. I have published a new version: 0.2.1. Please install the new version and check. Please let me know if you find any problem with the new version.

sk-mohiuddin commented 1 year ago

Dear, Thank you so much. Regards

On Wed, May 17, 2023 at 7:56 PM RITAM GUHA @.***> wrote:

Thanks for the issue. I have published a new version: 0.2.1. Please install the new version and check. Please let me know if you find any problem with the new version.

— Reply to this email directly, view it on GitHub https://github.com/Ritam-Guha/Py_FS/issues/36#issuecomment-1551501595, or unsubscribe https://github.com/notifications/unsubscribe-auth/AREUCDYKPMDNGZIRSS7IEVTXGTNYFANCNFSM6AAAAAAYDTZ2UU . You are receiving this because you authored the thread.Message ID: @.***>

SafwanAlselwi commented 7 months ago

Need to add "results." before "solution" in binary classification otherwise you'll get

AttributeError: 'SCC' object has no attribute 'best_agent'

if(len(np.unique(test_Y))) == 2:
  # if it is binary classification, you will get a precision, recall and f1_score for each of the labels
  eval_result = evaluate(train_X, test_X, train_Y, test_Y, agent=results.solution.best_agent, classifier='knn', save_conf_mat=True)
else:
  # for a multi-class problem, you will get a avreaged precision, recall and f1_score
  # Options for averaging:
  # 1. macro
  # 2. weighted
  # 3. samples
  eval_result = evaluate(train_X, test_X, train_Y, test_Y, agent=results.solution.best_agent, classifier='knn', save_conf_mat=True, averaging="weighted")