Closed ravismula closed 7 years ago
Hi,
There is one thing you should keep in mind about Julia compared to Python: arrays and matrices are COLUMN based rather than row base. The reason is the memory layout in hardware so it boosts the performance. So being used to matrices of size N_points x Dimention should be transposed.
The solution to your problem is simply to transpose the matrices:
training_features_continuous = restructure_matrix(convert(Matrix, features[!int_types])')
training_features_discrete = restructure_matrix(convert(Matrix, features[int_types])')
You can see that it's doing the right thing by checking how many entries you have in the dictionary
arrays and matrices are ROW based rather than column base
I guess you meant column-based (column-major)? I.e. Julia keeps matrices as:
[1 3;
2 4]
not as
[1 2;
3 4]
Also note, that out of other mentioned languages only Python is row-major, thanks to origins in C. R, Matlab and Julia are actually in the same team of column-major languages.
(this doesn't invalidate your actual answer, though)
Yeah, you're right. I did confuse it. Thanks for the correction
Thanks for the clarification!
Hi,
I was trying to implement
HybridNB
so that i can save the model for further computing. Below is the code I'm trying to execute.Below is the error i was getting
Am I doing something wrong? I see that the indexes doesn't exist in the array
PS: I'm new to Julia. Correct me if I'm wrong. Also if this is not a right place to post please let me know where to post it.