chemicalchecker.tool.targetmate.nonconformist.evaluation.RegIcpCvHelper
- class RegIcpCvHelper(icp, calibration_portion=0.25)[source]
Bases:
BaseIcpCvHelper
,RegressorMixin
Helper class for running the
cross_val_score
evaluation method on IcpRegressors.See also
IcpClassCrossValHelper
Examples
>>> from sklearn.datasets import load_boston >>> from sklearn.ensemble import RandomForestRegressor >>> from nonconformist.icp import IcpRegressor >>> from nonconformist.nc import RegressorNc, AbsErrorErrFunc >>> from nonconformist.evaluation import RegIcpCvHelper >>> from nonconformist.evaluation import reg_mean_errors >>> from nonconformist.evaluation import cross_val_score >>> data = load_boston() >>> nc = RegressorNc(RandomForestRegressor(), AbsErrorErrFunc()) >>> icp = IcpRegressor(nc) >>> icp_cv = RegIcpCvHelper(icp) >>> cross_val_score(icp_cv, ... data.data, ... data.target, ... iterations=2, ... folds=2, ... scoring_funcs=[reg_mean_errors], ... significance_levels=[0.1]) ... fold iter reg_mean_errors significance 0 0 0 0.185771 0.1 1 1 0 0.138340 0.1 2 0 1 0.071146 0.1 3 1 1 0.043478 0.1
Methods
fit
Get parameters for this estimator.
get_problem_type
predict
Set the parameters of this estimator.
- get_params(deep=True)
Get parameters for this estimator.
Parameters
- deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators.
Returns
- paramsdict
Parameter names mapped to their values.
- set_params(**params)
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as
Pipeline
). The latter have parameters of the form<component>__<parameter>
so that it’s possible to update each component of a nested object.Parameters
- **paramsdict
Estimator parameters.
Returns
- selfestimator instance
Estimator instance.