Skip to content

AlbertoZerbinati/linear-regression-for-text-length

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

linear-regression-for-text-length

Linear regression for text length, given an html <div> of known width, height and given the text style

This work solves a problem I faced while developing a web application requiring the efficient computation of the maximum text length that would fit a given html <div>. I firstly developed a really naive and inefficient algorithm that allowed me to collect some data. Then, I used that data to train a linear regression model that gave me the coefficients to predict the quantity I needed in constant time.

Dataset Prediction Plane
Dataset Prediction function

Demo

Click to see the code in action!

Animation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors