Machine learning framework for Python.

learn more… | top users | synonyms (1)

1
vote
1answer
34 views

Why is my high degree polynomial regression model suddenly unfit for the data?

I'm building a ridge regression model in scikit-learn and trying to find the optimal degree polynomial to use. The data I'm working with is a fairly predictable time series of hourly traffic volumes, ...
1
vote
0answers
19 views

How to calculate p-value for significance test of variables in linear regression

I am trying to find the significance of predictors while using different linear regression models (I am using Python scikit-learn). Scikit-learn does not provide the pvalues of predictors( at least i ...
1
vote
1answer
22 views

Scikit-learn Normalization mode (L1 vs L2 & Max)

I was wondering if anyone here can explain the difference between the l1, l2 and max normalization mode in sklearn.preprocessing.normalize() module? Having read the documentation I couldn't realize ...
0
votes
0answers
6 views

Varying outputs for the same train and test data

I have the below sample code in which I am using the sklearn(scikit-learn=0.16.1) 20newsgroup dataset: ...
0
votes
0answers
8 views

Evaluation of a binary classifier in regards of rounding, taking average scores

I'm using scikit-learn to evaluate a binary classifier: There are 2 Methods to get the Precision, Recall and F1 scores: 1.classification_report: ...
2
votes
0answers
40 views

How to know which statistical model to use for categorical data?

I'm new to statistical analysis. I'm trying to conduct an analysis of datapoints and possible correlations between them using Python's sci-kit learn library. My data is categorical. For example, a ...
1
vote
0answers
31 views

Why would a random forest model be biased towards sensitivity/specificity?

I am training a random forest model using the sk-learn library, for a binary classification task. For some reason, when I set the max_depth parameter to 1, the model has an average 90% accuracy on ...
0
votes
1answer
10 views

Why does sklearn's version of t-SNE project 40 versions of the same point to 40 different points

I'm not certain if my error lies in my understanding of python's sklearn or of t-SNE, but I have (essentially), the following code: ...
0
votes
0answers
20 views

Cross-validating an ordinal logistic regression in R (using rpy2) [migrated]

I'm trying to create a predictive model in Python, comparing several different regression models through cross-validation. In order to fit an ordinal logistic model (...
1
vote
1answer
77 views

One-hot vs dummy encoding in Scikit-learn

There are two different ways to encoding categorical variables. Say, one categorical variable has n values. One-hot encoding converts it into n variables, while dummy encoding converts it into n-1 ...
0
votes
1answer
17 views

Subset documents based on tfidf weights

I am new with text mining therefore please bare me if this question sound too easy for others. But I tried to find out the solution with no success. I am working on a project of document ...
0
votes
0answers
15 views
0
votes
0answers
30 views

Svm taking a long time and still not giving results?

I was trying my hands on the problem of Forest Cover Prediction... I tried using SVM first for this multi class classification problem. This is my ipython notebook. So in that notebook, if I try ...
0
votes
0answers
19 views

Show Training Iteration Score for Logistic Regression Classifier sklearn

I'm making a text classification using Logistic Regression classifier in sklearn. it's working really nice. but now I'm curious about something. is it possible to show training score for each ...
1
vote
0answers
10 views

Per-instance cost-aware learning?

I have a situation where the misclassification cost depends on the instance, i.e. on the independent variables. In my training set I have for each instance the independent variables plus a vector of ...
0
votes
1answer
19 views

Why is the area under this KDE with bandwidth=1 only .5?

I am misunderstanding KDE. I thought area under the curve was always unity. Take this simple example and with bandwidth 1 area under curve is .5. If I make bandwidth .5 then area is 1. Please can ...
0
votes
0answers
11 views

Decision Tree / Random Forest with constraints

I would like to add constraints during the process of selection of features during tree generation : By Expert knowledge/physical constraints, some feature are hiearchically on top. If stateA > ...
0
votes
1answer
16 views

How do I learn a simple cut-off value between 2 classes given one-dimensional data?

Given a set of data which consists of a single real number and a class, I want to find a value (i.e., the inflection point if we were talking about logistic regression) which would lie right at the ...
0
votes
2answers
90 views

random forest how to use the results

I used the package for random forest. It is not clear to me how to use the results. In logistic regression you can have an equation as an output, in standard tree some rules. If you receive a new ...
0
votes
0answers
10 views

How to tune hyperparameters for LLE?

I'm running LLE using Scikit-Learn (with the LocallyLinearEmbedding class), but there are a few hyperparameters and I would like to use grid search with cross-...
1
vote
2answers
45 views

Interpreting multinomial logistic regression in scikit-learn

I am running a multinomial logistic regression for a classification problem involving 6 classes and four features. Here is the code: ...
0
votes
1answer
22 views

Combining two or more (SVC) models in Python/scikit.learn

I have some data which I use SVC models with 10 fold cross validation and a parameter grid search on (scikit.learn). I observed that the predictions of some folds have low accuracy, whereas remained ...
1
vote
1answer
29 views

Score for classification of dataset composed by different class with class imbalance

I am searching for a classification score, preferably provided by Python scikit-learn, to evaluate classification in a cross-validation routine. This classification score must be suitable for: ...
0
votes
0answers
12 views

How to convert a Scikit-learn dataset to a Pandas dataset? [migrated]

How do I convert data from a Scikit-learn Bunch object to a Pandas DataFrame? ...
2
votes
0answers
31 views

Model score vs error function value

The model is trained with respect to custom error function. For example: ...
0
votes
0answers
35 views

What is maximum likelihood estimation in logistic regression? [duplicate]

Can you please explain in simple way. Is it so important in logistic regression?
0
votes
0answers
16 views

Problem with syntetic data generating for Probabilistic PCA and Factor Analysis (FA) comparison - methodology

I am trying to understand a short example related to dimension reduction from python scikit-learn.org official documentation for long time and unfortunately I am not successful. I don't have problems ...
1
vote
0answers
50 views

Cheminformatics in R v Python [closed]

I have a process that will produce Cheminformatics models"CM" in R. The process is designed to produce the optimal subspace for a given dataset. It looks like Python will run faster with large ...
0
votes
0answers
21 views

The same input and different output form one-class SVM

I have applied scikit-learn OneClass SVM classifier to isolate the noisy tweets as outliers using one class training set. We use TfidfVectorizer class from sklearn to convert a collection of raw ...
0
votes
0answers
15 views

How can I enforce a cost matrix to a random forest in scikit-learn?

I am reading this paper on using cost-matrix for learning algorithms. I have used a random forest in scikit-learn for a binary classification of fraud/ no fraud events. Once I have fitted a random ...
1
vote
0answers
22 views

Using SKlearn SelectKBest f_classif for categorical values [closed]

I am trying to use SelectKBest f_classif on my data, which is of the following format: each observation is composed of a d-dimensional vector(d different features) and is associated with a label ...
19
votes
5answers
1k views

Overfitting: No silver bullet?

My understanding is that even when following proper cross validation and model selection procedures, overfitting will happen if one searches for a model hard enough, unless one imposes restrictions on ...
0
votes
0answers
17 views

Suspicious value of ks value in text classification problem

I am working on a text classification problem where the data set is highly imbalanced, with only 5 percent positive samples. Total size of the data set is also small at 1300 records. I tried ...
0
votes
0answers
6 views

When should the Pasting ensemble method be used instead of Bagging?

Pasting and Bagging are very similar, the main difference being that Bagging samples with replacement (which is called "bootstrapping") while Pasting samples without replacement. I am guessing that ...
0
votes
0answers
13 views

What is the use of BaggingClassifier's bootstrap_features parameter in Scikit-Learn?

Scikit-Learn's BaggingClassifier class has a hyperparameter called bootstrap_features. If I understand correctly, when it is ...
2
votes
0answers
20 views

Can I optimize for specificity using GridSearchCV in sklearn?

I am developing a fraud detection system for online purchases using random forests. My first concern was to optimize for recall, as the dataset was originally unbalanced (98% no fraud events and 2% ...
0
votes
0answers
7 views

could assigning class_weight = “balanced” give bad performance ?

i used class_weight = "balanced" and it gave me bad result worse than class_weight = None, although the data is unbalanced 1:2, i used it in logistic regression
1
vote
1answer
12 views

Choosing cases for assisted supervised learning

I have a bag of words binary text classification task. The SGD algorithm performed well for a certain target where number of labeled cases for training reached tens of thousands. For another target ...
1
vote
2answers
42 views

Analysising the difference between k-means and spectral clustering algorithm

My target is to cluster the spatial area based on the location(X,Y) and pollutant concentration(Z). So there would be three different attributes along the spatial area(n_sample = grid point) I have ...
0
votes
1answer
39 views

Why is KDE output negative?

As far as I know, PDFs always have positive co-domains, but here is an example of one that outputs negative numbers: http://scikit-learn.org/stable/modules/density.html ...
1
vote
0answers
33 views

Can Random Forest regression handle non-stationary input variables?

I am working on a project where the explanatory variables include soil attributes, land use and land cover properties, stream flow and climate (precipitation, temperature etc) measurements recorded at ...
0
votes
0answers
52 views

Update rule for multi-task lasso used in scikit-learn

The document of scikit-learn said it use coordinate descent for training multi-task lasso. I have tried to derive the update rule but its too hard for me. Can you show me what is update rule for multi-...
1
vote
0answers
38 views

How to calculate the distance in KNN for mixed data types?

when the data is from different types (numerical and categorical) of course euclidean distance alone or hamming distance alone can't help. so i have 2 approaches: standardize all the data with ...
0
votes
0answers
17 views

How to use the dataset for leave-one-ut CV?

I would appreciate some feedback on my leave one out CV procedure, because I am not sure it works correctly. 1.Load the files I am using 26 binary classified articles. Files are shuffled when ...
0
votes
4answers
47 views

Common values used for hyperparameter grid search?

When performing a grid search for exploring optimal hyperparameters, what are the typical values, or ranges, that are commonly used for alpha, epsilon, gamma, lambda, C, etc? I'm not focused on a ...
0
votes
0answers
25 views

Unequal misclassification costs for SVC?

I wonder if there is a way to specify custom cost function in sklearn/python? (atm I use sklearn SVC) My real problem has 7 different classes, but to make it more clear lets assume that I want to ...
0
votes
0answers
23 views

SK Learn with a user defined metric (again)

Someone posted a similar question here but i couldn't get my job done see http://stackoverflow.com/questions/21052509/sklearn-knn-usage-with-a-user-defined-metrgammaic i want to define my ...
0
votes
1answer
38 views

How does alpha relate to C in Scikit-Learn's SGDClassifier?

I'm trying to get the same linear SVM classifier model by using Scikit-Learn's SVC, LinearSVC and ...
0
votes
1answer
51 views

How to cluster an 1-D array by K-means or any other algorithm using scikit-learn? [closed]

I have an one dimensional toy array X. I want to cluster the data into some numbers of clusters.But when I try to fit my data in scikit-learn K-Means function it shows ValueError: n_samples=1 ...