Skip to content
Advertisement

Tag: scikit-learn

In the LinearRegression method in sklearn, what exactly is the fit_intercept parameter doing? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about programming within the scope defined in the help center. Closed 2 years ago. Improve this question In the sklearn.linear_model.LinearRegression method, there is a parameter that is fit_intercept = TRUE or fit_intercept = FALSE. I am wondering if

Sklearn logistic regression, plotting probability curve graph

I’m trying to create a logistic regression similar to the ISLR’s example, but using python instead But I keep getting the graph on the left, when I want the one on the right: Edit: plt.scatter(x,LogR.predict(x)) was my second, and also wrong guess. Answer you use predict(X) which gives out the prediction of the class. replace predict(X) with predict_proba(X)[:,1] which would

Top 10 features SVC with rbf kernel

I’m trying to get the top 10 most informative (best) features for a SVM classifier with RBF kernel. As I’m a beginner in programming, I tried some codes that I found online. Unfortunately, none work. I always get the error: ValueError: coef_ is only available when using a linear kernel. This is the last code I tested: Does someone no

Cross validation with grid search returns worse results than default

I’m using scikitlearn in Python to run some basic machine learning models. Using the built in GridSearchCV() function, I determined the “best” parameters for different techniques, yet many of these perform worse than the defaults. I include the default parameters as an option, so I’m surprised this would happen. For example: This is the same as the defaults, except max_depth

problems installing scipy and sklearn

I am quite new into programming and I am struggling much to install scipy with the errors. I did not had any problems installing other libraries: Failed cleaning build dir for scipy and Failed building wheel for scipy With sklearn I am facing the problem : Failed building wheel for scikit-learn just found this info on the web regarding this

ValueError: The number of classes has to be greater than one; got 1

I am trying to write an SVM following this tutorial but using my own data. https://pythonprogramming.net/preprocessing-machine-learning/?completed=/linear-svc-machine-learning-testing-data/ I keep getting this error: My code is: My array for features which is used for X looks like this: My array for labels used in Y looks like this: I have only used 5 sets of data so far because I knew the

Python and SPSS giving different output for Logistic Regression

Code: Here’s the dataset Result: Now I added the same data in spss.Analyse->Regression->Binary Logistic Regression. I set the corresponding Y -> dependent and XT -> Covariates. The results weren’t even close. Am I missing something in python or SPSS? Python-Sklearn Answer SPSS Logistic regression does not include parameter regularisation in it’s cost function, it just does ‘raw’ logistic regression. In

sklearn Clustering: Fastest way to determine optimal number of cluster on large data sets

I use KMeans and the silhouette_score from sklearn in python to calculate my cluster, but on >10.000 samples with >1000 cluster calculating the silhouette_score is very slow. Is there a faster method to determine the optimal number of cluster? Or should I change the clustering algorithm? If yes, which is the best (and fastest) algorithm for a data set with

Advertisement