MCPcopy Create free account
hub / github.com/apache/madlib / run

Method run

src/modules/glm/ordinal.cpp:31–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29 MutableOrdinalLogitState;
30
31AnyType
32ordinal_logit_transition::run(AnyType& args) {
33 MutableOrdinalLogitState state = args[0].getAs<MutableByteString>();
34 if (state.terminated || args[1].isNull() || args[2].isNull()) {
35 return args[0];
36 }
37 double y = args[1].getAs<double>();
38 MappedColumnVector x;
39 try {
40 MappedColumnVector xx = args[2].getAs<MappedColumnVector>();
41 x.rebind(xx.memoryHandle(), xx.size());
42 } catch (const ArrayWithNullException &e) {
43 return args[0];
44 }
45 if (state.empty()) {
46 state.num_features = static_cast<uint16_t>(x.size());
47 state.num_categories = args[4].getAs<uint16_t>();
48 state.optimizer.num_coef = static_cast<uint16_t>(state.num_features + (state.num_categories-1));
49 state.resize();
50 if (!args[3].isNull()) {
51 OrdinalState prev_state = args[3].getAs<ByteString>();
52 state = prev_state;
53 state.reset();
54 }
55 }
56 state << OrdinalMutableState::tuple_type(x, y);
57 return state.storage();
58}
59
60// ------------------------------------------------------------------------
61

Callers

nothing calls this directly

Calls 8

NullFunction · 0.85
isNullMethod · 0.45
rebindMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
resizeMethod · 0.45
resetMethod · 0.45
applyMethod · 0.45

Tested by

no test coverage detected