I am not sure how to make the confusion matrix. I understand I need to use one
Fantastic news! We've Found the answer you've been seeking!
Question:
I am not sure how to make the confusion matrix. I understand I need to use one output but I do not understand where to state that one output behind y_test as y_test has more than one variable that could be used.
Transcribed Image Text:
# Classification report from sklearn.metrics import classification_report # Confusion matrix from sklearn.metrics import confusion_matrix cm = confusion_matrix(y_test, predictions) cr = classification_report(y_test, predictions) print (cm) ValueError in 7 from sklearn.metrics import confusion_matrix 8 --> 9 cm = confusion_matrix(y_test, predictions) 10 11 cr= classification_report (y_test, predictions) C:\ProgramData\Anaconda3\lib\site-packages\sklearn\utils\validation.py 71 72 ---> 73 74 75 Traceback (most recent call last) _weight, normalize) 274 275 --> 276 C:\ProgramData\Anaconda3\lib\site-packages\sklearn\metrics_classification.py in confusion_matrix(y_true, y pred, labels, sample 277 278 in inner_f(*args, **kwargs) FutureWarning) kwargs.update({k: arg for k, arg in zip (sig.parameters, args)}) return f(**kwargs) return inner_f 96 97 ---> 98 99 100 y type, y_true, y_pred = _check_targets (y_true, y_pred) if y_type not in ("binary", "multiclass"): raise ValueError("%s is not supported" % y_type) C:\ProgramData\Anaconda3\lib\site-packages\sklearn\metrics\_classification.py in _check_targets(y_true, y_pred) # No metrics support "multiclass-multioutput" format if (y_type not in ["binary", "multiclass", "multilabel-indicator"]): raise ValueError ("{0} is not supported".format(y_type)) if y_type in ["binary", "multiclass"]: ValueError: multiclass-multioutput is not supported # Classification report from sklearn.metrics import classification_report # Confusion matrix from sklearn.metrics import confusion_matrix cm = confusion_matrix(y_test, predictions) cr = classification_report(y_test, predictions) print (cm) ValueError in 7 from sklearn.metrics import confusion_matrix 8 --> 9 cm = confusion_matrix(y_test, predictions) 10 11 cr= classification_report (y_test, predictions) C:\ProgramData\Anaconda3\lib\site-packages\sklearn\utils\validation.py 71 72 ---> 73 74 75 Traceback (most recent call last) _weight, normalize) 274 275 --> 276 C:\ProgramData\Anaconda3\lib\site-packages\sklearn\metrics_classification.py in confusion_matrix(y_true, y pred, labels, sample 277 278 in inner_f(*args, **kwargs) FutureWarning) kwargs.update({k: arg for k, arg in zip (sig.parameters, args)}) return f(**kwargs) return inner_f 96 97 ---> 98 99 100 y type, y_true, y_pred = _check_targets (y_true, y_pred) if y_type not in ("binary", "multiclass"): raise ValueError("%s is not supported" % y_type) C:\ProgramData\Anaconda3\lib\site-packages\sklearn\metrics\_classification.py in _check_targets(y_true, y_pred) # No metrics support "multiclass-multioutput" format if (y_type not in ["binary", "multiclass", "multilabel-indicator"]): raise ValueError ("{0} is not supported".format(y_type)) if y_type in ["binary", "multiclass"]: ValueError: multiclass-multioutput is not supported
Expert Answer:
Related Book For
Fundamentals of Cost Accounting
ISBN: 978-0077398194
3rd Edition
Authors: William Lanen, Shannon Anderson, Michael Maher
Posted Date:
Students also viewed these algorithms questions
-
The following table summarizes a data set with three attributes A, B, C and two class labels +, . Build a two-level decision tree. (a) According to the classification error rate, which attribute...
-
I thought evaluating performance would be easier than this. I have three vice presidents, operating the same business in three different countries. I need to be able to compare them in order to...
-
In Exercises 912, use the given conditions to write an equation for each line in point-slope form and general form Passing through (4, -7) and perpendicular to the line whose equation is x - 2y - 3 =...
-
In an RLC circuit a second capacitor is added in series to the capacitor already present. (a) Does the resonance frequency increase, decrease, or stay the same? (b) Choose the best explanation from...
-
The statement of financial position of Bagley Incorporated as at July 31, Year 4, is as follows: On August 1, Year 4, the directors of Bagley considered a takeover offer from Davis Inc., whereby the...
-
Two streams, each containing \(0.5 \mathrm{lb} / \mathrm{hr}\) steam at \(550 \mathrm{psia}\), are mixed as shown in Figure 10.29: (a) Compute the heat loss to an environmental reservoir at...
-
Here are some numbers that you can use to sharpen your computational skills for sample size determination. Crest Toothpaste is reviewing plans for its annual survey of toothpaste purchasers. With...
-
Write 4 paragraphs about 'modes of communication in Blackberry' with citation and references in APA style.
-
A cancer specialist from the Los Angeles County General Hospital (LACGH) rated patient optimism in 20 to 40 year old patients with incurable cancer in 1970. In 1990, the researcher examined hospital...
-
Given the following graph of the function y = f(z) and n=6, answer the following questions about the area under the curve from z=0 to z = 6. 1. Use the Trapezoidal Rule to estimate the area. Answer....
-
determine how you could check the numbers in the financial reports are correct for food and drinks?
-
What strategies can businesses employ to facilitate effective training and smooth adoption of computerized accounting systems by their staff? How can organizations balance the need for user-friendly...
-
describe how mision statement of non profit organizations is difrent from profit ones?please explain in your own wording.
-
Examine the real options approach in capital budgeting and its relevance in valuing flexibility in investment decisions. How does this technique capture the value of managerial choices in uncertain...
-
Solve the formula 7x - 8y = -12 for y.
-
Write a bash shell script which calculate BMI (Body Mass Intensive). The BMI formula uses your weight (in kg or pounds) and your height (in meters or inches) to form a simple calculation that...
-
Use nodal analysis to determine voltages v1, v2, and v3 in the circuit Fig. 3.76. Figure 3.76 4 S 3i, 2 A 4A
-
The controller of Northwest Hardware has just received two forecasts for sales in the Montana District for the coming year. Based on an econometric analysis of consumer spending and economic trends,...
-
Below are various activities for a commercial loan company. Required Suggest a feasible cost driver base for each of the following, and explain why each selected cost driver base is feasible. a....
-
Odd Wallow Drinks is considering adding a new line of fruit juices to its merchandise products. This line of juices has the following prices and costs: Selling price per case (24 bottles) of juice ....
-
Deliberate the need for transformational or collaborative leadership in the next 5 years as the health care environment transforms as a result of industry reform.
-
It has been stated that to lead people through the complex changes facing the health care industry, transformational leadership is required (i.e., leaders creating an environment in which staff can...
-
If you were the director of a major department in a health care company, how important would each of the following activities be to you? Answer yes or no to indicate whether you would strive to...
Study smarter with the SolutionInn App