Closed chaschev closed 3 years ago
@chaschev Hi, thank you very much for creating the issue! I'm sorry for such a big delay in my answer, apparently, there is something wrong with notifications in github, I didn't even notice your question. I'll take a look at the problem you faced with.
Regarding b
term: it has its own coefficient, and since you have public coefficients field, you can easily access the coefficient of b
, it's always the very first value (regressor.coefficients[0]), and regarding the initial value of b
- you configure it by yourself, see interceptScale
parameter of LinearRegressor
constructor, by default it is 1
. In order to get the full term, just multiply the coefficient mentioned above and interceptScale
value.
@chaschev and one more thing: you need to specify 'fitIntercept' parameter, in order to include 'b' term into the equation
@gyrdym Thank you for replying. It looks like only a small issue with the regressor
@chaschev hi, just for your information, I remember about the issue, but currently, I work on null-safety for ml_algo library, it is quite a big task, I need some time to complete it.
@chaschev the problem was with the initialLearningRate
parameter. By default, it has too high value, the better value for your example is 1e-4
: LinearRegressor(samples, 'y', initialLearningRate: 1e-4);
Hey,
Thanks a lot for the library. Really impressed with how much you can do with dart!
Trying to run a linear regression for a simple line
y(x) = x
, found following issues which I suppose are due to configuration of the regressor. Please help to configureThe code below gives my expected result for most of the cases, with
k
around1.00
. However in some cases, i.e.the result is different. Is this because of the configuration?
Also is there a way to retrieve
b
fromy(x) = kx + b
?Thank you!