2021-11-06

Evolving project 1

 1. Map data science

On Oct I participated in dataKind.org 's data hack and got a first "hack" on map data analysis. I chose this project because I had always been intereseted in geo-spatial data. This is a snap shot of the final colab I finished by following a geo-spatial tutorial)


It's Florida's map superimposed with  total-renter-occupied-households (how many households have renters living alone or with the owner) in Hillsborough. : The overlay is segragated by Hillsborough's census tract and each one polygon is colored with the "intensity" of total renters. The intensity is captured simply by binning the "total-renter-occupied-households" numbers into 5 bins and using a color scheme to represent it.
I think this is a draft version of Cholorpeth maps: https://en.wikipedia.org/wiki/Choropleth_map 
(side note: there are different ways to bin, mine simply uses geopandas' "quantiles" scheme)

....

I was also interested in the Ookla Internet Speed Test dataset, I was interested in what the ookla tiles represent. Let's pick state Kentucky, I thought each ookla tiles represents the internet speed of a whole county in Kentucky. Surely, a square tile won't cover it entirely, but how much? My intention was to merge the download speed data captured from Ookla with another dataset. One way was to compute the spatial weight of each tile on the county's area  -- but after plotting, I found out that I'm wrong! 

Each tile is "approximately 610.8 meters by 610.8 meters at the equator (18 arcsecond blocks)" but the KY state is 640 km x 302 km! So the tile speed only represents an 610.8m^2 area 

Plotting all the ookla tiles within Florida reveals the "pixels"(tiles) :



So the tiles "should" cover the entire KY state, however due to infrastructure costs there is bound to be missing data.

work in progress...

Couple of takeaways:

  1. Left me with a problem that is commonly seen in data science: How should one merge 2 sources of data where the data contains overlapping entities? (Eg. in this case the entity refer to the same "place" -- state or county) There is the problem of determining:
    1. which ones are the same id? 
    2. how to get a combined result?
  2. Understood how geo-spatial data is commonly stored: shape files, geojson
  3. Picked up tools and libraries to plot the maps
    1. geopandas, (link to geo-spatial tutorial)
  4. hackathons:
    1. knowing front end js is super helpful to the team
    2. Proof of concept prototype end product would be great!
    3. hacking is all about determining what's possible + technical know-hows of what tool can be used. 
      • It's probably also about how to be confident of copying some code to your problem when you have 0 knowledge of what you're copying (ie don't need to be a pro) but outputs what you want. At least one needs to understand what they want first.
      • It takes some experience to know what to create by half knowing.

Evolving Project 2

  Edgar XBLR Facts


I got into this data set from SEC as I had a couple of trading related problems I had in mind.
  • Does debt data show signals that the company have high correlation to short interest? 
  • Macy has a lot of debt (am I even right? The earnings report gives me this impression) but the stores are flocked with people, seems to be good sign. But what about the debt data of other companies? 
    • Resolution: Going to get the debt to equity ratio of all SEC companies for comparision on what the d/e ratio of Macy means
Getting even the right query key was no easy task:

About XBLR 
  • The accounting terms of the numbers you see in 10ks is associated for a standard US-GAAP or IFRS taxonomy :

  • Each filing, the company can choose to disclose which ones to disclose: query Company Facts:  https://data.sec.gov/api/xbrl/companyfacts/CIK##########.json
  • The accounting terms are: Company Concepts, query https://data.sec.gov/api/xbrl/companyconcept/CIK##########/us-gaap/AccountsPayableCurrent.json
My route:
  1. I've randomly set long term debt to equity ratio to be the comparision metric
  2. Macy's "LongTermDebtAndCapitalLeaseObligations " seems to match finvz's long term debt value, so I thought the key would be "LongTermDebtAndCapitalLeaseObligations " 
  3. Turns out that almost no company in the list discloses this in their 10k / 10q
    1. So is there required "debt" related accouting term that is  required by SEC ?
    2. Seems like it's called "long term debt" -- bingo (ref. footnotes 245)

Future work: scrape Patents numbers and look for correlation with technology companies.

Evolving Project 3

 Remodelling my Ikea manual standing desk to a motorized one


Credit: Ricky (Gxxxxx Engineer)

  1. Initially bought a motor and coupler by following a youtube video
  2. Found out that the motor had axis alignment problem, video's solution was to cut a hex key shaft (made of metal) 
    ...bear with me engineers, I'll draw it in AutoCAD soon.

  3. Some hardware engineer offered a some alternatives from Axxxxx that didn't have to cut the shaft. The red hose is what one would use to screw-drive something that needs a corner turn

  4. However, I had figure out how to combine these components 


  5. Unfornately right now,
    1. Perhaps the turning is not so smooth and so when the table raises up to a certain level, the friction is too high and stops...
    2. But more importantly, the torque of the motor is too low. If it were high enough, then it probably could overcome both the weight of the table and the friction. 
      1. A scan of what torque other bloggers chose was 2x ~25kg/cm 
      2. I picked a motor from A***** which claims it rated-torque is 70kg/cm, however it has rpm 12 (ref: the one I have: 80 rpm) ... fingers crossed
work in progress....