How to transform the normal SecInt data into np format?
See original GitHub issueI tried to improve the performance using the code in np_*.py
.
I have encountered a format issue TypeError: can't multiply sequence by non-int of type 'ArraySecInt42'
.
T = secint.array(np.ones(n, dtype='O'))
S = [secint.array(np.array([[t[i] == j for t in transactions] for j in attr_ranges[i]]))
for i in range(d)]
S_A = [[mpc.in_prod([S[k][j][l] for k in RR], ii) for l in range(len(S[0][0]))] for j in range(ell)]
T_SA = T * S_A # mpc.schur_prod
S_A
is a list of normal SecInt data, while T
is np format. S_A
is 2D list.
I tried to use np.concatenate
etc. to convert S_A
but failed.
The normal version without using np has been tested successfully. If you want to test the np version to check the error, I can provide the code
Issue Analytics
- State:
- Created 9 months ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Pretty-print a NumPy array without scientific notation and with ...
Here is how I print a simple 2D array using some variety in the formatting by converting (slices of) my NumPy array to...
Read more >Chapter 4. NumPy Basics: Arrays and Vectorized Computation
Fast vectorized array operations for data munging and cleaning, subsetting and filtering, transformation, and any other kinds of computations. Common array ...
Read more >How to Save a NumPy Array to File for Machine Learning
1. Save NumPy Array to .CSV File (ASCII). The most common file format for storing numerical data in files is the comma-separated variable ......
Read more >The 10 Best Ways to Create NumPy Arrays
First, import the libraries we'll need under their usual aliases. ... You can convert a list into a NumPy array with the array...
Read more >Change data type of given numpy array - GeeksforGeeks
In order to change the dtype of the given array object, we will use numpy.astype() function. The function takes an argument which is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure, I will first put the initial result for the binary case here. (avg 5 times here)
Yes, as you said, it’s not hard to add. I will do it later since I have some deadlines recently.
Yeah, great, maybe you can also report the timings that you get for both versions here?
And it would be nice to cover the nonbinary case for the class attribute. I don’t think that’s hard to add. Then all datasets in
demos/data/id3
can be used as is. For that also the case that the class attribute is not the last one needs to be handled, as the above code simply appends a0
to the unit vectork
.