-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add feature extraction & comments & traditional methods
- Loading branch information
1 parent
8f55b70
commit abf130a
Showing
13 changed files
with
129 additions
and
36 deletions.
There are no files selected for viewing
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.
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
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
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,20 @@ | ||
from sklearn.naive_bayes import GaussianNB | ||
|
||
import sys | ||
sys.path.append('/home/shin/mlp') | ||
|
||
from data_loader import MnistLoader | ||
|
||
def NB(): | ||
loader = MnistLoader(flatten=True, data_path='../data', var_per=None) | ||
model = GaussianNB() | ||
|
||
model.fit(loader.data_train, loader.label_train) | ||
print('model trained') | ||
res = model.score(loader.data_test, loader.label_test) | ||
print(res) | ||
|
||
return res | ||
|
||
if __name__ == '__main__': | ||
NB() |
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,20 @@ | ||
from sklearn.linear_model import SGDClassifier | ||
|
||
import sys | ||
sys.path.append('/home/shin/mlp') | ||
|
||
from data_loader import MnistLoader | ||
|
||
def SGD(): | ||
loader = MnistLoader(flatten=True, data_path='../data', var_per=None) | ||
model = SGDClassifier(max_iter=30000) | ||
|
||
model.fit(loader.data_train, loader.label_train) | ||
print('model trained') | ||
res = model.score(loader.data_test, loader.label_test) | ||
print(res) | ||
|
||
return res | ||
|
||
if __name__ == '__main__': | ||
SGD() |
Empty file.
Empty file.
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
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