Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
tap1012
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
tap1012
Commits
5b878ae9
Commit
5b878ae9
authored
Mar 27, 2019
by
Alejandro Molina Villegas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
práctica 7 concluida
parent
c2889862
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
07-LinearAlgebra&Learning.ipynb
07-LinearAlgebra&Learning.ipynb
+11
-6
No files found.
07-LinearAlgebra&Learning.ipynb
View file @
5b878ae9
...
@@ -367,7 +367,9 @@
...
@@ -367,7 +367,9 @@
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 56,
"execution_count": 56,
"metadata": {},
"metadata": {
"scrolled": false
},
"outputs": [
"outputs": [
{
{
"data": {
"data": {
...
@@ -834,7 +836,7 @@
...
@@ -834,7 +836,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
1
,
"execution_count":
2
,
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
{
{
...
@@ -843,13 +845,14 @@
...
@@ -843,13 +845,14 @@
"0.98"
"0.98"
]
]
},
},
"execution_count":
1
,
"execution_count":
2
,
"metadata": {},
"metadata": {},
"output_type": "execute_result"
"output_type": "execute_result"
}
}
],
],
"source": [
"source": [
"# Cada estimador (clasificador) debe exponer un método \"score\" que nos indica la calidad de predicción.\n",
"# Cada estimador (clasificador) debe exponer un método\n",
"# \"score\" que nos indica la calidad de predicción.\n",
"\n",
"\n",
"from sklearn import datasets, svm\n",
"from sklearn import datasets, svm\n",
"\n",
"\n",
...
@@ -857,7 +860,8 @@
...
@@ -857,7 +860,8 @@
"X_digits = digits.data\n",
"X_digits = digits.data\n",
"y_digits = digits.target\n",
"y_digits = digits.target\n",
"svc = svm.SVC(C=1, kernel='linear')\n",
"svc = svm.SVC(C=1, kernel='linear')\n",
"svc.fit(X_digits[:-100], y_digits[:-100]).score(X_digits[-100:], y_digits[-100:])\n"
"svc.fit(X_digits[:-100], y_digits[:-100])\n",
"svc.score(X_digits[-100:], y_digits[-100:])\n"
]
]
},
},
{
{
...
@@ -874,7 +878,8 @@
...
@@ -874,7 +878,8 @@
}
}
],
],
"source": [
"source": [
"# Para tener una mejor estimación del modelo, podemos dividir los datos que usamos para entrenamiento y test.\n",
"# Para tener una mejor estimación del modelo,\n",
"# podemos dividir los datos que usamos para entrenamiento y test.\n",
"# A esto se le llama validación cruzada\n",
"# A esto se le llama validación cruzada\n",
"import numpy as np\n",
"import numpy as np\n",
"\n",
"\n",
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment