kaz-Anova / StackNet

StackNet is a computational, scalable and analytical Meta modelling framework
MIT License
1.32k stars 344 forks source link

LightGBM error #16

Closed ajing closed 7 years ago

ajing commented 7 years ago

I got the following error when using lightGBM:

Exception in thread "Thread-376" java.lang.IllegalStateException:  failed to create LIGHTgbm subprocess with config name ~/models/fjufcncb20qtl7f7ehcpm5b6tn0.conf
        at ml.lightgbm.LightgbmRegressor.create_light_suprocess(LightgbmRegressor.java:426)
        at ml.lightgbm.LightgbmRegressor.fit(LightgbmRegressor.java:1566)
        at ml.lightgbm.LightgbmRegressor.run(LightgbmRegressor.java:514)
        at java.lang.Thread.run(Thread.java:745)
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.IllegalStateException:  Tree is not fitted
        at ml.Bagging.scoringhelperbagv2.<init>(scoringhelperbagv2.java:95)
        at ml.Bagging.BaggingRegressor.predict2d(BaggingRegressor.java:350)
        at ml.Bagging.BaggingRegressor.predict_proba(BaggingRegressor.java:1785)
        at ml.stacknet.StackNetRegressor.fit(StackNetRegressor.java:2632)
        at stacknetrun.runstacknet.main(runstacknet.java:525)
        ... 5 more

However, if I run lightgbm with the config file, it seems to be fine.

./lightgbm config=~/models/fjufcncb20qtl7f7ehcpm5b6tn0.conf task=train
[LightGBM] [Warning] Unknown parameter in config file: categorical_feature=
[LightGBM] [Warning] Stopped training because there are no more leaves that meet the split requirements.

And I can see some output in the model file after I run with lightgbm only:

tree
num_class=1
num_tree_per_iteration=1
label_index=0
max_feature_idx=18
objective=regression
boost_from_average
feature_names=Column_0 Column_1 Column_2 Column_3 Column_4 Column_5 Column_6 Column_7 Column_8 Column_9 Column_10 Column_11 Column_12 Column_13 Column_14 Column_15 Column_16 Column_17 Column_18
feature_infos=[16801:17165] [0:20] [0:16] [2:22741] [6037:6111] [33339295:34816009] none [1:240] [31:275] [1:5637] [60371011.101001002:61110091.001012005] [1286:3101] [95982:399675] [0:18] [1885:2015] [100:9948100] [1044:27750000] [278:24499999.999999996] [49.079999999999998:321936.09000000003]

Tree=0
num_leaves=2
split_feature=0
split_gain=-1
threshold=0
decision_type=0
default_value=0
left_child=-1
right_child=-2
leaf_parent=0 0
leaf_value=0.01149876969316053 0.01149876969316053
leaf_count=0 0
internal_value=0
internal_count=0
shrinkage=1
has_categorical=0

Here is my config file

boosting=gbdt
objective=regression
learning_rate=0.002
min_sum_hessian_in_leaf=0.001
min_data_in_leaf=20
feature_fraction=0.5
min_gain_to_split=1.0
bagging_fraction=0.9
poission_max_delta_step=0.0
lambda_l1=0.0
lambda_l2=0.0
scale_pos_weight=1.0
max_depth=4
num_threads=10
num_iterations=100
feature_fraction_seed=2
bagging_seed=2
drop_seed=2
data_random_seed=2
num_leaves=60
bagging_freq=1
xgboost_dart_mode=false
drop_rate=0.1
skip_drop=0.5
max_drop=50
top_rate=0.1
other_rate=0.1
huber_delta=0.1
fair_c=0.1
max_bin=255
min_data_in_bin=5
uniform_drop=false
two_round=false
is_unbalance=false
categorical_feature=
bin_construct_sample_cnt=1000000
is_sparse=true
verbosity=0
data=~/models/fjufcncb20qtl7f7ehcpm5b6tn0.train
output_model=~/model/models/fjufcncb20qtl7f7ehcpm5b6tn0.mod
kaz-Anova commented 7 years ago

It seems that for some reason StackNet is not able to find the executable. Is the lib/ folder in the same directory where the StackNet.jar file is?

ajing commented 7 years ago

You are right. I use relative path for StackNet.jar (e.g. java -Xmx4048m -jar ~/Libaries/StackNet/StackNet.jar). It works OK, if I run the program in the StackNet.jar folder.

Thanks!

RobinSeaside commented 7 years ago

Same issue raised when i am tring to run this example StackNet/example/zillow_regression_sparse/. I am running StackNet on my server that I don't have root permission.

Issam28 commented 6 years ago

well i ran into this problem as well for me the problem was in path ,the path SHOULD NOT contain any space

iFe1er commented 6 years ago

work for me