quinngroup / dr1dl-pyspark

Dictionary Learning in PySpark
Apache License 2.0
1 stars 1 forks source link

Eliminate command-line variables that can be inferred #24

Closed magsol closed 8 years ago

magsol commented 8 years ago

At first glance, I suspect length and pnumber can be inferred from the data read into the program.

MOJTABAFA commented 8 years ago

Actually I do not get what do you mean about "length" and "pnumber" ? do you mean for example by introducing the "file_s" as input that 2 parameters can be inferred?

magsol commented 8 years ago

Yes, precisely. On line 93 where you read the data S, after doing this you can infer P and T from this data structure; if I'm not mistaken, P is the number of rows, and T the number of columns.

MOJTABAFA commented 8 years ago

May I use following code to infer P and L ? import numpy as np from numpy import linalg as sla

S = np.loadtxt('s.txt') y = np.shape(S) l = y[0] p = y[1] print(y,p,l) =================== out put ========== (100, 5) 100 5 [Finished in 0.4s]

MOJTABAFA commented 8 years ago

It's done! Thanks.