While the idea of using an algorithm to sentence a human being is bone-chilling, you might be able to justify this as a "formula" for sentencing -- which, of course, merits its own debate.
What is unconscionable about this is the fact that it's a SECRET algorithm. As in closed source. Essentially a secret law.
This has no place in democracy.
(Also, any algorithm which ingests statistical and demographic data is bound to come up with unpalatable and/or spurious demographic correlations (since there is a causal link between poverty and crime and a historic link between race and poverty) which I wold rather have society refrain from codifying -- in law or in actual computer code).