This is really interesting, but a basic part I don't understand: What would it actually look like to run this on a live dataset? If I understand correctly: you'd run the recursive query, it produces results for every step, effectively showing you the progression of output over time, and then once it hits "present day", it completes and stops? How would you generate results going forward? I.E. A minute elapses after t…
Good question. I touched upon this in the conclusion. Basically, if you run this in a streaming SQL database, such as Materialize, then you would get a true online system which doesn't restart from scratch.
Stochastic gradient descent written in SQL
21–30 of 187 posts
Re: Stochastic gradient descent written in SQL
#22You might want to consider checking out ClickHouse which supports many ML functions natively: - stochasticLinearRegression ( https://clickhouse.com/docs/en/sql-reference/aggregate-funct... ) - stochasticLogisticRegression ( https://clickhouse.com/docs/en/sql-reference/aggregate-funct... )
Re: Stochastic gradient descent written in SQL
#23This is really interesting, but a basic part I don't understand: What would it actually look like to run this on a live dataset? If I understand correctly: you'd run the recursive query, it produces results for every step, effectively showing you the progression of output over time, and then once it hits "present day", it completes and stops? How would you generate results going forward? I.E. A minute elapses after t…
Re: Stochastic gradient descent written in SQL
#24Earlier quoted context omitted.
Good question. I touched upon this in the conclusion. Basically, if you run this in a streaming SQL database, such as Materialize, then you would get a true online system which doesn't restart from scratch.
Did you try running it using DuckDB?
Re: Stochastic gradient descent written in SQL
#25Earlier quoted context omitted.
Good question. I touched upon this in the conclusion. Basically, if you run this in a streaming SQL database, such as Materialize, then you would get a true online system which doesn't restart from scratch.
Does this work with Postgres?
Re: Stochastic gradient descent written in SQL
#26Earlier quoted context omitted.
Good question. I touched upon this in the conclusion. Basically, if you run this in a streaming SQL database, such as Materialize, then you would get a true online system which doesn't restart from scratch.
In a non-streaming db What would prevent you from storing the result set and just using the last iteration to calculate the next?
Re: Stochastic gradient descent written in SQL
#27>A machine learning algorithm which can be trained using SQL opens a world of possibilities. The model and the data live in the same space. This is as simple as it gets in terms of architecture. Basically, you only need a database which runs SQL. First paragraph of the conclusion, and this very much fits with the mindset that's been growing in me in the data world over the past few years. Databases are much more powe…
I wonder if near-data functions on small databases is the solution to the limit of statelessness that you have with functions as a service.
Re: Stochastic gradient descent written in SQL
#28>A machine learning algorithm which can be trained using SQL opens a world of possibilities. The model and the data live in the same space. This is as simple as it gets in terms of architecture. Basically, you only need a database which runs SQL. First paragraph of the conclusion, and this very much fits with the mindset that's been growing in me in the data world over the past few years. Databases are much more powe…
had a very good chat with https://postgresml.org/ last week which is focusing on bringing ML to postgres: https://youtu.be/j8hE8-jZJGU
Re: Stochastic gradient descent written in SQL
#29Re: Stochastic gradient descent written in SQL
#30>A machine learning algorithm which can be trained using SQL opens a world of possibilities. The model and the data live in the same space. This is as simple as it gets in terms of architecture. Basically, you only need a database which runs SQL. First paragraph of the conclusion, and this very much fits with the mindset that's been growing in me in the data world over the past few years. Databases are much more powe…
In more modern DBs being distributed horizontally, this approach may see a rebound. The big “but” is still costs, in my experience in AWS as an example, managed Postgres Aurora was surprisingly expensive in terms of monthly cost.