From fmincon to Flatiron: my journey into Data Science

Jeff Marvel
7 min readSep 7, 2021

--

Welcome to my blog, everyone! I’ll by recording here my path to becoming a Data Scientist at the Flatiron School. You’ll see at least a few posts through the end of the year and potentially more if the inspiration strikes. To start, I’d like to chronicle why I’m even here in the first place with a little anecdote from a previous job and some lessons learned along the way.

It all started with a Matlab optimization function called ‘fmincon’. It was sometime around 2016, and I was working in the Corporate Treasury and Chief Investment Office of JPMorgan. I was your standard business analyst, working in spreadsheets and Tableau all day, producing slide decks, attending meetings. The team was small, and our role a bit nebulous. We were the “strategy” folks, chipping in wherever needed across all the core functions of Treasury.

It was my boss’s initiative, and this lack of a clearly defined mandate, that led to a transformation of the team. Over the course of a few months, we doubled in size. Among the Business Analysts were now people with programming and tech backgrounds, and the nature of our work shifted. While I continued to plug away in Excel, the team also started to produce fancy-looking models in Matlab, and later in Python. We started to use the word “optimize”.

As a business analyst, of course you want to find the “optimal” solution to a problem, but rarely do you get to do this in the technical or mathematical sense. The closest use case is probably Excel’s “what-if” functionality. Our team’s first implementation of this approach was in Matlab using the aforementioned fmincon function. We were trying to answer the following: “what is the optimal balance sheet composition to maximize profitability subject to our regulatory constraints”. I learned just enough Matlab to be able to run the code, tweak an input here and there, and print the output. It was off to the races from there. It seemed like magic. In the months that followed, I felt like this:

Oprah “You get a car meme”, except instead of getting a car, everyone is getting “minimized”.
https://imgflip.com/i/5lyx4n

(Note: fmincon and other optimization algorithms work by minimizing the objective function. If you want your outcome to be as big as possible, just flip the sign. In our case, we wanted to minimize “negative profitability”. I sense a future blog post in the works…)

(Note #2: Yes, I did make this meme.)

This can solve everything, I thought. Why wasn’t everyone doing this, I wondered. Well, it turns out, they were. People called Data Scientists developed and implemented these models, and pretty much every company out there employed them in some capacity. Airlines wanted to optimize their flight routes and schedules. Retailers wanted to fine-tune their recommendation systems and optimize their product set. This is to say nothing of the myriad other Machine Learning applications under the Data Science umbrella. I was hooked. There were just two problems.

I quickly learned that building the model was only half the battle. You had to actually convince those with decision-making power that your output made sense. This is made especially difficult by the “black box” nature of these models (see our stick figure friends below). The model might suggest one thing, but sometimes the business intuition of an executive with decades of experience in the field suggests another. And that intuition can be worth a lot! My non-technical job on the team still existed, partly, to help manage this dynamic. Specifically, understanding the model’s logic well enough to be able to identify gaps and how those gaps might affect the output. E.g., we don’t have a great way to quantify [x] relationship. If we had data on [x], it would probably influence the model output in this way. Therefore, we need to make [y] caveat. This can be frustrating! The math is the math, you want to say, it’s indisputable.

Over the next couple of years, I received a crash course in practicing real-world Data Science (a path I didn’t even know I was on yet). Among my key takeaways:

  1. There are limitations to our models. They’re only as good as the underlying data and assumptions made.
  2. Being candid about these limitations with a clear view on their biases will help gain traction for your existing (caveated) output.
  3. The model means nothing if you can’t convince others of its worth. This may be easy in a room full of statisticians, but most of the time you need to “speak the language” of the business to effectively get your point across.

These are not particularly groundbreaking revelations for anyone who has been in the field, but for me, I was entering a whole new world.

XKCD comic on machine learning. A man asks, what if the algorithm is wrong. Well you just shake the pile around a bit until it looks right, replies the other.
https://xkcd.com/1838/

The bigger problem; however, was simply that I didn’t actually know how to build these models. I had a surface-level understanding of how they worked but was missing the coding chops and much of the foundational knowledge needed (shoutout to linear algebra). Regardless, the seed was planted. My preliminary exposure to Data Science had created an itch I wasn’t quite able to scratch on my current career trajectory.

Fast forward a few years. I had changed jobs twice, bought a car, moved apartments twice (do not recommend), but the fmincon magic lingered. I was ~9 months into a job in the Treasury department of a hedge fund. My title was “Cash Management Associate”. In three months I would quit my job. In four months, I would be starting at Flatiron on my way to becoming a Data Scientist. The proverbial straw was two-fold.

While at the hedge fund, I had the opportunity to work in Jupyter notebooks doing some very basic data analysis. I relearned some Pandas and labored through a couple of scripts to do things like sending an automated daily email of some numbers we looked at every day. It took me 10x as long as it should’ve to write those, but it was among the more personally rewarding work I did there. I was inordinately pleased with myself when everything finally clicked.

I also helped design a simple optimization for a process we used to run manually. From my previous work, I knew the “language”. I knew how to talk about upper and lower bounds, objective functions, and the like. But still, I wasn’t in the weeds building the model itself. And when I took a step back, the facts of the matter were that the ~5% of my time I spent coding was the most enjoyable work I did, and I was missing the core skill set to take that coding work a step further. I decided to become a Data Scientist. This was not an easy decision to make, particularly for someone like me who has been somewhat risk-averse in their career choices. There is a lot of inertia involved in deciding to ditch a career path that by most accounts is “good”.

Straw #2 was something that had been simmering in my head for a while. I realized that the subject matter of my job and the “mission” was important to me. A caveat before I explain: I don’t begrudge in the slightest anyone’s decision to work in Finance. It’s impossible to generalize an industry with millions of employees, and during my career, I’ve met some truly amazing people. There is genuinely exciting work happening across the industry and I’m thankful to have been part of a small piece of it. Why you work in a particular field is a very personal decision. What I can say is that for me, personally, a career in Finance, at least in the type of Finance work I was involved with, wasn’t “doing it for me”.

The thought that had been simmering for years started to take shape. I wasn’t excited to talk about my job with family or friends. Any description or discussion usually devolved to me waving my hands in the air and saying “I do finance stuff”. I couldn’t describe what I did for a living in a few minutes without the other person’s eyes glazing over. So what’s “capital strategy” at a hedge fund. Who knows! This bugged me. At this point in my life, I don’t expect to be able to save the world and get paid to do it. As much as I’d like to have a career helping solve global warming, for example, I need to be realistic. But I do believe there is a middle ground. I wanted to feel invested in my work. I wanted to be excited to talk about what I spent at least 40 hours of my week doing. I wanted to work on side projects. I care about the environment, baseball, birds, inequality, to throw just a few things out there, and I saw Data Science as my ticket to doing meaningful work in those areas.

Now of course you can do non-technical work in any of those fields. But for me, I was becoming increasingly specialized in a field that I wasn’t excited about, and the path to transitioning to a different industry was becoming less obvious every year. This, combined with the enjoyment I got from my mini coding projects, made Data Science the obvious choice. So even if I’m not saving the world in my next job, I can hopefully feel real pride in my work. I’m excited to explore what that might look like for me, along with some actual Data Science, in future posts.

Stick figure poking “Jeff’s blog” with a stick, asking it to show him some actual code.
https://imgflip.com/i/5m3olb

Soon enough! Thanks for reading.

--

--

Jeff Marvel

Beginning my adventure in Data Science through the Flatiron School. Writing here on all things Data Science as I continue learning.