Skip to content

Instantly share code, notes, and snippets.

@dataprofessor
Created August 14, 2020 17:15
Show Gist options
  • Select an option

  • Save dataprofessor/5010a35a813e9271e1e104059ea735c9 to your computer and use it in GitHub Desktop.

Select an option

Save dataprofessor/5010a35a813e9271e1e104059ea735c9 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "04-linear-model.ipynb",
"provenance": [],
"collapsed_sections": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "code",
"metadata": {
"id": "K0MokzGBCimk",
"colab_type": "code",
"colab": {}
},
"source": [
"from sklearn import linear_model\n",
"from sklearn.metrics import mean_squared_error, r2_score"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "vkR1siPuFZ6X",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 34
},
"outputId": "e20472e7-0179-419f-8dc8-8710cfd008cc"
},
"source": [
"model = linear_model.LinearRegression()\n",
"model.fit(X_train, Y_train)"
],
"execution_count": null,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"LinearRegression(copy_X=True, fit_intercept=True, n_jobs=None, normalize=False)"
]
},
"metadata": {
"tags": []
},
"execution_count": 25
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment