Module Expr Str Print NameLoad Import alias identifier Import alias identifier ImportFrom alias alias Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad NameLoad Slice Num Assign NameStore SubscriptLoad NameLoad Slice Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Num Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Print TupleLoad Str AttributeLoad NameLoad attr Print BinOpMod Str Call AttributeLoad NameLoad attr BinOpPow BinOpSub Call AttributeLoad NameLoad attr NameLoad NameLoad Num Print BinOpMod Str Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword Str Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad keyword Str keyword Num Expr Call AttributeLoad NameLoad attr TupleLoad Expr Call AttributeLoad NameLoad attr TupleLoad Expr Call AttributeLoad NameLoad attr
N/A N/A 
=========================================================
Linear Regression Example
=========================================================
This example uses the only the first feature of the `diabetes` dataset, in
order to illustrate a two-dimensional plot of this regression technique. The
straight line can be seen in the plot, showing how linear regression attempts
to draw a straight line that will best minimize the residual sum of squares
between the observed responses in the dataset, and the responses predicted by
the linear approximation.

The coefficients, the residual sum of squares and the variance score are also
calculated.

 N/A __doc__ N/A matplotlib.pyplot plt N/A numpy np sklearn datasets linear_model N/A diabetes N/A N/A datasets load_diabetes N/A diabetes_X N/A N/A diabetes data N/A N/A N/A N/A np newaxis N/A 2 N/A diabetes_X_train N/A diabetes_X N/A -20 N/A diabetes_X_test N/A diabetes_X N/A -20 N/A diabetes_y_train N/A N/A diabetes target N/A -20 N/A diabetes_y_test N/A N/A diabetes target N/A -20 N/A regr N/A N/A linear_model LinearRegression N/A N/A N/A regr fit diabetes_X_train diabetes_y_train N/A N/A Coefficients: 
 N/A regr coef_ N/A N/A Mean squared error: %.2f N/A N/A np mean N/A N/A N/A N/A regr predict diabetes_X_test diabetes_y_test 2 N/A N/A Variance score: %.2f N/A N/A regr score diabetes_X_test diabetes_y_test N/A N/A N/A plt scatter diabetes_X_test diabetes_y_test color black N/A N/A N/A plt plot diabetes_X_test N/A N/A regr predict diabetes_X_test color blue linewidth 3 N/A N/A N/A plt xticks N/A N/A N/A N/A plt yticks N/A N/A N/A N/A plt show