Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
musicinformationretrieval-com
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
0
Merge Requests
0
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
A.S.
musicinformationretrieval-com
Commits
9ff1f5c3
Commit
9ff1f5c3
authored
Jun 22, 2014
by
Leigh Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made naming of labels more meaningful
parent
930d6b40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
knn.ipynb
notebooks/knn.ipynb
+17
-17
No files found.
notebooks/knn.ipynb
View file @
9ff1f5c3
{
"metadata": {
"name": "",
"signature": "sha256:
71d5625f02dc9a007822fd62b88f49f1c98c1cf810f2adee13ab71053bbf59d5
"
"signature": "sha256:
6bc45d7d702f477a92150907ff7b603393084a9cb41c05f77a201d080fa1e30f
"
},
"nbformat": 3,
"nbformat_minor": 0,
...
...
@@ -48,16 +48,16 @@
"outputs": [
{
"ename": "NameError",
"evalue": "name 'features
S
nare' is not defined",
"evalue": "name 'features
_s
nare' is not defined",
"output_type": "pyerr",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-
1-a6846594904c>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mscaler\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpreprocessing\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mMinMaxScaler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfeature_range\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 5\u001b[0;31m \u001b[0mtrainingFeatures\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mscaler\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfit_transform\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconcatenate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfeaturesSnare\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfeaturesK
ick\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mNameError\u001b[0m: name 'features
S
nare' is not defined"
"\u001b[0;32m<ipython-input-
9-48852d445498>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mscaler\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpreprocessing\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mMinMaxScaler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfeature_range\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 5\u001b[0;31m \u001b[0mtraining_features\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mscaler\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfit_transform\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconcatenate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfeatures_snare\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfeatures_k
ick\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mNameError\u001b[0m: name 'features
_s
nare' is not defined"
]
}
],
"prompt_number":
1
"prompt_number":
9
},
{
"cell_type": "markdown",
...
...
@@ -77,7 +77,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number":
2
"prompt_number":
6
},
{
"cell_type": "markdown",
...
...
@@ -90,10 +90,10 @@
"cell_type": "code",
"collapsed": false,
"input": [
"labels = np.empty(20, np.int32)\n",
"labels[0:9] = 1 # First 10 are the first sample type, e.g. snare\n",
"labels[10:20] = 2 # Second 10 are the second sample type, e.g kick\n",
"labels"
"
drum_
labels = np.empty(20, np.int32)\n",
"
drum_
labels[0:9] = 1 # First 10 are the first sample type, e.g. snare\n",
"
drum_
labels[10:20] = 2 # Second 10 are the second sample type, e.g kick\n",
"
drum_
labels"
],
"language": "python",
"metadata": {},
...
...
@@ -101,13 +101,13 @@
{
"metadata": {},
"output_type": "pyout",
"prompt_number":
3
,
"prompt_number":
4
,
"text": [
"array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], dtype=int32)"
]
}
],
"prompt_number":
3
"prompt_number":
4
},
{
"cell_type": "markdown",
...
...
@@ -120,23 +120,23 @@
"cell_type": "code",
"collapsed": false,
"input": [
"model_snare.fit(training_features, labels)"
"model_snare.fit(training_features,
drum_
labels)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'training
F
eatures' is not defined",
"evalue": "name 'training
_f
eatures' is not defined",
"output_type": "pyerr",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-
4-a41b13b7e64c>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mmodel_snare\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtrainingFeatures\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m
labels\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mNameError\u001b[0m: name 'training
F
eatures' is not defined"
"\u001b[0;32m<ipython-input-
8-d86eaf5a2bd0>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mmodel_snare\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtraining_features\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdrum_
labels\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mNameError\u001b[0m: name 'training
_f
eatures' is not defined"
]
}
],
"prompt_number":
4
"prompt_number":
8
},
{
"cell_type": "markdown",
...
...
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