Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) Recommenders contributors. | |
# Licensed under the MIT License. | |
import random | |
import numpy as np | |
import pandas as pd | |
import scipy.sparse as sp | |
from recommenders.utils.constants import ( | |
DEFAULT_ITEM_COL, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This program should split xblock-eth's CSV files into smaller files that fit into | |
memory. | |
The program checks the two numbers in the filename and takes N extra digits. | |
With N=1, it converts a file like 1000to1099_... into 10 files: 1000to1019_..., etc. | |
*/ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See https://math.stackexchange.com/posts/5026786 | |
def submatrices(A): | |
d = len(A) | |
d2 = d//2 | |
return [ [ [ [ A[d2*i + k][ d2*j+l] for l in range(d2) ] for k in range(d2) ] for j in range(2) ] for i in range(2) ] | |
def combine(A): | |
d = len(A[0][0]) | |
d2 = d*2 |