mi2-warsaw / FSelectorRcpp
Showing 6 of 38 files from the diff.

@@ -74,7 +74,7 @@
Loading
74 74
		}
75 75
76 76
		return final_result;
77 -
	};
77 +
	}
78 78
79 79
80 80
	}

@@ -31,7 +31,7 @@
Loading
31 31
#' @param discIntegers logical value.
32 32
#' If true (default), then integers are treated as numeric vectors and they are discretized.
33 33
#' If false  integers are treated as factors and they are left as is.
34 -
#' @param threads Number of threads for parallel backend.
34 +
#' @param threads defunct. Number of threads for parallel backend - now turned off because of safety reasons.
35 35
#'
36 36
#' @return
37 37
#'
@@ -77,6 +77,7 @@
Loading
77 77
                             type = c("infogain", "gainratio", "symuncert"),
78 78
                             equal = FALSE, discIntegers = TRUE, nbins = 5,
79 79
                             threads = 1) {
80 +
80 81
  if (!xor(
81 82
          all(!missing(x), !missing(y)),
82 83
          all(!missing(formula), !missing(data)))) {

@@ -23,13 +23,16 @@
Loading
23 23
24 24
  switch(method)
25 25
  {
26 -
    case DISCRETIZE_METHOD::MDL:
27 -
      return mdl::discretize(itX, itXLast, itY, itResult);
28 -
      break;
29 -
30 -
    case DISCRETIZE_METHOD::EQUAL_SIZE:
31 -
      std::shared_ptr<equalsize::DiscControlEqualSize> controlEqual = std::static_pointer_cast<equalsize::DiscControlEqualSize>(control);
32 -
      return equalsize::discretize(itX, itXLast, itY, itResult, *controlEqual);
26 +
    case DISCRETIZE_METHOD::MDL: {
27 +
        return mdl::discretize(itX, itXLast, itY, itResult);
28 +
        break;
29 +
    }
30 +
    case DISCRETIZE_METHOD::EQUAL_SIZE: {
31 +
        std::shared_ptr<equalsize::DiscControlEqualSize> controlEqual = std::static_pointer_cast<equalsize::DiscControlEqualSize>(control);
32 +
        return equalsize::discretize(itX, itXLast, itY, itResult, *controlEqual);
33 +
        break;
34 +
    }
35 +
    default:
33 36
      break;
34 37
  }
35 38

@@ -4,8 +4,8 @@
Loading
4 4
#include <R_ext/Rdynload.h>
5 5
6 6
/* FIXME:
7 -
Check these declarations against the C/Fortran source code.
8 -
*/
7 +
 Check these declarations against the C/Fortran source code.
8 +
 */
9 9
10 10
/* .Call calls */
11 11
extern SEXP _FSelectorRcpp_cutOff_k(SEXP, SEXP, SEXP);
@@ -15,8 +15,8 @@
Loading
15 15
extern SEXP _FSelectorRcpp_fs_order(SEXP);
16 16
extern SEXP _FSelectorRcpp_fs_table_numeric2d(SEXP, SEXP);
17 17
extern SEXP _FSelectorRcpp_fs_table1d(SEXP);
18 -
extern SEXP _FSelectorRcpp_information_gain_cpp(SEXP, SEXP, SEXP);
19 -
extern SEXP _FSelectorRcpp_sparse_information_gain_cpp(SEXP, SEXP);
18 +
extern SEXP _FSelectorRcpp_information_gain_cpp(SEXP, SEXP, SEXP, SEXP);
19 +
extern SEXP _FSelectorRcpp_sparse_information_gain_cpp(SEXP, SEXP, SEXP);
20 20
extern void run_testthat_tests();
21 21
22 22
static const R_CallMethodDef CallEntries[] = {

@@ -20,12 +20,9 @@
Loading
20 20
  std::vector<double> varEntropy(xx.length());
21 21
  std::vector<double> jointEntropy(xx.length());
22 22
23 -
  if(threads < 1) threads = omp_get_max_threads();
24 -
25 23
  std::shared_ptr<fselector::discretize::DiscControl> control =
26 24
    std::make_shared<fselector::discretize::mdl::DiscControlMdl>();
27 25
28 -
  #pragma omp parallel for shared(xx, varEntropy, jointEntropy, y, control) num_threads(threads) schedule(dynamic)
29 26
  for(int i = 0; i < xx.size(); i++)
30 27
  {
31 28
    SEXP x = xx[i];
@@ -68,6 +65,10 @@
Loading
68 65
        }
69 66
        break;
70 67
      }
68 +
69 +
      default:
70 +
        break;
71 +
71 72
    }
72 73
73 74
    varEntropy[i] = entr;

@@ -110,7 +110,7 @@
Loading
110 110
111 111
      _sizeLog = std::log(_size);
112 112
113 -
    };
113 +
    }
114 114
115 115
116 116
    void add_sample(const T& val)
@@ -184,7 +184,7 @@
Loading
184 184
      add_sample(*first);
185 185
      _size++;
186 186
    }
187 -
  };
187 +
  }
188 188
189 189
190 190
  void add_sample(const int& val)
Files Coverage
R 98.02%
inst/include 96.09%
src 99.42%
Project Totals (21 files) 97.77%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading