How scipy's _linear_filter is implemented? - scipy

_linear_filter is widely used in scipy, but it is difficult to find the specific implementation details of it, can anyone describe how it is implemented, and the source code?

Related

A good example for using HMM in Matlab

I want to do hand gesture recognition with hmm in matlab. I studied the theoretical materials in both hmm concept and hmm in mathwork . But I need to see some real examples which uses matlab instructions for dealing with hmm. I searched in the web but could not find a good one. Does any one know a reference which uses matlab instructions in a hmm process?
I suggest you look at the toolbox by K. Murphy and its tutorial.
The built-in hmm functions in Matlab are pretty limited I find (though I did not use the very last edition of Matlab). However you can look at the Matlab tutorial too.
Finally, you can check this toolbox. It contains a demo file.
On a side note, be aware that your question is somewhat off-topic here. Adding some code to show that you a least tried something and clearly spot what is causing you trouble (training the model? formatting the data? applying the Viterbi algorithm?) would make this question much more interesting to the community.

Why was MLP Classifier deprecated in Apache Mahout?

I am wondering why MultiLayerPerceptron http://apache.github.io/mahout/0.10.1/docs/mahout-mr/index.html?org/apache/mahout/classifier/mlp/MultilayerPerceptron.html and all classes within MLP Package of Apache Mahout were deprecated. This was done as part of https://issues.apache.org/jira/browse/MAHOUT-1676. The JIRA issue doesn't mention about any reasons for doing so. I was planning to use this classifier in my project but since it is deprecated I am now hesitant to use it. I don't see any alternative version of classes to be used as mentioned in the Javadoc . Does anyone using Mahout for MLP has any idea?
I'm not sure how to answer this because it's basically off-topic. The mahout team considers that the MLP isn't used much by the community and it's painful to maintain so far. Thus they've decided to remove it since there exist other good implementations of it in other frameworks.

How to understand and use scala macro, and write a more complex function

The documentation of scala macro is very hard to understand, so I think it must have some background knowledge if one wants to use it in real case.
And I ask help for what these knowledge are.
c.Expr[Unit](Block(treesWithSeparators.toList, Literal(Constant(()))))
it is a code snippet of macro, and there are little info available for what Block means, and other similar terms. It is hard to go deep in if these key points lost.
So if anyone knows where exists a more detailed documentation or tutorial, please tell me, thanks:)
It is hard to go deep in if these key points lost.
Yes that is true but it is good that not everyone can get a way into macros. They are a powerful feature and users that don't understand them fully should not use them.
Diving into macros requires a lot of self learning, there is no easy way to learn how they work and how to work with them.
Nevertheless there is already a lot of useful documentation out there. For example this question wants to know how to understand the AST: Where can I learn about constructing AST's for Scala macros?
This question on the other side gives some value on how to work with reify: What's the easiest way to use reify (get an AST of) an expression in Scala?
On docs.scala-lang.org there is an excellent overview available that describes what macros can do and what not. The official homepage also contains lots of useful information.
And reading further questions here on StackOverflow, looking at source code on GitHub or searching the web for blog posts on macros shouldn't be that difficult.
For the beginning this should be enough to find a way into macro hell.

How is scala.util.parsing.ast.Binders supposed to be used?

I am currently implementing a small compiler in Scala and while I was doing the component for context analysis I discovered the trait Binders in package scala.util.parsing.ast (I am using Scala 2.9 RC), which is Documented to enable name binding during parse time. That sounds very interesting and I have been googling around a lot, but I still have no clue how to use it. While I am of course able to let my abstract syntax derrive from Binders I dont see how to proceed from there. Are there any examples of the usage on the net?
By googling a bit I found this page, which seems to be a development version of a documentation with more details. Unfortunately I was not able to find online (I mean, outside a source repository) version of these documentations.
I'm not sure however that you will find what you're looking for in this library. Name resolution is a rather delicate thing, and it smells like a questionable idea to do it during parsing. The documentation of this library itself highlights that it is only suitable for languages where the name resolution is relatively simple, and may not scale otherwise. Besides, none of the parsing examples in the Scala repository make use of this class.
I would cautiously avoid this uncharted territory, and design binding analysis in a separate post-parsing pass.
You're not supposed to use it. In fact, it has recently been deprecated.
See
deprecation candidate: scala.parsing.ast

Where to find more info about a Foundation method

I'm trying to better understand some memory management concepts. In order to do so, I need to see the implementation of NSDateFormatter:stringFromDate method. Developer documentation refers to NSDateFormatter.h, where the method is declared. Following a logical reasoning, I looked for the implementation in it's theoretical counterpart, NSDateFormatter.m, but I was unable to find that in Finder.
Where can I see that method's implementation?
You can't. The Foundation and UIKit frameworks are not open source. The headers are there so that you can build against the Cocoa libraries, but the implementations are intentionally opaque.
That said, some of the Carbon stuff underlying Foundation on the Mac side is open source, so if you go digging, you might get some idea of how some things work, e.g.
http://www.opensource.apple.com/source/CF/CF-550.29/CFDateFormatter.c
But this is unlikely to help you if you're just trying to learn about some memory management concepts. In that case, you're better off just asking those questions here on SO about the classes you're interested in.
As quixoto said, the frameworks you are looking for are closed-source. However the GNUstep open-source project aims to reimplement Cocoa, and they have an implementation of NSDateFormatter that you can see. If you are looking to read a lot of internal framework source code, that's one place to start.