## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
• 03:56
github-actions[bot] labeled #18689
• 03:56
ivirshup opened #18689
• 02:37

NicolasHug on master

DOC Fix typo in docstring for c… (compare)

• 02:36
NicolasHug closed #18688
• 01:09
ffffaaasl commented #7206
• 00:14
ffffaaasl commented #6863
• Oct 26 22:59
orausch synchronize #11682
• Oct 26 22:56
wdevazelhes synchronize #13246
• Oct 26 22:53
orausch synchronize #11682
• Oct 26 22:38
wdevazelhes synchronize #13246
• Oct 26 22:22
lorentzenchr commented #17432
• Oct 26 22:15
wdevazelhes synchronize #13246
• Oct 26 20:44
martinagvilas commented #17432
• Oct 26 20:42
martinagvilas synchronize #17432
• Oct 26 20:23
lorentzenchr commented #17448
• Oct 26 20:04
lorentzenchr commented #17432
• Oct 26 19:49
PGryllos commented #18685
• Oct 26 19:24
alfaro96 commented #18687
• Oct 26 19:24
alfaro96 synchronize #18687
• Oct 26 19:17
alfaro96 synchronize #18687
Bin Wang
@biwa7636
@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?
%%cython
from sklearn.tree._utils cimport Stack
s = Stack(10)
print(s.top)
>>> 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
@biwa7636
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
@MrAE
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
@NicolasHug
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?
motmoti
@motmoti

Hi All, Im 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!

kirk86
@kirk86
Any scikit devs who can shed some light on why calibration_curve is only for binary estimators?
Anjali Singh
@Anj-ali
how can i start committing to the open source
@Anj-ali you can start by going through our contributing guides: https://scikit-learn.org/dev/developers/contributing.html#contributing
Anjali Singh
@Anj-ali
thank you Sir, surely i will do that
Olivier Grisel
@ogrisel
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
@sameshl
If someone is free to review, please take a look at scikit-learn/scikit-learn#14993 and scikit-learn/scikit-learn#15045.
Andreas Mueller
@amueller
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
@jorisvandenbossche
yep
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
@amueller
indeed
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
@jorisvandenbossche
the issue that I rememered is pandas-dev/pandas#22791
Andreas Mueller
@amueller
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
@amueller
yeah it is, no way to figure that one out :-/
Jesse Leigh Patsolic
@MrAE

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?

@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ół
@mtsokol
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
@NicolasHug
@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
@NicolasHug

@MrAE

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
@NicolasHug
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
@janjagusch
could somebody share a good example for class docstrings in scikit-learn that we could use as a sort of template? thanks!
Kristiyan Katsarov
@katsar0v
Alessandro Surace
@zioalex
Here is the issue search string "is:issue is:open examples class docs involves:adrinjalali"
Alessandro Surace
@zioalex
Hey guys who is veerlosar on Githib? just want to talk about OneVsRestClassifier example
Benjamin Bossan
@BenjaminBossan
@zioalex I can talk to veerlosar, we're at the same sprint
veerlosar
@veerlosar

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

@zioalex what did you want to talk about?

rajnish1642
@rajnish1642
how to learn complete sk learn ? please give the resources?
Jérémie du Boisberranger
@jeremiedbb
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
@amueller
there's also my lecture series: https://youtube.com/AndreasMueller The only complete resource is the user guide though
Ghost
@ghost~5a09ec4ed73408ce4f7e6c27
Hello there!
Jesse Leigh Patsolic
@MrAE

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.