Git Product home page Git Product logo

Comments (4)

hmansell avatar hmansell commented on July 26, 2024

Hi Maxim

You are not missing anything obvious - I don't believe this works yet on
SymbolicExpressions that still live in the R world. It just hasn't been
implemented yet. We would be happy to review a patch to support this.

Of course, you can get the value as an array (using .Value/.GetValue()) and
slice that, but there is some overhead involved (copying the data from the
R data structure to a native .NET array). For what we do with R, that has
always been fine so far.

I think it's slightly tricky to support directly on the SymbolicExpression
just because you have to support the slice function on the container type
itself. The types we return directly are all from RDotNet, which is
implemented in C#. Supporting the slice operator on these requires a
change to RDotNet and creates a dependency on FSharp.Core. However, just
as you have to call specific functions to view the data as a numeric
vector, we could add to those so that you can view it as some sliceable
type...

Does that make sense?

Howard

On Fri, Nov 16, 2012 at 2:50 AM, Maxim Sokolov [email protected]:

I spent quite some time searching for any hints in the sources or docs for
a slice.

I couldn't find it. As it is a key operation in R I would suggest adding
it.

Do I miss something obvious?


Reply to this email directly or view it on GitHubhttps://github.com//issues/17.

from rprovider.

alfa07 avatar alfa07 commented on July 26, 2024

Thank you! Yeah, I think it is a good workaround (e.g. AsSlice(Nullable, Nullable, Nullable).

I also couldn't find how I can get generated variable names which are visible to R. When I want to generate expression which addresses variables from F# I have to do SetSymbol to assign them a name which I can use. Is there an easier way?
e.g.
let x = ....
x.Engine.SetSymbol("x", x)
let model = x.Engine.Evaluate("glmnet(x[,1:5], x[,6], family="binomial")")

It is not an idiomatic R code (more like matlab) but still.

I would love something like easy text expression generation for cases when there are no directly supported options:
let model = R.glmnet(x +! "[,1:5]", x +! "[,6",family="binomial")

Probably this also requires hacking RDotNet?

from rprovider.

hmansell avatar hmansell commented on July 26, 2024

Generally the idea is that you don't set symbols with specific names to be visible to R. They are visible if they are passed to functions, but they have generated names. Of course, this does have problems when the name of the variable is used by the function being called...

What exactly are you trying to do?

On Nov 21, 2012, at 8:00 AM, Maxim Sokolov [email protected] wrote:

Thank you! Yeah, I think it is a good workaround (e.g. AsSlice(Nullable, Nullable, Nullable).

I also couldn't find how I can get generated variable names which are visible to R. When I want to generate expression which addresses variables from F# I have to do SetSymbol to assign them a name which I can use. Is there an easier way?
e.g.
let x = ....
x.Engine.SetSymbol("x", x)
let model = x.Engine.Evaluate("glmnet(x[,1:5], x[,6], family="binomial")")

It is not an idiomatic R code (more like matlab) but still.

I would love something like easy text expression generation for cases when there are no directly supported options:
let model = R.glmnet(x +! "[,1:5]", x +! "[,6",family="binomial")

Probably this also requires hacking RDotNet?


Reply to this email directly or view it on GitHub.

from rprovider.

tpetricek avatar tpetricek commented on July 26, 2024

Not sure I understand the exact situation here, but supporting slicing on SymbolicExpression sounds like a useful thing to add!

from rprovider.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.