mglearn.discrete_scatter (X [:, 0], X [:, 1], y, ax = ax)
Can you tell me the meaning of the above code in detail?
The first argument X [:, 0] represents the X axis, all values of X and the y = 0 part,
Does the second argument X [:, 1] represent the y-axis and represents all values of X and y = 1?
The third argument is the title, right? Is y the title?
Can the last ax = ax have the axis as a column?
Answer # 1
X [:, 0], X [:, 1]
Each XY coordinate value. It ’s taken out in slices. This is the basic of numpy and should be remembered.
>>>import numpy as np >>>a = np.array ([[1,2,3], [4,5,6]]) >>>a  array ([1, 2, 3]) >>>a  array ([4, 5, 6]) >>>a [:, 0] array ([1, 4]) >>>a [:, 1] array ([2, 5]) >>>a [:, 2] array ([3, 6])
What are the labels for each point? Why did you think it was a title? What information are you referring to?
ax = ax
axmeans that such a keyword argument is in
mglearn.discrete_scatter (). The
axon the right is an object created externally.
As a specific operation, you can draw an instance of matplotlib axes by passing it.
Python-discrete_scatter and legend in mglearn (99285) | StackOverflow
python-About the meaning of mglearn.discrete_scatter (X_train [:, 0], X_train [:, 1], y_train)-stack overflow
Answer # 2
The first argument indicates the X value on the graph, and the second argument indicates the Y value on the graph.
The third argument is not y, but the same graph is shown even if it is 1.
It seems that it was a command about the setting on the graph.
I looked at only the correction request, and quickly picked it up and solved it by google, but I got the answer below.
I rushed to resolve myself, but the content of the person who answered was more accurate than the content of my self solution. .
I would like to deepen my understanding by reading the answers.
Thank you for this time.
- python 3x - about iterative processing when the number of data of python scraping destination is unknown
- python 3x - about matplotlib pylab
- python: about list arguments
- python - [django] about access from another terminal in lan
- python - about the list when calling a function in another file
- python - about keras maxpooling2d
- python - about a problem of satcoder agc39
- [python] about atcoder arc006b
- python - about the error "allocation of 536870912 exceeds 10% of system memory" when learning cnn
- [python] about aoj-0105 book index
- about list behavior in python
- python - about tkinter line creation (?)
- about installing python on mac
- about sum (axis=1) of python pandas
- about errors in games made with python
- tell me about python iteration statements
- about repeated operations in python for statement
- python - about variable errors
- python 3x - about editing dom acquired by beautiful soup
- about the problem that float subtraction does not work in numerical calculation in python
- python 3x - typeerror: 'method' object is not subscriptable
- python - you may need to restart the kernel to use updated packages error
- xcode - pod install [!] no `podfile 'found in the project directory
- vuejs - [vuetify] unable to locate target [data-app] i want to unit test to avoid warning
- android studio - emulator: dsound: could not initialize about the error message directsoundcapture
- android studio - unresolved reference comes out in kotlin
- mysql startup failed [error] innodb: the innodb_system data file 'ibdata1' must be writable
- django - oserror: [winerror 123] the file name, directory name, or volume label syntax is incorrect : '<frozen importlib_boot
- python - importerror: cannot import name md5 error cannot be resolved