-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
39,905 additions
and
18,943 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,53 @@ | ||
|
||
#include "prediction.h" | ||
|
||
; | ||
|
||
static const int32_t num_class[] = { 1, }; | ||
|
||
size_t get_num_class(void) { | ||
return 1; | ||
int32_t get_num_target(void) { | ||
return N_TARGET; | ||
} | ||
|
||
size_t get_num_feature(void) { | ||
return 10; | ||
} | ||
|
||
const char* get_pred_transform(void) { | ||
return "identity"; | ||
} | ||
|
||
float get_sigmoid_alpha(void) { | ||
return 1.0; | ||
} | ||
|
||
float get_ratio_c(void) { | ||
return 1.0; | ||
void get_num_class(int32_t* out) { | ||
for (int i = 0; i < N_TARGET; ++i) { | ||
out[i] = num_class[i]; | ||
} | ||
} | ||
|
||
float get_global_bias(void) { | ||
return 0.0; | ||
int32_t get_num_feature(void) { | ||
return 10; | ||
} | ||
|
||
const char* get_threshold_type(void) { | ||
return "float64"; | ||
} | ||
|
||
const char* get_leaf_output_type(void) { | ||
return "float64"; | ||
} | ||
|
||
|
||
static inline double pred_transform(double margin) { | ||
return margin; | ||
} | ||
double predict(union Entry* data, int pred_margin) { | ||
double sum = (double)0; | ||
void predict(union Entry* data, int pred_margin, double* result) { | ||
unsigned int tmp; | ||
int nid, cond, fid; /* used for folded subtrees */ | ||
sum += predict_margin_unit0(data); | ||
sum += predict_margin_unit1(data); | ||
sum += predict_margin_unit2(data); | ||
sum += predict_margin_unit3(data); | ||
sum += predict_margin_unit4(data); | ||
sum += predict_margin_unit5(data); | ||
sum += predict_margin_unit6(data); | ||
sum += predict_margin_unit7(data); | ||
sum += predict_margin_unit8(data); | ||
sum += predict_margin_unit9(data); | ||
sum += predict_margin_unit10(data); | ||
sum += predict_margin_unit11(data); | ||
sum += predict_margin_unit12(data); | ||
sum += predict_margin_unit13(data); | ||
sum += predict_margin_unit14(data); | ||
|
||
sum = sum + (double)(0); | ||
if (!pred_margin) { | ||
return pred_transform(sum); | ||
} else { | ||
return sum; | ||
} | ||
predict_unit0(data, result); | ||
predict_unit1(data, result); | ||
predict_unit2(data, result); | ||
predict_unit3(data, result); | ||
predict_unit4(data, result); | ||
predict_unit5(data, result); | ||
predict_unit6(data, result); | ||
predict_unit7(data, result); | ||
predict_unit8(data, result); | ||
predict_unit9(data, result); | ||
predict_unit10(data, result); | ||
predict_unit11(data, result); | ||
predict_unit12(data, result); | ||
predict_unit13(data, result); | ||
predict_unit14(data, result); | ||
|
||
// Apply base_scores | ||
result[0] += 0; | ||
|
||
// Apply postprocessor | ||
if (!pred_margin) { postprocess(result); } | ||
} | ||
|
||
void postprocess(double* result) { | ||
// Do nothing | ||
} | ||
|
This file contains 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
Oops, something went wrong.