Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 55122

scikit-learn is a popular machine learning package for Python that has simple and efficient tools for predictive data analysis. Topics include classification, regression, clustering, dimensionality reduction, model selection, and preprocessing.

1 vote
Accepted

Significance of Number of Calls and Reset Call in Ball Tree

Indeed, they don't seem to be used for anything. Probably they were included for some initial debugging? An issue (and a linked PR) discussing these methods: https://github.com/scikit-learn/scikit-le …
Ben Reiniger's user avatar
  • 12.3k
0 votes

Criteria used to create and select leaf nodes in sklearn

Pre-pruning is handled by a variety of parameters: max_depth, min_samples_split, min_samples_leaf, min_weight_fraction_leaf, max_leaf_nodes, and min_impurity_decrease. Post-pruning is relatively new t …
Ben Reiniger's user avatar
  • 12.3k
1 vote

Error trying to do a GridSearchCV()

I don't get that (or any) error (after correcting your paramators to parameters). That said, if you only want to use one solver, you might as well pass it directly to the estimator and leave it out o …
Ben Reiniger's user avatar
  • 12.3k
2 votes

Poisson regression options in python

Scikit-learn v0.23 now has PoissonRegressor: https://scikit-learn.org/0.23/auto_examples/release_highlights/plot_release_highlights_0_23_0.html#generalized-linear-models-and-poisson-loss-for-gradient …
Ben Reiniger's user avatar
  • 12.3k
0 votes
Accepted

how to create sklearn pipeline object using predtrained standardscalar object

This works the way you would want out of the box. pipeline takes standard scaler class No, pipelines get initialized with estimator instances, not the classes. (This is why you need the parentheses …
Ben Reiniger's user avatar
  • 12.3k
1 vote

Calibration Curve Error

It's hard to say without your data. I'd comment this, but it's a bit long and better formatted as an answer. The part of the source code that's relevant is quite short, so you can go through step by …
Ben Reiniger's user avatar
  • 12.3k
2 votes

What is the difference between lightgbm.LGBMModel and lightgbm.LGBMClassifier?

Glancing at the source (available from your link), it appears that LGBMModel is the parent class for LGBMClassifier (and Ranker and Regressor). You should probably stick with the Classifier; it enfor …
Ben Reiniger's user avatar
  • 12.3k
1 vote
Accepted

Problem trying to build my own sklean transformer

The definition of dic should happen inside the fit method; you're wanting the rates to be based on the dataframe passed to fit. So you'll want to set dic as another class attribute, to be referenced …
Ben Reiniger's user avatar
  • 12.3k
1 vote

Multilabel classification for a learning to rank application

In the multinomial mode, the docs specify that the outputs of coef_ and intercept_ are as you are seeing them: one output for each target class. The underlying model is three logistic regressions, who …
Ben Reiniger's user avatar
  • 12.3k
1 vote

(Scikit-learn) differences between LinearSVC, 'linear' kernel SVC and poly kernel SVC with d...

You can see in the user guide that the first two will not produce the same results. In the multiclass setting, LinearSVC uses one-vs-rest while SVC uses one-vs-one. Aside from that, the solver used …
Ben Reiniger's user avatar
  • 12.3k
1 vote

train_test_split() error: Found input variables with inconsistent numbers of sample

Your independent variables need to be passed to the classifier's fit as a 2D array, but yours is 1D; you can use numpy's reshape: https://stackoverflow.com/questions/30813044/sklearn-found-arrays-with …
Ben Reiniger's user avatar
  • 12.3k
2 votes

Sklean pipeline order

I'll agree with @BrianSpiering on general approaches, and with you that this is a no-free-lunch situation. But... Oversampling seems reasonably to fit in just about anywhere. It may depend on what …
Ben Reiniger's user avatar
  • 12.3k
2 votes
Accepted

Simple Imputer cannot impute by column

I don't think it's trying to impute across rows; rather, it's trying to impute in the dates column. You may want to use ColumnTransformer to select which columns to impute.
Ben Reiniger's user avatar
  • 12.3k
0 votes

Retrieve dropped column names from `sklearn.impute.SimpleImputer`

SimpleImputer drops columns consisting entirely of missing values. It is indeed unpleasant when trying to associate original columns; the sklearn devs have been discussing this: https://github.com/s …
Ben Reiniger's user avatar
  • 12.3k
1 vote

Is there a way to get the sample weights that were used to fit a scikit-learn estimator?

A quick search of the source code, e.g. RandomForestClassifier's, doesn't find anywhere that sample_weight gets saved as a class attribute. I suspect that was a conscious decision: the sample weights …
Ben Reiniger's user avatar
  • 12.3k

1
2 3 4 5
9
15 30 50 per page