KNN with parameter tuning and LOG process....Not getting confusion matrix for all k

vbsingh
vbsingh New Altair Community Member
edited November 2024 in Community Q&A
I am using KNN for multiclass problem . I am applying optimized grid search  for parameter tuning and using log process for getting every cucle results. But I am getting only accuracy results and different values of K. How can i get the confussion matrix  for all possible values of K in KNN..Please suggest and guide...
Tagged:

Best Answers

  • Telcontar120
    Telcontar120 New Altair Community Member
    Answer ✓
    This isn't possible with the log operator and optimize operator alone, I think you are going to need to use a loop and store the confusion matrix from each model run separately.
  • varunm1
    varunm1 New Altair Community Member
    Answer ✓
    Hello @vbsingh

    If you are just optimizing on K-Value, please look at the below process, where there are a couple of macros and store operators to store performance in the repository folder. This way, you can store the performance of each k value. You can import the process attached to your RM and change the store operator repository entry, but be sure to add the macro name in the current process of the store operator in the name.
  • varunm1
    varunm1 New Altair Community Member
    Answer ✓
    @vbsingh by the way, uncheck the "enable parallel execution" in optimize parameter operator.

Answers

  • vbsingh
    vbsingh New Altair Community Member
    How to get confusion matrix  for all k values through grid search...
  • Telcontar120
    Telcontar120 New Altair Community Member
    Answer ✓
    This isn't possible with the log operator and optimize operator alone, I think you are going to need to use a loop and store the confusion matrix from each model run separately.
  • vbsingh
    vbsingh New Altair Community Member
    But I need parameter optimization too...
  • varunm1
    varunm1 New Altair Community Member
    Answer ✓
    Hello @vbsingh

    If you are just optimizing on K-Value, please look at the below process, where there are a couple of macros and store operators to store performance in the repository folder. This way, you can store the performance of each k value. You can import the process attached to your RM and change the store operator repository entry, but be sure to add the macro name in the current process of the store operator in the name.
  • vbsingh
    vbsingh New Altair Community Member
    Great I am trying it......

  • varunm1
    varunm1 New Altair Community Member
    Answer ✓
    @vbsingh by the way, uncheck the "enable parallel execution" in optimize parameter operator.
  • vbsingh
    vbsingh New Altair Community Member
    plz send the .properties file also

  • varunm1
    varunm1 New Altair Community Member
    Here is the zip folder with all the related files, you just need to unzip in your local repository of rapidminer folder and run it.
  • vbsingh
    vbsingh New Altair Community Member
    Hi varunm1,
    Thanks for sharing your operator.. It was great help. But i have one problem with J48 since there is two parameter ...so there is overlapping in result.. how to change the name of the result..and get entire result.
  • vbsingh
    vbsingh New Altair Community Member
    What should be the range for J48 machine learning technique while using optimize operator