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 - ask about simultaneous progress
- python 3x - about the position of the label of python3 tkinter label frame
- python - about [email protected]
- python - about raising the decimal point
- python - about break statement
- i want to know more about python return values
- python - i would like to ask about the handling of variables in for
- about python shortcuts
- about python if statement processing
- python - about exchanging data with aws s3+rds
- python - about for variables in for
- [python] i have a question about writing to a csv file in dictionary format
- python - about securing capacity of system installation destination in virtual environment (virtual box)
- about python environment construction
- Talking about modules in Python
- about regular expressions including python html tags
- python - i would like to know about how the ngram code works
- error about python module import
- python - about mute detection in discordpy
- python - about django mail transmission setting method
- 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
- android studio - emulator: dsound: could not initialize about the error message directsoundcapture
- android studio - unresolved reference comes out in kotlin
- vuejs - [vuetify] unable to locate target [data-app] i want to unit test to avoid warning
- django - oserror: [winerror 123] the file name, directory name, or volume label syntax is incorrect : '<frozen importlib_boot
- mysql startup failed [error] innodb: the innodb_system data file 'ibdata1' must be writable
- python 3x - import error "cannot import name '_imaging'"