3
votes

I am running a feed forward neural network and want to get a confusion matrix with the line

sklearn.metrics.confusion_matrix(goldLabel_array, predictions, sample_weight=None, labels=None)

But when I am running it, it gives me the error message in the headline. I installed scikit-learn and sklearn. WhenI am running 'pip list', sklearn is listed, but with the version 0.0. When I am running conda install sklearn it gives me the following:

Collecting package metadata (current_repodata.json): done
Solving environment: failed with current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - sklearn

Current channels:

  - https://conda.anaconda.org/loopbio/win-64
  - https://conda.anaconda.org/loopbio/noarch
  - https://repo.anaconda.com/pkgs/main/win-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/win-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://repo.anaconda.com/pkgs/msys2/win-64
  - https://repo.anaconda.com/pkgs/msys2/noarch
  - https://conda.anaconda.org/conda-forge/win-64
  - https://conda.anaconda.org/conda-forge/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page. 
1
Have you tried conda install -c anaconda scikit-learn or conda install scikit-learn? I know that you import sklearn but the package itself is called scikit-learn.Ari Cooper-Davis
Do you mean this sklearn? In which case this is scikit-learn. Have you remembered to import the module?Ari Cooper-Davis
When I run conda install -c anaconda scikit-learn, it gives me 'You probably need to delete and re-download or re-create this file. Message from libarchive was:\n\nCould not unlink (errno=22, retcode=-25, archive_p=2733626229488)')' But I already tried to uninstall it and install it one more timemaybeyourneighour
Could you post your code?Ari Cooper-Davis

1 Answers

2
votes

The error is nothing to do with installing. It is telling you that you have not imported the library into the place you are calling it in your code.

Edit You're importing confusion_matrix directly, so you need to reference it directly, not via sklearn.

confusion_matrix(goldLabel_array, predictions, sample_weight=None, labels=None)

and the same with your other calls.