Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • 18:27
    agramfort closed #15813
  • 18:27
    agramfort commented #15813
  • 18:24
    agramfort commented #15835
  • 18:24

    agramfort on master

    update _alpha_grid class in _co… (compare)

  • 18:24
    agramfort closed #15835
  • 18:21
    agramfort closed #15830
  • 18:21
    agramfort commented #15830
  • 17:54
    mjmikulski commented #15707
  • 17:38
    JJmistry opened #15835
  • 16:06
    smola opened #15834
  • 16:05
    J-A16 commented #15773
  • 15:00
    Travis scikit-learn/scikit-learn (master) fixed (42858)
  • 14:32
    qinhanmin2014 opened #15833
  • 14:29
    alfaro96 edited #15832
  • 14:27
    alfaro96 opened #15832
  • 13:36
    gittar edited #15831
  • 13:35
    gittar opened #15831
  • 12:28
    claramatos opened #15830
  • 10:51

    qinhanmin2014 on master

    ENH Allow two-element tuple as … (compare)

  • 10:51
    qinhanmin2014 closed #15707
Bin Wang
@thomasjpfan, you are right, however, I also tried to execute the above code too using %%cython magic also from sklearn.tree cimport _utils but still did not work. Was it supposed to be like that?
# requires numpy headers
from sklearn.tree._utils cimport Stack
s = Stack(10)
>>> AttributeError: 'sklearn.tree._utils.Stack' object has no attribute 'top'
I found the source code so well written, fascinating and really want to be able to get the development environment up and running.
Bin Wang
Weird, the above code will work if I replace s = Stack(10) with cdef Stack s = Stack(10), I believe this must have something to do with static type declaration.
Jesse Leigh Patsolic
Does anyone know why the base estimator for ExtraTreesClassifier is ExtraTreeClassifier, instead of DecisionTreeClassifier with splitter='random'? I am working on adding a new type of tree. @NicolasHug @amueller
Nicolas Hug
No idea. It doesn't make much sense for ExtraTreeClassifier to allow for a splitter that isn't 'random' IMO.
Would you want to submit a PR to deprecate the parameter?

Hi All, I`m getting the following error while executing the python setup.py install
error: Command "cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -IC:\Users\Moti\Anaconda3\envs\motidevs\lib\site-packages\numpy\core\include /EHsc /Tpsklearn\svm\src\libsvm\libsvm_template.cpp /Fobuild\temp.win-amd64-3.7\sklearn\svm\src\libsvm\libsvm_template.obj" failed with exit status 127

Do you have any idea? Thanks!

Any scikit devs who can shed some light on why calibration_curve is only for binary estimators?
Anjali Singh
how can i start committing to the open source
Adrin Jalali
@Anj-ali you can start by going through our contributing guides: https://scikit-learn.org/dev/developers/contributing.html#contributing
Anjali Singh
thank you Sir, surely i will do that
Olivier Grisel
Heads up: if you use conda and upgrade your env, you might get a crash when using n_jobs>=2. This is caused by an updated version of intel-openmp in the default channel of conda. I reported the issue upstream as ContinuumIO/anaconda-issues#11294 and the problem is tracked in this PR on the scikit-learn side: scikit-learn/scikit-learn#15020
The error message is OMP: Error #13: Assertion failure at z_Linux_util.cpp(2361) reported by the dying worker process.
Which in turns causes loky to raise: TerminatedWorkerError: A worker process managed by the executor was unexpectedly terminated. This could be caused by a segmentation fault while calling the function or by an excessive memory usage causing the Operating System to kill the worker. The exit codes of the workers are {SIGABRT(-6)}.
Samesh Lakhotia
If someone is free to review, please take a look at scikit-learn/scikit-learn#14993 and scikit-learn/scikit-learn#15045.
Andreas Mueller
hm is there a pandas gitter? Or is @jorisvandenbossche around lol? For a pandas dtype, how do I get the closest numpy dtype to cast to?
Joris Van den Bossche
there is pandas gitter actually (pydata/pandas)
I don't think there is a typical way to do it
If I remember correctly, there is an issue about it
Basically, you would like to know the dtype of np.asarray(obj).dtype right? (but without needing to do the actual conversion?)
Andreas Mueller
it's for scikit-learn/scikit-learn#15094 which is currently failing because np.result_type(pd.CategoricalDType) raises an error
Joris Van den Bossche
the issue that I rememered is pandas-dev/pandas#22791
Andreas Mueller
ok. so no solution :-/ is there a work-around?
like what does actually happen when you do the conversion?
is it from the pd.DataFrame.__array__ method or something?
Andreas Mueller
yeah it is, no way to figure that one out :-/
Jesse Leigh Patsolic

Hello all (I am new to Cython),

I am currently working on adding an augmented version of Brieman's forest-RC (similar to RandomForest) algorithm into my fork of scikit-learn: In short, the algorithm takes linear combinations of features and projects them with weights randomly selected in {-1,1} to form a new feature to split on. The number of features combined at each split is a random variable.

The current SplitRecord only holds one feature, I need something to store a vector of features and a vector to hold weights.

  1. I tried initializing an np.ndarray and using memoryviews, but ran into GIL issues.
  2. I tried to make an ObliqueSplitRecord class, but that can't be passed as a pointer into functions because it is a Python object.
  3. I tried to augment the SplitRecord struct in _splitter.pxd but that didn't seem to work because vectors would then be of fixed length.
  4. I tried to use something similar to the tree/_utils:Stack but fell into the same problem as it was a class and couldn't be passed as a pointer into a function.

I am looking into using cppclass, but am not sure if that will fix solve my problem.

Does anyone have suggestions on how to best implement this in a Cythonic way? i.e. storing a vector of things while avoiding the GIL and not using python objects?

Adrin Jalali
@MrAE you can use a cpp vector in cython. But since you're changing the splitrecord struct, you'll need to change the code in quite a lot of places.
Mateusz Sokół
Hi, I have some basic question about local docs build for scikit. I've been trying to modify docs inside API for some file in sklearn/linear_model and followed instructions in Contributors Guide. But after few attempts the make command inside /docs does not seem to modify local docs build inside _build. In the browser, API docs didn't change although I modified the sources. Am I missing something?
Nicolas Hug
@mtsokol it seems that you're doing it right... maybe double check that 1. you're actually changing the sources, i.e. not anything in the _build folder, 2. the doc that you're changing is about a public estimators/tools (private tools aren't rendered in the doc anyway) and 3. that you're looking at the generated html in doc/_build/html/stable/
Nicolas Hug


re 1. you can't use (let alone allocate) numpy arrays when the GIL is released because these are Python objects. Is there a way for you to allocate the arrays somewhere where the GIL is held, and use memory views when the GIL is released? Memory views are safe to use without the GIL

re 2. is it still considered a Python object if you use a cdefed class and all the attributes are cdefed as well?

re 3. what vectors? can't you use a view as a field of the struct?

Nicolas Hug
Also @MrAE I happen to have been writing about Cython over the weekend... maybe that could help http://nicolas-hug.com/blog/cython_notes
Jan-Benedikt Jagusch
could somebody share a good example for class docstrings in scikit-learn that we could use as a sort of template? thanks!
Alessandro Surace
Here is the issue search string "is:issue is:open examples class docs involves:adrinjalali"
Alessandro Surace
Hey guys who is veerlosar on Githib? just want to talk about OneVsRestClassifier example
Benjamin Bossan
@zioalex I can talk to veerlosar, we're at the same sprint

Hey guys who is veerlosar on Githib? just want to talk about OneVsRestClassifier example

@zioalex what did you want to talk about?

how to learn complete sk learn ? please give the resources?
Jérémie du Boisberranger
Andreas Muller's book, Introduction to Machine Learning with Python: A Guide for Data Scientists, is quite complete.
You can also look at the user guides: https://scikit-learn.org/stable/user_guide.html
Andreas Mueller
there's also my lecture series: https://youtube.com/AndreasMueller The only complete resource is the user guide though
Hello there!
Jesse Leigh Patsolic

Hey guys, me again: Regarding me previous message :point_up: October 4, 2019 5:28 PM I've gone through some more attempts that don't quite work.

@NicolasHug The blog post helped a bit with my understanding of memory-views, however I still have a few questions: Can a memory-view be initialized with nogil? And no, a struct member cannot be a memory view.

I tried to make my own class but then got yelled at because it's not of type Splitter, so that was a bust.

I augmented the SplitRecord with 2 cpp vectors, but that caused things to go wonky requiring cpp in files that I'm not willing to touch.

I ended up augmenting SplitRecord with 2 Cython vectors with hard-coded length, but then can't seem to initialize a memory-view into them inside of the node_split. I'm pretty much stuck (in my current view of things), because I'm trying to do as little modification as possible, but it seems that in order to accomplish my task I'll have to re-write a big chunk of ensemble methods. I'd have to add an input argument to the node_split method? That doesn't sound like a good idea.

Any ideas? Much appreciated.

Peter Hadlaw

Hi all, I'm trying to help my team reduce creating new code when leveraging existing libraries might get the job done. Does anyone have thoughts on how the following can be accomplished? https://stackoverflow.com/q/58533004/1566074

Basically finding the optimal subgroups for a dataset to then feed into an estimator to reduce noise.

Guillaume Chevalier
Hello the scikit-learn community! I'd like to have your thoughts on what I coded. It's a way to do automatic machine learning on scikit-learn pipelines. It allows for handling hyperparameter spaces as well as hyperparameters. Example: https://www.neuraxio.com/en/neuraxle/stable/examples/hyperparams.html#sphx-glr-examples-hyperparams-py
Adrin Jalali
any takers on scikit-learn-contrib/imbalanced-learn#616 it's a good first issue.