How to determine if a public IP address is in a datacenter or home etc

How can someone determine if a given IP range is in a datacenter or for home usage etc.? Companies like MaxMind provide lists of IPs located in hosting centers. How do they get this information? Do they simply look for specific fields in whois? or is it more involved?

If someone purchase IPs from RIPE, ARIN etc. do they provide their own location data and if it is designated for datacenter, home usage etc.?