Comments (3)
The RandomForestClassifier
object does not contain feature names. If you want to override default names (eg. "x1", "x2", "x3"), then you have to construct and pass a DataFrameMapper
object to the sklearn2pmml
method.
You can create a dummy DataFrameMapper
object (that specifies the names of thousand columns) using a single line of Python application code. That's not overkill.
Or are you suggesting that "x1", "x2", etc. should be renamed to "feature1", "feature2", etc?
from sklearn2pmml.
@KidCrippler I'm not a Python expert either, so I'm going to construct the DataFrameMapper
object using four lines of Python application code (instead of one as advertised above). The idea is to map a list of strings to a None
transformation:
iris_active_fields = ["Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width"]
iris_target_field = "Species"
iris_mapper = sklearn_pandas.DataFrameMapper([
(iris_active_fields, None),
(iris_target_field, None)
])
sklearn2pmml(iris_classifier, iris_mapper, "Iris.pmml")
from sklearn2pmml.
@vruusmann I had the exact same problem.
I'm not a very proficient python programmer and couldn't get around wrapping my model with an "identity" mapper that only modifies the predictor names from x1, x2, etc... to whatever I want them to be.
Can you please provide a more detailed explanation on how to do that?
10x
from sklearn2pmml.
Related Issues (20)
- Postprocessing the probabilities of an XGBoost Model HOT 3
- Link Estimator with prefit=True doesn't work
- Support for the `OneHotEncoder.infrequent_categories_` attribute HOT 1
- Revert PMML file to Python source code HOT 1
- Error when using `TargetEncoder` within `DataFrameMapper` within pipeline HOT 6
- Missing dependency `dill` from `setup.py`. HOT 7
- Support for Python power operator `**` HOT 1
- Assembling a pipeline from pre-fitted components HOT 3
- looking for support on quantile_forest for RandomForestQuantileRegressor HOT 2
- Failing to convert `CalibratedClassifierCV` plus `XGBClassifier` combination HOT 12
- Effectively debugging XGBoost pipelines (mis-matching predictions between Python and (J)PMML) HOT 14
- Revisit the missing value handling of custom transformers HOT 1
- Support for AgglomerativeClustering HOT 2
- `ExpressionTransformer` should try to rectify feature type information HOT 5
- `Alias` object has no attribute `transformer_` HOT 8
- Storing LinearSVC as coefficients instead of support vectors HOT 1
- Reshape transformation results from 2-D to 1-D (column vectors) HOT 1
- sklearn2pmml does not work with sklearn version 1.3.0 and newer HOT 6
- sklearn2pmml does not work with xgboost >= 2.0.0 HOT 9
- LookupTransformer TypeError when default value is not exactly the type from the mapping HOT 2
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 sklearn2pmml.