examples/machine_learning/rgf_example.py 1 location
|
@@ 11-22 (lines=12) @@
|
| 8 |
|
X, y = data.data, data.target |
| 9 |
|
|
| 10 |
|
|
| 11 |
|
def model(para, X, y): |
| 12 |
|
rgf = RGFClassifier( |
| 13 |
|
max_leaf=para["max_leaf"], |
| 14 |
|
reg_depth=para["reg_depth"], |
| 15 |
|
min_samples_leaf=para["min_samples_leaf"], |
| 16 |
|
algorithm="RGF_Sib", |
| 17 |
|
test_interval=100, |
| 18 |
|
verbose=False, |
| 19 |
|
) |
| 20 |
|
scores = cross_val_score(rgf, X, y, cv=3) |
| 21 |
|
|
| 22 |
|
return scores.mean() |
| 23 |
|
|
| 24 |
|
|
| 25 |
|
search_config = { |
examples/examples_v1.x.x/machine_learning/rgf_python.py 1 location
|
@@ 11-22 (lines=12) @@
|
| 8 |
|
X, y = data.data, data.target |
| 9 |
|
|
| 10 |
|
|
| 11 |
|
def model(para, X, y): |
| 12 |
|
rgf = RGFClassifier( |
| 13 |
|
max_leaf=para["max_leaf"], |
| 14 |
|
reg_depth=para["reg_depth"], |
| 15 |
|
min_samples_leaf=para["min_samples_leaf"], |
| 16 |
|
algorithm="RGF_Sib", |
| 17 |
|
test_interval=100, |
| 18 |
|
verbose=False, |
| 19 |
|
) |
| 20 |
|
scores = cross_val_score(rgf, X, y, cv=3) |
| 21 |
|
|
| 22 |
|
return scores.mean() |
| 23 |
|
|
| 24 |
|
|
| 25 |
|
search_config = { |