Skip to content

Commit 84f65b9

Browse files
committed
Merge branch 'master' of https://github.com/ddbourgin/numpy-ml into master
2 parents a8feec0 + 9ef025f commit 84f65b9

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

numpy_ml/ngram/ngram.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ def train(self, corpus_fp, vocab=None, encoding=None):
506506
Specifies the text encoding for corpus. Common entries are 'utf-8',
507507
'utf-8-sig', 'utf-16'. Default is None.
508508
"""
509-
self._train(corpus_fp, vocab=None, encoding=None)
509+
self._train(corpus_fp, vocab=vocab, encoding=encoding)
510510
self._calc_smoothed_counts()
511511

512512
def log_prob(self, words, N):

numpy_ml/plots/gmm_plots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def plot():
8484
# take best fit over 10 runs
8585
best_elbo = -np.inf
8686
for k in range(10):
87-
_G = GMM(C=n_classes, seed=i * 3)
87+
_G = GMM(C=n_classes, seed=k * 3)
8888
ret = _G.fit(X, max_iter=100, verbose=False)
8989
while ret != 0:
9090
print("Components collapsed; Refitting")

numpy_ml/tests/test_preprocessing.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
from sklearn.preprocessing import StandardScaler
1111
from sklearn.feature_extraction.text import TfidfVectorizer
1212

13-
from librosa.core.time_frequency import fft_frequencies
13+
try:
14+
from librosa.core.time_frequency import fft_frequencies
15+
except ImportError:
16+
# for librosa >= 0.8.0
17+
from librosa import fft_frequencies
1418
from librosa.feature import mfcc as lr_mfcc
1519
from librosa.util import frame
1620
from librosa.filters import mel

requirements-test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ tensorflow
77
keras
88
gym
99
huffman
10-
librosa
10+
librosa>=0.8.0
1111
nltk
1212
hmmlearn
1313
tox

0 commit comments

Comments
 (0)