42 - Introduction to Seaborn Plotting in Python

  Рет қаралды 5,073

DigitalSreeni

DigitalSreeni

Күн бұрын

Пікірлер: 9
@finnmccool8671
@finnmccool8671 5 жыл бұрын
I've watched only a couple of your videos so far and have found them very helpful and succinct. I will be watching more in the future!
@DigitalSreeni
@DigitalSreeni 5 жыл бұрын
Thanks Finn, the feedback definitely encourages me to create more videos.
@iwilld0it
@iwilld0it 20 күн бұрын
Ok further analysis, you can do it with lmplot this way lmp = sns.lmplot(x='Manual', y='Auto_th_2', data=df, hue='Image_set') ax = lmp.axes[0, 0] line = ax.get_lines()[0] xdata = line.get_xdata() ydata = line.get_ydata() slope = (ydata[1] - ydata[0]) / (xdata[1] - xdata[0]) intercept = ydata[0] - slope * xdata[0] This example only looks at the first line, but get_lines() can be any number of lines, especially if you set the hue
@felip6180
@felip6180 4 жыл бұрын
Quite amazing tutorial and tool this seaborn! I've got curious about one thing. Does seaborn has a residual plot function? I mean, if I input the data, regress it, is there a possibility of it showing a plot of the residual values?
@DigitalSreeni
@DigitalSreeni 4 жыл бұрын
Yes, I believe so. Check the documentation.... seaborn.pydata.org/generated/seaborn.residplot.html
@felip6180
@felip6180 4 жыл бұрын
@@DigitalSreeni Thank you very much!
@DigitalSreeni
@DigitalSreeni 4 жыл бұрын
You’re welcome 😇
@iwilld0it
@iwilld0it 20 күн бұрын
regplot appears to be the same regression line. Maybe this works? ax = sns.regplot(x='Manual', y='Auto_th_2', data=df) line = ax.get_lines()[0] xdata = line.get_xdata() ydata = line.get_ydata() slope = (ydata[1] - ydata[0]) / (xdata[1] - xdata[0]) intercept = ydata[0] - slope * xdata[0]
@chrisphayao
@chrisphayao Жыл бұрын
ChatGPT told me that seaborn doesn't provide the underlying equation for lmplot - there is an indirect way to find that out - but your way is easier ! import seaborn as sns import statsmodels.formula.api as smf # Generate a scatter plot with a regression line using lmplot sns.set(style="ticks") tips = sns.load_dataset("tips") lm = sns.lmplot(x="total_bill", y="tip", data=tips) # Extract the data from the lmplot figure x_data = lm.ax.collections[0].get_offsets()[:, 0] y_data = lm.ax.collections[0].get_offsets()[:, 1] # Fit a linear regression model using statsmodels model = smf.ols(formula='y ~ x', data=pd.DataFrame({'x': x_data, 'y': y_data})).fit() # Extract the coefficients from the model intercept = model.params['Intercept'] slope = model.params['x'] # Build the equation equation = f"y = {slope:.2f} * x + {intercept:.2f}" print(equation)
104 - Ridge Filters to detect tube like structures in images
5:25
DigitalSreeni
Рет қаралды 8 М.
36 - Introduction to Pandas - Data reading and handling
22:59
DigitalSreeni
Рет қаралды 6 М.
Car Bubble vs Lamborghini
00:33
Stokes Twins
Рет қаралды 44 МЛН
СКОЛЬКО ПАЛЬЦЕВ ТУТ?
00:16
Masomka
Рет қаралды 2,9 МЛН
КОГДА К БАТЕ ПРИШЕЛ ДРУГ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 8 МЛН
Matplotlib Full Python Course - Data Science Fundamentals
1:02:41
NeuralNine
Рет қаралды 153 М.
45 - Linear regression using Sci-Kit Learn in Python
25:20
DigitalSreeni
Рет қаралды 9 М.
Introduction to Dash Plotly - Data Visualization in Python
29:21
Charming Data
Рет қаралды 800 М.
37 - Introduction to Pandas - Data Manipulation
15:05
DigitalSreeni
Рет қаралды 4 М.
This Is Why Python Data Classes Are Awesome
22:19
ArjanCodes
Рет қаралды 814 М.
50 - What is k-means clustering and how to code it in Python?
16:55
DigitalSreeni
Рет қаралды 13 М.
44 - What is linear regression?
16:56
DigitalSreeni
Рет қаралды 6 М.
Exploratory Data Analysis with Pandas Python
40:22
Rob Mulla
Рет қаралды 497 М.
Car Bubble vs Lamborghini
00:33
Stokes Twins
Рет қаралды 44 МЛН