Sparse matrices can be useful as a target destination for ETL, but what are the main caveats (choose one or more)?
5 phương ánCó giải thích
Các phương án trả lời
Chọn một phương ánLời giảiChọn phương án để mở
Đáp án đúng gồm hai ý: "NumPy linear algebra functions generally cannot be called directly" và "It is difficult to print to screen scipy sparse matrices directly". Ma trận thưa (sparse matrix) của scipy chỉ lưu phần tử khác 0 theo các định dạng như CSR hay COO nên tiết kiệm bộ nhớ khi làm đích ETL cho dữ liệu nhiều số 0, ví dụ ma trận người dùng và sản phẩm; đổi lại, các hàm numpy.linalg viết cho mảng đặc không nhận trực tiếp đối tượng thưa mà phải dùng scipy.sparse.linalg hoặc đổi sang mảng đặc, còn khi in ra màn hình chỉ thấy danh sách toạ độ kèm giá trị, phải gọi toarray() hay todense() mới xem được dạng bảng. "You cannot convert directly from a numpy array to any of the scipy sparse matrices" sai vì có thể truyền thẳng mảng numpy vào hàm dựng như csr_matrix(arr). "Saving to disk is not possible directly from a scipy sparse format" sai vì scipy.sparse.save_npz và load_npz lưu, đọc trực tiếp định dạng thưa. "The train test splits need to be performed by hand with scipy sparse matrices" sai vì train_test_split của scikit-learn chấp nhận ma trận thưa làm đầu vào.
Cùng phần 1
Thinking with the lens of the scientific process, what would your next steps be if you wanted to decide where to open the next store for your sled business?Có lời giảiCâu hỏiWhen you compiled the JSON files into a single DataFrame or NumPy array, about how many days did the entire range of dates span?Có lời giảiCâu hỏiWhich library in Python is commonly used for reading and writing CSV files?Có lời giảiCâu hỏiCả 31 câu của chủ đề31 câu