Your input to confusion_matrix
must be an array of int not one hot encodings.
matrix = metrics.confusion_matrix(y_test.argmax(axis=1), y_pred.argmax(axis=1))
Related Posts:
- No module named ‘sklearn.cross_validation’
- ImportError: No module named ‘tensorflow.python’
- How to fix ‘Object arrays cannot be loaded when allow_pickle=False’ for imdb.load_data() function?
- ValueError: Unknown label type: ‘continuous’
- Converting list to numpy array
- sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)
- sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)
- TypeError: cannot perform reduce with flexible type
- sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)
- How to normalize a NumPy array to a unit vector?
- ModuleNotFoundError: No module named ‘sklearn’
- Arrays used as indices must be of integer (or boolean) type
- How can I plot a confusion matrix? [duplicate]
- ModuleNotFoundError: No module named ‘sklearn’
- How to normalize a NumPy array to a unit vector?
- Keras, how do I predict after I trained a model?
- Can I run Keras model on gpu?
- What is the difference between sparse_categorical_crossentropy and categorical_crossentropy?
- Where do I call the BatchNormalization function in Keras?
- LSTM Keras input shape confusion
- Arrays used as indices must be of integer (or boolean) type
- Issues using Keras np_utils.to_categorical
- sklearn Logistic Regression “ValueError: Found array with dim 3. Estimator expected <= 2."
- RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility
- Difference between scikit-learn and sklearn
- TensorFlow: Blas GEMM launch failed
- AttributeError: ‘Tensor’ object has no attribute ‘_keras_history’
- What’s the difference between scikit-learn and tensorflow? Is it possible to use them together?
- How to fix “AttributeError: module ‘tensorflow’ has no attribute ‘get_default_graph'”?
- ImportError: cannot import name np_utils
- getting ValueError : “Can only tuple-index with a MultiIndex “
- Scikit-learn GridSearch giving “ValueError: multiclass format is not supported” error
- NaN loss when training regression network
- ImportError in importing from sklearn: cannot import name check_build
- Tensorflow 2.0 – AttributeError: module ‘tensorflow’ has no attribute ‘Session’
- Can sklearn random forest directly handle categorical features?
- ImportError: No module named model_selection
- how to check which version of nltk, scikit learn installed?
- Got continuous is not supported error in RandomForestRegressor
- Python/Scikit-Learn – Can’t handle mix of multiclass and continuous
- ValueError: multiclass format is not supported
- How can I reverse a list in Python?
- How to use filter, map, and reduce in Python 3
- numpy matrix vector multiplication
- whitespace in regular expression
- How do I read CSV data into a record array in NumPy?
- Basic explanation of python functions
- TypeError: ‘Series’ objects are mutable, thus they cannot be hashed problemwith column
- How to rename a file using Python
- Cosine Similarity between 2 Number Lists
- How to install python3 version of package via pip on Ubuntu?
- django: TypeError: ‘tuple’ object is not callable
- ValueError: Length of values does not match length of index | Pandas DataFrame.unique()
- unhashable type: ‘dict’ Type Error [duplicate]
- How to check whether a str(variable) is empty or not?
- Clear variable in python
- Python 3.6.0 syntax error “Missing parentheses in call to ‘print’ [duplicate]
- How to get coverage reporting when testing a pytest plugin?
- TypeError: method() takes 1 positional argument but 2 were given
- is not JSON serializable
- Tkinter understanding mainloop
- How can I rename a conda environment?
- django import error – No module named core.management
- How to change a ‘LinearSegmentedColormap’ to a different distribution of color?
- Using python’s eval() vs. ast.literal_eval()
- How can I stop a While loop?
- Pandas: change data type of Series to String
- Why do I get a “referenced before assignment” error when assigning to a global variable in a function?
- What does ‘index 0 is out of bounds for axis 0 with size 0’ mean?
- Generate random colors (RGB)
- Python import csv to list
- python SyntaxError: invalid syntax %matplotlib inline
- Count the number of occurrences of a character in a string
- Why does using from __future__ import print_function breaks Python2-style print?
- Download large file in python with requests
- Count unique values per groups with Pandas [duplicate]
- Parallel Python: What is a callback?
- ImportError: libGL.so.1: cannot open shared object file: No such file or directory
- ImportError: No module named Crypto.Cipher
- Not able to pip install pickle in python 3.6
- How to print Unicode character in Python?
- Coalesce values from 2 columns into a single column in a pandas dataframe
- Unknown format code ‘f’ for object of type ‘str’- Folium
- Pyinstaller setting icons don’t change
- No module named ‘tqdm’
- Can not click on a Element: ElementClickInterceptedException in Splinter / Selenium
- How to split elements of a list?
- How can I find script’s directory?
- Porting Perl to Python
- Find object in list that has attribute equal to some value (that meets any condition)
- What is the purpose of the single underscore “_” variable in Python?
- Must have equal len keys and value when setting with an iterable
- print(__doc__) in Python 3 script
- Convert a 1D array to a 2D array in numpy
- ‘module’ has no attribute ‘urlencode’
- Cannot concatenate ‘str’ and ‘float’ objects?
- Python Text Menu Infinite Loop
- Install pip for python 3.5
- How do I represent and work with n-bit vectors in Python?
- How to repeat individual characters in strings in Python