• ###### hobovskyresolved a question on "Area of a Circle" kata

The OP found an answer to their question.

Fixed.

• ###### Voilecreated an issue for "Linear Regression with One Variable" kata

There is only 1 toy data set and 1 big data set used for the kata. The tests are hence laughably weak (not to mention lack of random tests).

• ###### Voilecreated an issue for "Linear Regression with One Variable" kata
``````main.rb:344:in `<main>': undefined method `last_j_differential' for #<LinearRegression:0x0000555ad184e500> (NoMethodError)
``````
• ###### Voilecreated an issue for "Linear Regression with One Variable" kata

As the kata currently stands it's univariate linear regression + cost function, which is a duplicate of the two katas linked in the starting paragraph in the description. Solutions can be directly copied to this kata and solve the related part.

• ###### Voilecreated an issue for "Linear Regression with One Variable" kata

Univariate linear regression do not even need gradiant descent in the first place, so I don't see the point of the kata above the usual linear regression, besides kata author wanting to dump the entire lecture they encountered because they thought they learnt everything related to linear regression from it. Notably univariate linear regression has a very efficient and numerically stable closed-form solution. Gradient descent is only advantagous in multivariate cases.

In any case, this point and the rebuttal on the lecture's usefulness has been detailed in https://stats.stackexchange.com/a/278794

• ###### Voilecreated an issue for "Linear Regression with One Variable" kata

Why is input in the form `[1, x]` when it's just one variable? This is very unnatural, and unexplained in the kata description.

• ###### Voileresolved a question on "Linear Regression with One Variable" kata

This is an issue

• ###### Mehbarkcommented on "Function 1 - hello world" rust solution

A `'static` reference lasts for the entire duration of the program, even longer than `main`, which makes sense because we've literally typed it into the source code, so the string will always be the same.

The reason it's necessary is less intuitive, but important for understanding the rust lifetime system as a whole. When we return a reference, we're promising that something will actually be there, but when our function ends everything will be dropped! This is why solutions that return a `String` work, `String`s are just fancy pointers, so we've allocated a place for our `String` and it will be dropped whenever the caller drops it.

With that in mind, how come a `'static` reference actually works, what can it even be referencing? Well, it's a little bit tricky and actually references a string embedded in the program itself!
Godbolt is really helpful here, you can literally see `"hello world"` here: https://godbolt.org/z/xGhWW6Mbq

In the string version, though, it's nowhere to be found: https://godbolt.org/z/14vevMYco

In a nutshell, we use `'static` because it tells the compiler that the string lasts for the entire duration of the program, which is possible because it's embedded in the program, and is preferable because it lets us avoid a heavy `String` for such a simple task.

• ###### arrchaoscommented on "Function 1 - hello world" rust solution

Why 'static? :)

• ###### flacoresolved a question on "Binding within the List Monad" kata

the list monad bind operation will only work iff the given function also returns a list. the author's intention was to make sure an error is thrown in these cases, to make sure no invalid result is produced.

• ###### MLOptcommented on "Linear Regression with One Variable" kata

It's alarming how little interest there is in machine learning kata. There are a few that, like this, have been sitting dormant for years and getting no attention.

• ###### user9644768created a question for "Linear Regression with One Variable" kata

Hey,

In the kata description all examples have been given where the input is a single number, but in the example tests the input is an array of two numbers.
Was that intentional?

• ###### UnkyKongcommented on "Multiply" kata

I thought this was an easy one, then when I went and looked at other solutions I was blown away by how many ways it could be accomplished

• ###### tansakucommented on "Programming Languages & Environments" doc

I think you'll get both separate and combined scores