Skip to content
Browse files

COSMIT pep8

  • Loading branch information...
1 parent fcad90d commit e42e5305e61b200231d92ebdf4cc78e9f3933b05 Andreas Mueller committed Mar 4, 2013
Showing with 4 additions and 3 deletions.
  1. +3 −2 benchmarks/bench_plot_nmf.py
  2. +1 −1 sklearn/tree/tree.py
View
5 benchmarks/bench_plot_nmf.py
@@ -52,7 +52,7 @@ def alt_nnmf(V, r, max_iter=1000, tol=1e-3, R=None):
n, m = V.shape
if R == "svd":
W, H = _initialize_nmf(V, r)
- elif R == None:
+ elif R is None:
R = np.random.mtrand._rand
W = np.abs(R.standard_normal((n, r)))
H = np.abs(R.standard_normal((r, m)))
@@ -94,7 +94,7 @@ def compute_bench(samples_range, features_range, rank=50, tolerance=1e-7):
print(m.reconstruction_err_, tend)
gc.collect()
- print "benching nndsvda-nmf: "
+ print("benching nndsvda-nmf: ")
tstart = time()
m = NMF(n_components=30, init='nndsvda',
tol=tolerance).fit(X)
@@ -137,6 +137,7 @@ def compute_bench(samples_range, features_range, rank=50, tolerance=1e-7):
if __name__ == '__main__':
from mpl_toolkits.mplot3d import axes3d # register the 3d projection
+ axes3d
import matplotlib.pyplot as plt
samples_range = np.linspace(50, 500, 3).astype(np.int)
View
2 sklearn/tree/tree.py
@@ -309,7 +309,7 @@ def fit(self, X, y,
max_features = self.n_features_
elif isinstance(self.max_features, (numbers.Integral, np.integer)):
max_features = self.max_features
- else: # float
+ else: # float
max_features = int(self.max_features * self.n_features_)
if len(y) != n_samples:

0 comments on commit e42e530

Please sign in to comment.
Something went wrong with that request. Please try again.