Re: [scikit-learn] question regarding 'RANSACRegressor' object has no attribute 'inlier_mask_'

2022-07-29 Thread Shang-Rou Hsieh via scikit-learn
Thanks. I will give it a try. On Friday, July 29, 2022 at 03:06:19 PM PDT, Guillaume Lemaître wrote: You need to fit the estimator to access the fitted attribute: In [1]: from sklearn.linear_model import RANSACRegressor   ...: from sklearn.datasets import make_regression   ...: X, y =

Re: [scikit-learn] question regarding 'RANSACRegressor' object has no attribute 'inlier_mask_'

2022-07-29 Thread Guillaume Lemaître
You need to fit the estimator to access the fitted attribute: In [1]: from sklearn.linear_model import RANSACRegressor ...: from sklearn.datasets import make_regression ...: X, y = make_regression( ...: n_samples=200, n_features=2, noise=4.0, random_state=0) ...: reg = RANSACRegres

[scikit-learn] question regarding 'RANSACRegressor' object has no attribute 'inlier_mask_'

2022-07-29 Thread Shang-Rou Hsieh via scikit-learn
To whom it may concern, Belows are the codes: -  - - - - from sklearn.linear_model import RANSACRegressor ransac = RANSACRegressor(LinearRegression(), max_trials=100, # default min_samples=0.95, loss='absolute_error', #

Re: [scikit-learn] Question RE: skLearn Logistic Regression

2020-10-31 Thread serafim loukas
These are not numpy arrays. Try: X = np.array([-3,-2,-1,0,1,2,3]).reshape(-1,1) And y = np.array([0, 0, 0, 1, 1, 1, 1]).reshape(-1,1) Makis On 31 Oct 2020, at 17:51, The Helmbolds via scikit-learn mailto:scikit-learn@python.org>> wrote: I have a case with binary results and 1-D features, l

[scikit-learn] Question RE: skLearn Logistic Regression

2020-10-31 Thread The Helmbolds via scikit-learn
I have a case with binary results and 1-D features, like:     X = np.array(-3,-2,-1,0,1,2,3,) and     y = np.array(0, 0, 0, 1, 1, 1, 1) only longer arrays (about 180 entries in each array) of this general type.  So this should be the "simplest" case. Altho I've tried several variations of the Logi

[scikit-learn] Question about n_jobs in KMeans function

2020-09-14 Thread Mingzhe Hu
Hi scikit-learn contributors, I hope you are all doing well these days. I am now working on the KMeans clustering acceleration algorithm and I would like to use your library as a reference. Your codes are amazing and inspire me a lot in developing a more efficient solution. But I still have a ques

Re: [scikit-learn] Question regarding regression models

2020-06-11 Thread serafim loukas
Hi Kelden, I answered your SO question but for the record this is what happens: date_index is a scalar and you type date_index.columns which raises the error. So you just need this: def predict_price(dates,price): date_index = np.where(date_format.columns == dates)[0][0] x = np.zeros(l

Re: [scikit-learn] question

2019-10-20 Thread ahmad qassemi
Thanks a lot guys for your great hints. I've tested to consider only the magnitude or only the phase to attain the goal, but those don't work in my case, I should consider both simultaneously to get a correct result. Also, I've considered converting into two columns (imaginary + real columns). But

Re: [scikit-learn] question

2019-10-20 Thread serafim loukas
I would take the magnitude. Otherwise you will have to modify the source code to make it work with complex values. Bests, Makis On Oct 20, 2019, at 15:55, Fernando Marcos Wittmann wrote:  What about converting into two columns? One with the real projection and the other with the complex pro

Re: [scikit-learn] question

2019-10-20 Thread Fernando Marcos Wittmann
What about converting into two columns? One with the real projection and the other with the complex projection? On Sat, Oct 19, 2019, 3:44 PM ahmad qassemi wrote: > Dear Mr/Mrs, > > I'm a PhD student in DS. I'm trying to use your provided code on *Spectral > CoClustering *and *Spectral Bicluste

Re: [scikit-learn] question

2019-10-19 Thread federico vaggi
Your options are to either pick a clustering algorithm that supports a pre-computed distance matrix, or, find some kind of projection from C -> R, embed your data in R, then cluster your embedded data and transfer the labels back to C. On Sat, Oct 19, 2019 at 11:44 AM ahmad qassemi wrote: > Dear

[scikit-learn] question

2019-10-19 Thread ahmad qassemi
Dear Mr/Mrs, I'm a PhD student in DS. I'm trying to use your provided code on *Spectral CoClustering *and *Spectral Biclustering* to bi-cluster my data matrix ( https://scikit-learn.org/stable/modules/biclustering.html). Since my data has complex values, i.e., matrix elements are complex, your mo

Re: [scikit-learn] Question about Kmeans implementation in sklearn

2019-08-05 Thread Chris Aridas
Hey Serafim, In this line https://github.com/scikit-learn/scikit-learn/blob/1495f69242646d239d89a5713982946b8ffcf9d9/sklearn/cluster/k_means_.py#L303 you can see that a randomstate object is constructed and that object is passed in the for loop that you are referring to, not the integer value that

[scikit-learn] Question about Kmeans implementation in sklearn

2019-08-05 Thread serafim loukas
Dear Sklearn community, I have a simple question concerning the implementation of KMeans clustering algorithm. Two of the input arguments are the “n_init” and “random_state”. Consider a case where “n_init=10” and “random_state=0”. By looking at the source code (https://github.com/scikit-lear

Re: [scikit-learn] question using GridSearchCV

2019-07-24 Thread Glenn Schultz via scikit-learn
Thank you for answering ... makes sense now that you point it out. Sent from my iPhone > On Jul 24, 2019, at 2:57 PM, Andreas Mueller wrote: > > scoring is not a parameter. > It needs to be passed to GridSearchCV > > selfCLF =GridSearchCV(GradientBoostingClassifier(), parameters, versose = 3m

Re: [scikit-learn] question using GridSearchCV

2019-07-24 Thread Andreas Mueller
scoring is not a parameter. It needs to be passed to GridSearchCV selfCLF =GridSearchCV(GradientBoostingClassifier(), parameters, versose = 3m n_jobs = 4), scoring='roc_auc') On 7/24/19 1:24 PM, Glenn Schultz via scikit-learn wrote: I am using GBClassifier, the below works if I use the defau

[scikit-learn] question using GridSearchCV

2019-07-24 Thread Glenn Schultz via scikit-learn
I am using GBClassifier, the below works if I use the default accuracy but it fails using roc_auc or roc_auc_score. I have found many examples to work with but for the life of me I can’t get it two work with roc_auc. What am I doing wrong. from sklearn.ensemble import GradientBoostingClassifi

[scikit-learn] [Question & Help]The criterion of data size for choosing a right algorithm.

2019-02-14 Thread skim22
Dear Sir or Madam, Good morning, My name is Steven Kim from Memphis, and I am a graduate student at the University of Memphis. Recently, I found the page of choosing the right estimator on the official website (https://scikit-learn.org/stable/tutorial/machine_learning_map/index.html). It was gr

Re: [scikit-learn] Question about contributing to scikit-learn

2018-12-10 Thread parker x
Hi Emmanuel and Joel, Thanks very much for your advice. I will take a look at small issues first and see what to contribute from there. Best, Parker eamanu15 于2018年12月9日周日 上午6:17写道: > Hello Parker, > > I can tell you my experience. > > I start to contribute to sklearn two month ago, and I star

Re: [scikit-learn] Question about contributing to scikit-learn

2018-12-09 Thread eamanu15
Hello Parker, I can tell you my experience. I start to contribute to sklearn two month ago, and I start with code review, this way I can learn how sklearn is written and how is the workflow, read issue and try to solve them. Then, I make some PR. I can tell that the core devs are very friendly a

Re: [scikit-learn] Question about contributing to scikit-learn

2018-12-08 Thread Joel Nothman
Hi Parker, We strongly urge new contributors to start with small issues (documentation, small fixes, etc.) to gain confidence in the contribution procedure, etc. Once you've worked on small issues and understand better what comes through the issue tracker, you can consider bigger contributions. W

[scikit-learn] Question about contributing to scikit-learn

2018-12-04 Thread parker x
Dear scikit-learn developers, My name is Parker, and I'm a data scientist. Scikit-learn is a great ML library that I work frequently for work and personal projects. I have always wanted to contribute something to the scikit-learn community, and I am wondering if you could give some opinions on fo

Re: [scikit-learn] Question about get_params / set_params

2018-10-28 Thread Guillaume Lemaître
On Sun, 28 Oct 2018 at 09:31, Louis Abraham via scikit-learn < scikit-learn@python.org> wrote: > Hi, > > According to > http://scikit-learn.org/0.16/developers/index.html#get-params-and-set-params > , > get_params and set_params are used to clone estimators. > sklearn.base.clone is function used

[scikit-learn] Question about get_params / set_params

2018-10-28 Thread Louis Abraham via scikit-learn
Hi, According to http://scikit-learn.org/0.16/developers/index.html#get-params-and-set-params , get_params and set_params are used to clone estimators. However, I don't understand how it is used in FeatureUnion: `retur

[scikit-learn] Question about dummy coding using DictVectorizer or FeatureHasher: generating correlated dimensions

2017-11-06 Thread Yusuke Nishioka
Hello, I have a question about dummy coding using DictVectorizer or FeatureHasher. ``` >>> from sklearn.feature_extraction import DictVectorizer, FeatureHasher >>> D = [{'age': 23, 'gender': 'm'},{'age': 34, 'gender': 'f'},{'age': 18, 'gender': 'f'},{'age': 50, 'gender': 'm'}] >>> m1 = FeatureHas

Re: [scikit-learn] question for using GridSearchCV on LocalOutlierFactor

2017-10-22 Thread Hristo Georgiev
Hi, As it has been indicated by other members, methods such as ``LocalOutlierFactor`` do not expose a ``predict`` method by design. However, if you nevertheless would still like to keep experimenting in the direction of attempting to make predictions on "unseen" data, you could simply create a s

Re: [scikit-learn] Question about LDA's coef_ attribute

2017-10-16 Thread Serafeim Loukas
Dear Alex, Thank you for the prompt response. Are the eigenvectors stored in some variable ? Does the lda.scalings_ attribute contain the eigenvectors ? Best, Serafeim > On 16 Oct 2017, at 16:57, Alexandre Gramfort > wrote: > > no it stores the direction of the decision function to match the

Re: [scikit-learn] Question about LDA's coef_ attribute

2017-10-16 Thread Alexandre Gramfort
no it stores the direction of the decision function to match the API of linear models. HTH Alex On Mon, Oct 16, 2017 at 3:27 PM, Serafeim Loukas wrote: > Dear Scikit-learn community, > > Since the documentation of the LDA > (http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_a

[scikit-learn] Question about LDA's coef_ attribute

2017-10-16 Thread Serafeim Loukas
Dear Scikit-learn community, Since the documentation of the LDA (http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.LinearDiscriminantAnalysis.html ) is n

Re: [scikit-learn] question for using GridSearchCV on LocalOutlierFactor

2017-10-09 Thread Andreas Mueller
What are you trying to achieve with this code? If you label everything as 1, the highest accuracy will be obtained if everything is labeled as 1. So even if the interface was implemented, the result would not be helpful. On 10/06/2017 12:53 AM, Lifan Xu wrote: Hi,     I was trying to train a

Re: [scikit-learn] question for using GridSearchCV on LocalOutlierFactor

2017-10-08 Thread Albert Thomas
Hi, As Joel said LOF is not designed to be applied on unseen data. Therefore there is no public predict. Albert On Sun 8 Oct 2017 at 06:17, Joel Nothman wrote: > actually I'm probably wrong there, but you may not be able to use accuracy > ___ > sciki

Re: [scikit-learn] question for using GridSearchCV on LocalOutlierFactor

2017-10-07 Thread Joel Nothman
actually I'm probably wrong there, but you may not be able to use accuracy ___ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn

Re: [scikit-learn] question for using GridSearchCV on LocalOutlierFactor

2017-10-07 Thread Joel Nothman
I don't think LOF is designed to apply to unseen data. ___ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn

[scikit-learn] question for using GridSearchCV on LocalOutlierFactor

2017-10-05 Thread Lifan Xu
Hi, I was trying to train a model for anomaly detection. I only have the normal data which are all labeled as 1. Here is my code: clf = sklearn.model_selection.GridSearchCV(sklearn.neighbors.LocalOutlierFactor(), parameters, scoring="acc

Re: [scikit-learn] Question-Early Stopping MLPClassifer RandomizedSearchCV

2017-08-14 Thread Andreas Mueller
Yes, you understood correctly. You can see the implementation in the code: https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/neural_network/multilayer_perceptron.py#L491 It calls ``train_test_split``, so it's a random subset of the data. Currently the API doesn't allow providing y

[scikit-learn] Question-Early Stopping MLPClassifer RandomizedSearchCV

2017-08-11 Thread fabian . sippl
Hello Scikit-Learn Team,   I´ve got a question concerning the implementation of Early Stopping in MLPClassifier. I am using it in combination with RandomizedSearchCV. The fraction used for validation in early stopping is set with the parameter validation_fraction of MLPClassifier. How is the val

Re: [scikit-learn] question about class_weights in LogisticRegression

2017-08-03 Thread Tom DLT
The class weights and sample weights are used in the same way, as a factor specific to each sample, in the loss function. In LogisticRegression, it is equivalent to incorporate this factor into a regularization parameter C specific to each sample. Tom 2017-08-01 18:30 GMT+02:00 Johnson, Jeremiah

Re: [scikit-learn] question about class_weights in LogisticRegression

2017-08-01 Thread Johnson, Jeremiah
Right, I know how the class_weight calculation is performed. But then those class weights are utilized during the model fit process in some way in liblinear, and that¹s what I am interested in. libSVM does class_weight[I] * C (https://www.csie.ntu.edu.tw/~cjlin/libsvm/); is the implementation in li

Re: [scikit-learn] question about class_weights in LogisticRegression

2017-08-01 Thread Stuart Reynolds
I hope not. And not accoring to the docs... https://github.com/scikit-learn/scikit-learn/blob/ab93d65/sklearn/linear_model/logistic.py#L947 class_weight : dict or 'balanced', optional Weights associated with classes in the form ``{class_label: weight}``. If not given, all classes are supposed to h

[scikit-learn] question about class_weights in LogisticRegression

2017-08-01 Thread Johnson, Jeremiah
Hello all, I'm looking for confirmation on an implementation detail that is somewhere in liblinear, but I haven't found documentation for yet. When the class_weights='balanced' parameter is set in LogisticRegression, then the regularisation parameter for an observation from class I is class_wei

[scikit-learn] Question about the Library of “sklearn.neural_network.BernoulliRBM” that Creates Highly Correlated Features.

2017-07-27 Thread Masanari Kondo
Dear all, I’m using the sklearn library to generate new features of a dataset using a Restricted Boltzmann Machine (RBM, sklearn.neural_network.BernoulliRBM). I use the following environment: python 3.5.0 numpy==1.11.1 scikit-learn==0.18 I have already tried a large number of iterations (n_iter

Re: [scikit-learn] question about scikit-learn

2017-05-04 Thread Andreas Mueller
On 05/03/2017 08:05 AM, 熊瑶 wrote: Dear professor, scikit-learn is really good for me to do some work using machine learning method. Here, I have two questions: 1)To do 5 fold cross-validation, when I use StratifiedKFold,I could get stratified folds that each fold contains approximately the

[scikit-learn] question about scikit-learn

2017-05-03 Thread 熊瑶
Dear professor, scikit-learn is really good for me to do some work using machine learning method. Here, I have two questions: 1)To do 5 fold cross-validation, when I use StratifiedKFold,I could get stratified folds that each fold contains approximately the same percentage of samples of ea

[scikit-learn] question about scikit-learn

2017-05-03 Thread 熊瑶
Dear professor, scikit-learn is really good for me to do some work using machine learning method. Here, I have two questions: 1)To do 5 fold cross-validation, when I use StratifiedKFold,I could get stratified folds that each fold contains approximately the same percentage of samples of ea

Re: [scikit-learn] question in using Scikit-learn MLPClassifier?

2016-12-06 Thread Sebastian Raschka
Hi, typically, you want/need to play around with the hyperparameters if you want to get something useful out of an MLP — they rarely work out of the “box” since hyperparameters are very context-dependent. > However, the accuracy rate is not satisfied comparing to the result in Matlab > which us

[scikit-learn] question in using Scikit-learn MLPClassifier?

2016-12-06 Thread linjia
Hi all: I uses a ‘Car Evaluation’ dataset from http://archive.ics.uci.edu/ml/machine-learning-databases/car/car.data to test the effect of MLP. (I transfer some class in the data to digit value, e.g. ‘low’ to 1 ‘med’ to 2, ‘high ’to 3, the final dataset’s input is 6 dimension, output l

Re: [scikit-learn] question about using sklearn.neural_network.MLPClassifier?

2016-11-23 Thread Sebastian Raschka
/stackoverflow.com/questions/36819287/mlp-classifier-of-scikit-neuralnetwork-not-working-for-xor > > > 发件人: scikit-learn > [mailto:scikit-learn-bounces+linjia=ruijie.com...@python.org] 代表 Raghav R V > 发送时间: 2016年11月23日 19:04 > 收件人: Scikit-learn user and developer mailing li

Re: [scikit-learn] question about using sklearn.neural_network.MLPClassifier?

2016-11-23 Thread Raghav R V
Hi, If you keep everything at their default values, it seems to work - ```py from sklearn.neural_network import MLPClassifier X = [[0, 0], [0, 1], [1, 0], [1, 1]] y = [0, 1, 1, 0] clf = MLPClassifier(max_iter=1000) clf.fit(X, y) res = clf.predict([[0, 0], [0, 1], [1, 0], [1, 1]]) print(res) ```

[scikit-learn] question about using sklearn.neural_network.MLPClassifier?

2016-11-23 Thread linjia
Hi everyone I try to use sklearn.neural_network.MLPClassifier to test the XOR operation, but I found the result is not satisfied. The following is code, can you tell me if I use the lib incorrectly? from sklearn.neural_network import MLPClassifier X = [[0, 0], [0, 1], [1, 0], [1, 1]] y =

Re: [scikit-learn] Question about Python's L2-Regularized Logistic Regression

2016-09-29 Thread Michael Eickenberg
That should totally depend on your dataset. Maybe it is an "easy" dataset and not much regularization is needed. Maybe use PCA(n_components=2) or an LDA transform to take a look at your data in 2D. Maybe they are easily linearly separable? Sklearn does not do any feature selection if you don't as

Re: [scikit-learn] Question about Python's L2-Regularized Logistic Regression

2016-09-29 Thread Sebastian Raschka
Hi, Kristen, there shouldn’t be any internal feature selection going on behind the scenes. You may want to compare the weight coefficients of your regularized vs unregularized model, if they are exactly the same, then this would be an indicator that something funny is going on. Otherwise, it cou

[scikit-learn] Question about Python's L2-Regularized Logistic Regression

2016-09-29 Thread Kristen M. Altenburger
Hi All, I am trying to understand Python’s code [function ‘_fit_liblinear' in https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/svm/base.py] for fitting an L2-logistic regression for a ‘liblinear’ solver. More specifically, my [approximately balanced class] dataset is such that t

[scikit-learn] Fwd: [Scikit-learn-general] MultinomialNB Scikit-learn question

2016-09-26 Thread Bharat Didwania 4-Yr B.Tech. Electrical Engg.
-- Forwarded message -- From: Bharat Didwania 4-Yr B.Tech. Electrical Engg. < bharat.didwania.ee...@itbhu.ac.in> Date: Mon, Sep 26, 2016 at 11:04 PM Subject: Re: [Scikit-learn-general] MultinomialNB Scikit-learn question To: scikit-learn-gene...@lists.sourceforge.net It see

Re: [scikit-learn] Question regarding kernel PCA implementation in scikit-learn

2016-07-15 Thread Mathieu Blondel
Forwarding your question to the mailing-list. On Thu, Jul 14, 2016 at 10:33 PM, Christos Lataniotis < latanio...@ibk.baug.ethz.ch> wrote: > Dear Mathieu Blondel, > > I am a PhD student working on some machine-learning aspects related to > dimensionality reduction. One of the methods that is of in

[scikit-learn] Question about error of LLE and backtransformation of coordinates

2016-06-16 Thread Matthieu Brucher
Hi! The errors are quite small compared to the machine precision. As the reduction is also an approximation of the underlying manifold, not an "isotropic" one as well (you can see int he example that red points are less squashed together than blue ones), you won't have a perfect reconstruction eit