-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
logistic #35
Comments
Thanks for your interest in That being said, based on the error I think the library you used to export the PMML model has converted the original |
I used SVM to predict before, and I want to use logistic regression to classify, test the accuracy of the results, and use logistic regression prediction under the linear model. I mainly want to try logistic regression for classification. |
Well, I can use THE SVM export to PMML to make predictions, but the logical classification prediction will report an error |
I suppose you are using |
Should I change my training to RidgeClassifier, or is there a problem with data processing? SVM can be a good test,Exception: PMML model does not contain GeneralRegressionModel. |
Why is it easier for me to predict with SVM, but harder for me to predict with logistic regression? Is there any other model that can do better classification |
I am not entirely sure what your problem is. It would be helpful if you can provide a copy of the PMML file that you having problems with. In your screenshot you show the method For me, from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
import pandas as pd
import numpy as np
from sklearn_pmml_model.linear_model import PMMLLogisticRegression
from sklearn2pmml.pipeline import PMMLPipeline
from sklearn2pmml import sklearn2pmml
# Prepare data
iris = load_iris()
X = pd.DataFrame(iris.data)
X.columns = np.array(iris.feature_names)
y = pd.Series(np.array(iris.target_names)[iris.target])
y.name = "Class"
# train logistic regression
clf = LogisticRegression()
pipeline = PMMLPipeline([
("classifier", clf)
])
pipeline.fit(X, y)
# convert to PMML
sklearn2pmml(pipeline, "test.pmml", with_repr = True)
# Load from PMML and predict
clf = PMMLLogisticRegression(pmml="test.pmml")
clf.predict(X)
clf.score(X, y) |
The parameters you show don't make a lot of sense to me. If you like to try another model, I suggest trying |
The test accuracy of default parameters is not high, which can only reach half of SVM, and it needs to be adjusted, and it does not need too complex network model. |
I tried the random forest,ModuleNotFoundError: No module named 'sklearn_pmml_model.tree._tree'.I use three categories |
Please make sure you installed the library using If you, for some reason, cannot use
I don't recommend this, and it will require a C compiler, which is a bit of a pain to setup on windows. More information about this process can be found at https://sklearn-pmml-model.readthedocs.io/en/latest/install.html#from-source. |
I installed the package according to Requerment.txt |
If I use logistic regression to do the tripartite model can't it predict |
which is only the case if you downloaded this library and are working in that directory directly. I can use PIP, how can I simply use random forest, I don't want to install c compiler. |
|
If you use
|
I installed packages from Requiest with PIP. Why do I get errors with those models |
You have to let me know which errors you are seeing, otherwise I cannot help you. I am expecting you still installed the packages with |
ValueError: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 2 is different from 1024) |
Well, use the package version, but don't use it directly in your project. |
|
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject, |
Ok I think I understand now. You seem to be using the To get it working in the mean time, you can use the default parameter |
|
|
This error typically means you have to re-install numpy ( |
Glad you got it working! I have just released a new version that should also work with |
The logistic regression that I use, the linear model that I use, it says in the document that logistic regression is included, why does it show up when I predict PMML model does not contain RegressionModel.
The text was updated successfully, but these errors were encountered: