Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use memoryviews for sample_weight_data #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyfm_fast.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ cdef class CSRDataset:
cdef INTEGER *feature_indices_ptr
cdef np.ndarray index
cdef INTEGER *index_data_ptr
cdef DOUBLE *sample_weight_data
cdef DOUBLE [:] sample_weight_data

def __cinit__(self, np.ndarray[DOUBLE, ndim=1, mode='c'] X_data,
np.ndarray[INTEGER, ndim=1, mode='c'] X_indptr,
Expand Down Expand Up @@ -522,7 +522,7 @@ cdef class CSRDataset:
self.X_indptr_ptr = <INTEGER *>X_indptr.data
self.X_indices_ptr = <INTEGER *>X_indices.data
self.Y_data_ptr = <DOUBLE *>Y.data
self.sample_weight_data = <DOUBLE *> sample_weight.data
self.sample_weight_data = sample_weight
# Use index array for fast shuffling
cdef np.ndarray[INTEGER, ndim=1,
mode='c'] index = np.arange(0, self.n_samples,
Expand Down