How do I plot Linear Regression?
问题 I wish to learn how to use Plotly with Python for data analysis. I have been using this website as reference. My current code looks like this: from plotly import tools import plotly as py import plotly.graph_objs as go py.offline.init_notebook_mode(connected=True) # Create linear regression object regr = linear_model.LinearRegression() # Train the model using the training sets regr.fit(X_train, y_train) p1 = go.Scatter(x=X_test, y=y_test, mode='markers', marker=dict(color='black') ) p2 = go