_seq_dataset.pxd 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. # WARNING: Do not edit this file directly.
  2. # It is automatically generated from 'sklearn\\utils\\_seq_dataset.pxd.tp'.
  3. # Changes must be made there.
  4. """Dataset abstractions for sequential data access."""
  5. cimport numpy as cnp
  6. # SequentialDataset and its two concrete subclasses are (optionally randomized)
  7. # iterators over the rows of a matrix X and corresponding target values y.
  8. #------------------------------------------------------------------------------
  9. cdef class SequentialDataset64:
  10. cdef int current_index
  11. cdef int[::1] index
  12. cdef int *index_data_ptr
  13. cdef Py_ssize_t n_samples
  14. cdef cnp.uint32_t seed
  15. cdef void shuffle(self, cnp.uint32_t seed) noexcept nogil
  16. cdef int _get_next_index(self) noexcept nogil
  17. cdef int _get_random_index(self) noexcept nogil
  18. cdef void _sample(self, double **x_data_ptr, int **x_ind_ptr,
  19. int *nnz, double *y, double *sample_weight,
  20. int current_index) noexcept nogil
  21. cdef void next(self, double **x_data_ptr, int **x_ind_ptr,
  22. int *nnz, double *y, double *sample_weight) noexcept nogil
  23. cdef int random(self, double **x_data_ptr, int **x_ind_ptr,
  24. int *nnz, double *y, double *sample_weight) noexcept nogil
  25. cdef class ArrayDataset64(SequentialDataset64):
  26. cdef const double[:, ::1] X
  27. cdef const double[::1] Y
  28. cdef const double[::1] sample_weights
  29. cdef Py_ssize_t n_features
  30. cdef cnp.npy_intp X_stride
  31. cdef double *X_data_ptr
  32. cdef double *Y_data_ptr
  33. cdef const int[::1] feature_indices
  34. cdef int *feature_indices_ptr
  35. cdef double *sample_weight_data
  36. cdef class CSRDataset64(SequentialDataset64):
  37. cdef const double[::1] X_data
  38. cdef const int[::1] X_indptr
  39. cdef const int[::1] X_indices
  40. cdef const double[::1] Y
  41. cdef const double[::1] sample_weights
  42. cdef double *X_data_ptr
  43. cdef int *X_indptr_ptr
  44. cdef int *X_indices_ptr
  45. cdef double *Y_data_ptr
  46. cdef double *sample_weight_data
  47. #------------------------------------------------------------------------------
  48. cdef class SequentialDataset32:
  49. cdef int current_index
  50. cdef int[::1] index
  51. cdef int *index_data_ptr
  52. cdef Py_ssize_t n_samples
  53. cdef cnp.uint32_t seed
  54. cdef void shuffle(self, cnp.uint32_t seed) noexcept nogil
  55. cdef int _get_next_index(self) noexcept nogil
  56. cdef int _get_random_index(self) noexcept nogil
  57. cdef void _sample(self, float **x_data_ptr, int **x_ind_ptr,
  58. int *nnz, float *y, float *sample_weight,
  59. int current_index) noexcept nogil
  60. cdef void next(self, float **x_data_ptr, int **x_ind_ptr,
  61. int *nnz, float *y, float *sample_weight) noexcept nogil
  62. cdef int random(self, float **x_data_ptr, int **x_ind_ptr,
  63. int *nnz, float *y, float *sample_weight) noexcept nogil
  64. cdef class ArrayDataset32(SequentialDataset32):
  65. cdef const float[:, ::1] X
  66. cdef const float[::1] Y
  67. cdef const float[::1] sample_weights
  68. cdef Py_ssize_t n_features
  69. cdef cnp.npy_intp X_stride
  70. cdef float *X_data_ptr
  71. cdef float *Y_data_ptr
  72. cdef const int[::1] feature_indices
  73. cdef int *feature_indices_ptr
  74. cdef float *sample_weight_data
  75. cdef class CSRDataset32(SequentialDataset32):
  76. cdef const float[::1] X_data
  77. cdef const int[::1] X_indptr
  78. cdef const int[::1] X_indices
  79. cdef const float[::1] Y
  80. cdef const float[::1] sample_weights
  81. cdef float *X_data_ptr
  82. cdef int *X_indptr_ptr
  83. cdef int *X_indices_ptr
  84. cdef float *Y_data_ptr
  85. cdef float *sample_weight_data