Comments (2)
I cobbled together the following and I can see that monotone constraint is set in the model:
assert H2OXGBoostEstimator.available() is True
# CPU Backend is forced for the results to be comparable
h2oParamsS = {"tree_method": "exact", "seed": 123, "backend": "cpu", "ntrees": 5}
trainFile = pyunit_utils.genTrainFrame(100, 10, enumCols=0, randseed=17)
print(trainFile)
myX = trainFile.names
y='response'
myX.remove(y)
h2oParamsS["monotone_constraints"] = {
"C1": -1,
"C3": 1,
"C7": 1
}
gbm_params2 = {'learn_rate':[0.01, 0.02]}
gridM = H2OGridSearch(H2OXGBoostEstimator(**h2oParamsS), hyper_params=gbm_params2)
gridM.train(x=myX, y=y, training_frame=trainFile)
gridS = gridM.get_grid(sort_by="auc", decreasing=True)
best_gmb2 = gridS.models[0]
native_params2 = best_gmb2._model_json["output"]["native_parameters"].as_data_frame()
constraints2 = (native_params2[native_params2['name'] == "monotone_constraints"])['value'].values[0]
params = best_gmb2.get_params(deep=True)
h2oModelS = H2OXGBoostEstimator(**h2oParamsS)
h2oModelS.train(x=myX, y=y, training_frame=trainFile)
native_params = h2oModelS._model_json["output"]["native_parameters"].as_data_frame()
print(native_params)
constraints = (native_params[native_params['name'] == "monotone_constraints"])['value'].values[0]
assert constraints == u'(-1,0,1,0,0,0,1,0,0,0)'
Constraint2 is the same as constraints.
from h2o-3.
Something is wrong with get_params()...
from h2o-3.
Related Issues (20)
- Random errors in R tests on jenkins
- Add GBLinear grid step to AutoML but keep it out of default AutoML behavior
- AstMatch does not work with multinode
- Installation docs lacking for dist / h2o-docs
- Fix H2OFrame.isin
- Upgrade com.fasterxml.jackson.core to version 2.15 HOT 1
- h2o.H2OFrame.as_data_frame() leads to OSError HOT 6
- UpliftDRF - Cross validation, add more metrics
- Add git user info into release pipeline
- UpliftDRF - fix find best split point
- Add GLM Ordinal regression loglikelihood and AIC calculation.
- XGBoost support all parameters available for booster=gblinear
- Rename loglikelihood to negative_loglikelihood when it actually means the -log(likelihood)
- xgboost extension fails to initialize on JDK 17 due to attempt to use reflection to load native library HOT 2
- UpliftDRF MLI - Implement Shapley values
- The explain function is not working with UpliftDRF model
- Reimplement the explain function to support uplift models
- h2o 3.44.0.3 does not support JDK/Java 21 HOT 1
- Address CVE-2023-35116 in h2o-steam.jar
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from h2o-3.