application_vnd.jupyter.stderr_output_1.png
from plotly.subplots import make_subplots

from sklearn.discriminant_analysis import LinearDiscriminantAnalysis

import pandas as pd

import plotly.express as px

import plotly.graph_objects as go

glass = pd.read_csv('/kaggle/input/glass/glass.csv')

fig = px.scatter(glass, x="Mg", y="Fe", color='Type', 
                 color_continuous_scale='portland')
fig.show()

from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
lda_model = LinearDiscriminantAnalysis()
lda_model.fit(X, y)
fig = make_subplots(rows=1, cols=1)
fig.add_trace(go.Contour(x=X['Mg'], y=X['Fe'], z=lda_model.predict(X), showscale=False, opacity=0.4, colorscale='portland'), row=1, col=1)
fig.add_trace(go.Scatter(x=X['Mg'], y=X['Fe'], text=y, mode='markers', marker_symbol=y, marker=dict(color=y, colorscale='portland')), row=1, col=1)
fig.update_layout(showlegend=False)
fig.show()