Commit
•
df356fe
1
Parent(s):
6969d48
Update app.py
Browse files
app.py
CHANGED
@@ -47,9 +47,10 @@ def compare_lasso_sparse():
|
|
47 |
print(f"Matrix density : {(Xs_sp.nnz / float(X.size) * 100):.3f}%")
|
48 |
matrix_density = Xs_sp.nnz / float(X.size) * 100
|
49 |
|
50 |
-
|
51 |
-
|
52 |
-
|
|
|
53 |
|
54 |
t0 = time()
|
55 |
sparse_lasso.fit(Xs_sp, y)
|
|
|
47 |
print(f"Matrix density : {(Xs_sp.nnz / float(X.size) * 100):.3f}%")
|
48 |
matrix_density = Xs_sp.nnz / float(X.size) * 100
|
49 |
|
50 |
+
alpha_dense = 1
|
51 |
+
alpha_sparse = 0.1
|
52 |
+
sparse_lasso = Lasso(alpha= alpha_sparse, fit_intercept=False, max_iter=1000)
|
53 |
+
dense_lasso = Lasso(alpha=alpha_dense, fit_intercept=False, max_iter=1000)
|
54 |
|
55 |
t0 = time()
|
56 |
sparse_lasso.fit(Xs_sp, y)
|