generated from just-the-docs/just-the-docs-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from abarton51/musicnet_preprocessing
Musicnet preprocessing
- Loading branch information
Showing
14 changed files
with
240 additions
and
3 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import numpy as np | ||
import os | ||
import sys | ||
from sklearn.tree import DecisionTreeClassifier | ||
from sklearn.ensemble import RandomForestClassifier | ||
|
||
path = 'src/musicNet/processed_data' | ||
X_train = np.load(path + '/train_data_midi.npy') | ||
X_test = np.load(path + '/test_data_midi.npy') | ||
y_train = np.load(path + '/train_labels_midi.npy') | ||
y_test = np.load(path + '/test_labels_midi.npy') | ||
|
||
dt_clf = DecisionTreeClassifier(random_state=42) | ||
|
||
dt_clf.fit(X_train, y_train) | ||
training_accuracy = dt_clf.score(X_train, y_train) | ||
accuracy = dt_clf.score(X_test, y_test) | ||
print(training_accuracy) | ||
print(accuracy) | ||
|
||
rf_clf = RandomForestClassifier(random_state=42, max_features=512, n_estimators=100) | ||
|
||
rf_clf.fit(X_train, y_train) | ||
training_accuracy = rf_clf.score(X_train, y_train) | ||
accuracy = rf_clf.score(X_test, y_test) | ||
print(training_accuracy) | ||
print(accuracy) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.