Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5ba3633

Browse files
committed
Pushing the docs to dev/ for branch: master, commit 7eded0f6470a500172e44656f7ee6110965a3c56
1 parent3b1e1b7 commit5ba3633

File tree

1,189 files changed

+4194
-3866
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,189 files changed

+4194
-3866
lines changed
Binary file not shown.

‎dev/_downloads/3bc388ac00a41366cf48b6e294838489/plot_ols.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"cell_type":"markdown",
1616
"metadata": {},
1717
"source": [
18-
"\n# Linear Regression Example\n\nThis example uses the only the first feature of the `diabetes` dataset, in\norder to illustrate a two-dimensional plot of this regression technique. The\nstraight line can be seen in the plot, showing how linear regression attempts\nto draw a straight line that will best minimize the residual sum of squares\nbetween the observed responses in the dataset, and the responses predicted by\nthe linear approximation.\n\nThe coefficients, the residual sum of squares and thevariance score are also\ncalculated.\n"
18+
"\n# Linear Regression Example\n\nThis example uses the only the first feature of the `diabetes` dataset, in\norder to illustrate a two-dimensional plot of this regression technique. The\nstraight line can be seen in the plot, showing how linear regression attempts\nto draw a straight line that will best minimize the residual sum of squares\nbetween the observed responses in the dataset, and the responses predicted by\nthe linear approximation.\n\nThe coefficients, the residual sum of squares and thecoefficient\nof determination are also calculated.\n"
1919
]
2020
},
2121
{
@@ -26,7 +26,7 @@
2626
},
2727
"outputs": [],
2828
"source": [
29-
"print(__doc__)\n\n\n# Code source: Jaques Grobler\n# License: BSD 3 clause\n\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom sklearn import datasets, linear_model\nfrom sklearn.metrics import mean_squared_error, r2_score\n\n# Load the diabetes dataset\ndiabetes = datasets.load_diabetes()\n\n\n# Use only one feature\ndiabetes_X = diabetes.data[:, np.newaxis, 2]\n\n# Split the data into training/testing sets\ndiabetes_X_train = diabetes_X[:-20]\ndiabetes_X_test = diabetes_X[-20:]\n\n# Split the targets into training/testing sets\ndiabetes_y_train = diabetes.target[:-20]\ndiabetes_y_test = diabetes.target[-20:]\n\n# Create linear regression object\nregr = linear_model.LinearRegression()\n\n# Train the model using the training sets\nregr.fit(diabetes_X_train, diabetes_y_train)\n\n# Make predictions using the testing set\ndiabetes_y_pred = regr.predict(diabetes_X_test)\n\n# The coefficients\nprint('Coefficients: \\n', regr.coef_)\n# The mean squared error\nprint(\"Mean squared error: %.2f\"\n % mean_squared_error(diabetes_y_test, diabetes_y_pred))\n# Explained variance score: 1 is perfect prediction\nprint('Variance score: %.2f' % r2_score(diabetes_y_test, diabetes_y_pred))\n\n# Plot outputs\nplt.scatter(diabetes_X_test, diabetes_y_test, color='black')\nplt.plot(diabetes_X_test, diabetes_y_pred, color='blue', linewidth=3)\n\nplt.xticks(())\nplt.yticks(())\n\nplt.show()"
29+
"print(__doc__)\n\n\n# Code source: Jaques Grobler\n# License: BSD 3 clause\n\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom sklearn import datasets, linear_model\nfrom sklearn.metrics import mean_squared_error, r2_score\n\n# Load the diabetes dataset\ndiabetes = datasets.load_diabetes()\n\n\n# Use only one feature\ndiabetes_X = diabetes.data[:, np.newaxis, 2]\n\n# Split the data into training/testing sets\ndiabetes_X_train = diabetes_X[:-20]\ndiabetes_X_test = diabetes_X[-20:]\n\n# Split the targets into training/testing sets\ndiabetes_y_train = diabetes.target[:-20]\ndiabetes_y_test = diabetes.target[-20:]\n\n# Create linear regression object\nregr = linear_model.LinearRegression()\n\n# Train the model using the training sets\nregr.fit(diabetes_X_train, diabetes_y_train)\n\n# Make predictions using the testing set\ndiabetes_y_pred = regr.predict(diabetes_X_test)\n\n# The coefficients\nprint('Coefficients: \\n', regr.coef_)\n# The mean squared error\nprint('Mean squared error: %.2f'\n % mean_squared_error(diabetes_y_test, diabetes_y_pred))\n# The coefficient of determination: 1 is perfect prediction\nprint('Coefficient of determination: %.2f'\n % r2_score(diabetes_y_test, diabetes_y_pred))\n\n# Plot outputs\nplt.scatter(diabetes_X_test, diabetes_y_test, color='black')\nplt.plot(diabetes_X_test, diabetes_y_pred, color='blue', linewidth=3)\n\nplt.xticks(())\nplt.yticks(())\n\nplt.show()"
3030
]
3131
}
3232
],

‎dev/_downloads/525570147c5d8b2eba26233cf65c8da7/plot_ols.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
between the observed responses in the dataset, and the responses predicted by
1313
the linear approximation.
1414
15-
The coefficients, the residual sum of squares and thevariance score are also
16-
calculated.
15+
The coefficients, the residual sum of squares and thecoefficient
16+
of determination are alsocalculated.
1717
1818
"""
1919
print(__doc__)
@@ -55,10 +55,11 @@
5555
# The coefficients
5656
print('Coefficients:\n',regr.coef_)
5757
# The mean squared error
58-
print("Mean squared error: %.2f"
58+
print('Mean squared error: %.2f'
5959
%mean_squared_error(diabetes_y_test,diabetes_y_pred))
60-
# Explained variance score: 1 is perfect prediction
61-
print('Variance score: %.2f'%r2_score(diabetes_y_test,diabetes_y_pred))
60+
# The coefficient of determination: 1 is perfect prediction
61+
print('Coefficient of determination: %.2f'
62+
%r2_score(diabetes_y_test,diabetes_y_pred))
6263

6364
# Plot outputs
6465
plt.scatter(diabetes_X_test,diabetes_y_test,color='black')
Binary file not shown.

‎dev/_downloads/scikit-learn-docs.pdf

-8.25 KB
Binary file not shown.

‎dev/_images/iris.png

0 Bytes
-395 Bytes
-113 Bytes
-113 Bytes
-87 Bytes
47 Bytes
47 Bytes
23 Bytes
71 Bytes
-135 Bytes
-47 Bytes
159 Bytes
49 Bytes
49 Bytes
-209 Bytes
-209 Bytes
-33 Bytes
-33 Bytes
-62 Bytes
-62 Bytes
30 Bytes
30 Bytes
185 Bytes
185 Bytes
26 Bytes
26 Bytes
33 Bytes
-276 Bytes
134 Bytes
134 Bytes
-150 Bytes
680 Bytes
169 Bytes
-718 Bytes
-392 Bytes
-13 Bytes
-13 Bytes
-146 Bytes
-19 Bytes

‎dev/_sources/auto_examples/applications/plot_face_recognition.rst.txt

Lines changed: 17 additions & 17 deletions

‎dev/_sources/auto_examples/applications/plot_model_complexity_influence.rst.txt

Lines changed: 15 additions & 15 deletions

‎dev/_sources/auto_examples/applications/plot_out_of_core_classification.rst.txt

Lines changed: 30 additions & 30 deletions

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp