Machine learning framework for Python.

learn more… | top users | synonyms (1)

1
vote
1answer
24 views

Random forest low score on testing data (scikit-learn)

I am trying to train my model using Scikit-learn's Random forest (Regression) and have tried to use GridSearch with Cross-validation (CV=5) to tune hyperparameters. I fixed ...
0
votes
0answers
38 views

Confused Scikit results

I am doing classification machine learning on a particular dataset on which an SVM model (using Scikit.learn) is giving a Matthew's correlation coefficient (MCC) of ...
0
votes
1answer
19 views

Logistic regression using ANOVA kernel in SKLearn?

In RapidMiner, you can run a logistic regression classifier with multiple kernel types. I see no options in sklearn.linear_models.LogisticRegression. Does anybody ...
3
votes
2answers
25 views

Features, samples, and over-fitting?

I have a data set with 30 samples, 2 classes, and 100,000 features. When I run an SVC classifier on it from SKLearn using stratified cross-validation, the accuracy is barely better than chance. After ...
1
vote
0answers
26 views

How would one use KDE as a one 1D clustering method?

I need to cluster a simple univariate data set into a preset number of clusters. Technically it would closer to binning or sorting the data since it is only 1D, but my boss is calling it clustering, ...
1
vote
2answers
57 views

Weighting time series data for prediction

I am building a simple random forest to predict soccer results in sckit. I simply train the model to predict each teams score based on various features. However I am trying to think how I can weight ...
1
vote
0answers
24 views

Which standard deviation of the cross-validation score?

When doing cross-validation for model selection, I found there are many ways to quote the "standard deviation" for the cross-validation scores (here "score" means an evaluation metric e.g. accuracy, ...
0
votes
0answers
6 views

Question about the Scikit-learn “SVM-Anova: SVM with univariate feature selection” example

Can anyone explain to me why in the Scikit-learn "SVM-Anova: SVM with univariate feature selection" example http://scikit-learn.org/stable/auto_examples/svm/plot_svm_anova.html when we use all ...
2
votes
0answers
75 views

Car out of route

I have one KML file that describes the movement of a car. Data comes from sensor in the car, contains wrong or noisy measurements. I want to filter the wrong measurements, i.e. throw away the ...
0
votes
0answers
10 views

Reason for Sci-kit DecisionTree very poor performance on UCI SoyBean compared to Weka J48

I am applying Sci-kit DecisionTreeClassifier classifier on the commonly used UCI soybean dataset. The resulting accuracy is only 0.49, which is very low compared to 0.93 I am getting for Weka's J48 on ...
0
votes
0answers
28 views

Ensembling with VotingClassifier

I am using VotingClassifier from sklearn.ensemble however i am puzzled with the results. Consider following algorithms: ...
1
vote
1answer
58 views

Cross-validation vs random sampling for classification test

I usually have used cross-validation for testing classification performance. However, I read about the article that random sampling (bootstrapping) works better in many cases. I am not sure which one ...
0
votes
0answers
24 views

Feature Selection Order

I am implementing univariate feature selection from feature selection!. I have several features among which I am intending to select some features and proceed. Should I scale my data before applying ...
0
votes
2answers
54 views

The trade-off between p-value and sample size

This question stems from an existing question, in which I tried to compute the p-value of some features over a large dataset (2,000,000 articles and 15-20 topics). Each article must belong to only one ...
0
votes
0answers
25 views

Correlation of feature and class

I've been working on a doc classification problem, early on I had a hypothesis that doc length may be used to classify the input docs. This is a binary classification problem. First I'm looking to ...
0
votes
1answer
47 views

Is it normal that p-value getting from F-regression is very small (even zero)?

I am trying to evaluate the significance of two attributes: article length and article topic. The target variable is total article reading time (in seconds). The topic attribute is categorical. So I ...
5
votes
1answer
64 views

how does multicollinearity affect feature importances in random forest classifier?

I have a random forest binary classifier, but the results from the feature importances are somewhat erratic. Here's what I want to know: Does multicollinearity ...
0
votes
1answer
41 views

K-fold in grid-search for linear svm C parameter giving same value?

So every time I do a GridSearchCV with KFold, stratified or not, I get the same accuracy score and STDev for values of C=1,C=10, and C=100. I then did a special ...
0
votes
0answers
13 views

splitting pipeline in sklearn

I have a pandas dataframe df with the following features: visitor_id, feature_1, feature_2, ..., feature_100, truth_labels I implemented the following model on ...
1
vote
1answer
46 views

Loss Function of scikit-learn LogisticRegression

I am having trouble to understand the loss function scikit-learn uses to fit logistic regression, which can be found here. Specifically I have problem with the second term. It seems very different ...
1
vote
0answers
38 views

Single CV yields higer prediction error estimate compared to nested CV

I'm trying to calculate an unbiased prediction error estimate for a regression problem with random forest. Dataset dimension is ~25100x13. So, as a first step, I used a nested 10/10-fold CV loop ...
0
votes
0answers
12 views

Finding the stability of selected parameter values?

I have a system (not a predictive model) that will produce four results (R1 to R4) given a set of input data. The system can be tuned using four parameters (P1 to P4). I can find the maximum value for ...
1
vote
0answers
36 views

SVM predicts everything in one class

I'm running a basic language classification task. There are two classes (0/1), and they are roughly evenly balanced (689/776). Thus far, I've only created basic unigram language models and used these ...
3
votes
0answers
62 views

Gaussian-Process (scikit-learn) Prediction Confidence Interval Oddities - Stats Question

I'm doing some particle physics analysis and was hoping someone out there could give me some insight on a Gaussian-Process fit I'm trying to use to extrapolate some data. I have data with ...
0
votes
1answer
33 views

How do I model seasonal patterns for underprediction?

I want to predict sales in food-vending machines (to ultimately prevent food waste). I work with scikit learn. My current models are not too bad, but they show ...
1
vote
1answer
73 views

Find K-nearest neighbour with custom distance metric

I am working on finding similar items. Each item has a representation as a vector of features. Instead of using one kind of distance metric for each feature like "ëuclidean" distance. I want a mixture ...
2
votes
1answer
40 views

What is scikit-learn's LogisticRegression minimizing?

I have used linear_model.LogisticRegression for a classification problem, with L1 regularization. My first tests were very satisfactory. However, my previous tests ...
2
votes
1answer
38 views

Weights in LinearSVC change if we magnify features

I have been experimenting with SK-Learn's Support Vector Machines, specifically the LinearSVM. I have found myself in the position where I have been given two different calculations of the feature ...
1
vote
1answer
25 views

Probabilistic classification using kernel density estimation

Assuming $X$ is a data set represented in form of a matrix. Each row represents an instance of the data with every instance consisting of values $x_1,...,x_n$ as the attribute values and a class ...
3
votes
1answer
216 views

Why is ridge regression giving different results in Matlab and Python?

Why is the output from Matlab and Python vary for ridge regression? I use the ridge command in Matlab and scikit-learn in Python ...
0
votes
0answers
20 views

Sklearn OneVsRestClassifier and predict_proba function

I was going through the sklearn documentation and I read that Onevsrest classifier can be used for multilabel problems also there is a predict_proba function in few of the classifiers that can be used ...
1
vote
0answers
14 views

Question regarding K-Means Multilable problem

I have a dataset where for a set of features I have a single label but in my prediction I wanted to predict upto 5 labels for each test data. The labels are categorical and the number of distinct ...
0
votes
0answers
42 views

Predicting probability of each class

How can I use the sklearn classification algorithms to predict the probability of a class instead of the class. In other words, if my train data has classes A, B, C, D and E, for each row of the test ...
0
votes
0answers
37 views

Boltzmann Machines / factor analysis in scikit learn

this excellent blog entry explains the Boltzmann machine in terms of factor analysis. I am trying to replicate the example given usng scikit learn but I may be missing something as the the results I ...
0
votes
0answers
60 views

How to interpret poor $R^2$ score but good RMSE value?

I split my data into training set and test set and am running linear regression on it. I am using Python's "scikit" library and I am getting an $R^2$ score of 0.31 and an RMSE value of 0.037. The ...
1
vote
1answer
49 views

The importance of the features for a logistic regression model

I have a traditional logistic regression model. I want to know how I can use coef_ parameter to evaluate which features are important for positive and negative ...
1
vote
0answers
15 views

Treating Categorical Variables as Continuous for Random Forest / Adaboost

What's the correct way to deal with categorical variables in packages like sklearn's RF and xgboost? Is there any cons of treating the variables are continuous? E.g. encode class A as 1, class B as ...
1
vote
1answer
85 views

Very Confused: Getting AUC of 1 and 100% accuracy for classification task

I am building a healthcare readmission model. It is a binary classification task. I had around 90K observations with close 500 features. Except 9-10 features, rest all are binary features. I did 5 ...
0
votes
0answers
11 views

Multinomial Naive Bayes Failing for Identity Mapping

I am trying to find out why the MultinonmialNB classifier sklearn.naive_bayes fails when assigned to predict its own class with ...
0
votes
0answers
14 views

GridSearch returns different result than metrics.precision_score

I have a quite simple text classification setup where i need to optimize the precision score. I use scikit-learn with a LinearSVC and a TfidfVectorizer. To find the optimal parameters, i use a ...
-1
votes
1answer
26 views

ROC_AUC is better then ballanced accuracy

I'm testing different algorithms like: logistic regression, SVM's.... with a 10 fold nested Cross-validation. I'm using scikit-learn with gridsearchCV. But it is a little bit strange, that nearly ...
0
votes
0answers
28 views

Feature scaling suggestion for highly positive skewed data in features

In my data, there are two features with ranges below Ranges feature 1 (numeric discrete) : 0 - 20 feature 2 (numeric continuous) : 0 - 250 I have ...
0
votes
0answers
40 views

Why is this basic LinearSVC (from sklearn) prediction example inaccurate?

Using the LinearSVC from sklearn, the following code predicts the class 3 where you might reasonably expect a 2 (as a vanilla SVC does), what's going on? X is the input vector, y the classes for ...
1
vote
1answer
132 views

How to fix non-convergence in LogisticRegressionCV

I'm using scikit-learn to perform a logistic regression with crossvalidation on a set of data (about 14 parameters with >7000 normalised observations). I also have a target classifier which has a ...
0
votes
1answer
50 views

Better accuracy with validation set than test set

I trained a model with some algorithms like random forest, logistic regression and so on. My dataset was split into 80% CV train data (so actually 60% of data to train the model and 20 % for testing ...
0
votes
0answers
73 views

Cross Validation in SVM for Kaggle Titanic dataset

I am new to application of Machine Learning on real world problems but have theoretical understanding of different Machine Learning models. I am using SVM for classification purpose in Titanic Dataset ...
2
votes
1answer
44 views

Performing K-fold Cross-Validation: Using Same Training Set vs. Separate Validation Set

I am using the Python scikit-learn framework to build a decision tree. I am currently splitting my training data into two separate sets, one for training and the other for validation (implemented via ...
0
votes
0answers
21 views

Scikit Learn - Precision Recall Values per each holdout data instance

In Scikit-learn I am trying to plot Precision-Recall Curve on holdout data instances. Instead of plotting the curve on model thresholds, I want to plot Precision-Recall values for each instance of ...
0
votes
0answers
25 views

Grid Search for Multi-label Classification: Averaged or Individual Class(s) Score?

Apologize for unclear title, please help edit it to make clarity if possible. I am trying to use binary relevance to solve the multi-label problem. When it comes to model tuning, I am wondering ...
0
votes
1answer
123 views

Scoring a classifier with ROC AUC

I'm confused about how scikit-learn's roc_auc_score is working. As I understand it, an ROC AUC score for a classifier is obtained as follows: Sample from the parameter space Fit the model Make ...