Stefan Petrov, Developer in Sofia, Bulgaria
Stefan is available for hire
Hire Stefan

Stefan Petrov

Verified Expert  in Engineering

Machine Learning Developer

Sofia, Bulgaria
Toptal Member Since
November 24, 2019

Stefan has been fascinated by the potential of AI since high school. For the past several years, he’s been making a living as the primary developer of more than ten analytical products using R, Python, Mathematica, .NET, and Java. Recently, Stefans been focusing on operations research-type issues and using random forests, time series models, Keras, TensorFlow for neural nets, PyMC3, Stan for Bayesian models, and linear and MIP programming.


Python, Machine Learning, Statistics, Reinforcement Learning...
Docker, TensorFlow, CPLEX, PostgreSQL, Python, R...
CommEq Asset Management
R, MongoDB, Python, Natural Language Processing (NLP), GPT...




Preferred Environment

PostgreSQL, JetBrains, RStudio

The most amazing...

...thing I've coded was a successive approximation algorithm for the optimal trucking schedule. We used a combination of column generation and L1 relaxation.

Work Experience

Machine Learning Engineer

2019 - PRESENT
  • Developed machine learning algorithms for stock price prediction, resulting in Sharpe ratios of 3.2. Used an ensemble of ML, neural net, and traditional forecasting mechanisms. Created and developed an API and data pipeline using Google Cloud.
  • Worked on the analysis of news, processed through an NLP pipeline, to FOREX rate change predictions.
  • Did prediction and optimization of required inventory levels for inventory stock levels with many item types (>30000 SKU). Used ML classification and probabilistic programming, combined with operational research techniques.
  • Estimated type and severity of mental diseases from self-reported surveys (using NLP and ML techniques). Collaborated with a specializing doctor of medicine (psychiatry).
  • Worked on Spatio-temporal analysis of demographic data for income estimation on the fine-grained spatial scale (scale was different for different countries). Used particular Spatio-temporal statistical techniques.
Technologies: Python, Machine Learning, Statistics, Reinforcement Learning, Generative Pre-trained Transformers (GPT), Natural Language Processing (NLP), GPT, Operations Research, Flask-RESTful, R, Julia

Head of Research

2016 - PRESENT
  • Worked on one-to-three projects as the key analytical contributor on all matters analytical matters (e.g. anything requiring Optimization, statistical, ML, or AI ). projects.
  • Used ML, Statistical, and Deep Neural Network techniques for forecasting of demand time series.
  • Modeled and optimized problems transportation companies have, like: routing, network design, warehouse optimization, using ML, Linear Optimization, Approximation Algorithms MIP, CP, and Reinforcement Learning, and Probabilistic Programming.
  • Analyzed and negotiated business requirements and project directions, considering:. •data availability,. •business requirements,. •feasibility and technology to solve certain types of problems,. •performed a counterfactual analysis to prove value.
  • Businesses-collected operational data very well, but sometimes it didn't support analytical tasks so well (e.g., important data is only partially collected). Used ML, probabilistic programming, and convex optimization on such problems.
  • Performed code reviews, directed and facilitated the problem-solving process, read papers and disseminated knowledge throughout the org.
  • Worked on estimated time-of-return of rented assets, using survival analysis and other ML/statistical techniques.
  • Hired, interviewed, and mentored team members. Participated in product development and pre-sales.
Technologies: Docker, TensorFlow, CPLEX, PostgreSQL, Python, R, Mixed-integer Linear Programming, Constraint Programming, Deep Neural Networks, Machine Learning, Statistics, Bayesian Statistics, Time Series Analysis, Team Leadership, Teamwork, IBM Watson

Quantitative Developer

2016 - 2016
CommEq Asset Management
  • Developed an algorithmic trading system with Python. Refactored the codebase to use six times fewer Lines of Code. Changed up the Machine Learning algorithm in question with one, performing better on the backtests.
  • Performed some natural language processing work for news classification and tagging (multi-label classification problem), significantly improving on the currently used models. The measurement was Hamming-Loss.
  • Worked on portfolio rebalancing part using Convex Optimization techniques.
Technologies: R, MongoDB, Python, Natural Language Processing (NLP), GPT, Generative Pre-trained Transformers (GPT), Machine Learning, Time Series Analysis, Gradient Boosting, XGBoost, Convex Optimization

Quantitative Analyzer

2013 - 2016
Bwin.Party Digital Entertainment
  • Developed modules that determined the probabilities for events of interest (goals, points, and so on) and their prices (odds) for the sporting events, offered on the company sites. Used mostly Mathematica and F#.
  • Solved various BI questions (e.g., the impact of a new sports model release on revenue in that sport, customer classification, and others). Used ML and Statistical techniques, e.g. XGBoost classification, etc.
  • Revamped volleyball and a couple of other point sports models, boosting the P&L on them significantly. Used Numerical analysis algorithms, backtesting, and ML. Participated in basketball and tennis models, too.
  • Developed large parts of the currently used customer classification (dangerous or not, VIP or not, about to churn/not, and so on) models. Used Machine Learning, Deep Learning, and Probabilistic Programming Algorithms.
  • Handled pricing problems (pricing combos). Used Approximation algorithms for a nonlinear optimization problem for this.
  • Developed sports models libraries (directly deployed in production) and simple GUI clients (for Quality control by the traders) with F# and Mathematica.
Technologies: Microsoft SQL Server, Teradata, R, Mathematica, F#, Tableau, Business Intelligence (BI), Data Science, Data Analysis, Probability Theory, Numerical Programming, Machine Learning, SQL, RStudio Shiny, Dashboards

Quantitative Developer

2013 - 2013
Blue Edge Bulgaria | Evolution Capital Management
  • Developed high-frequency trading strategies, aimed at trading in Japan, using specialized versions of PCA, ML, and optimization.
  • Implemented the main approach via technical trading-trying to identify persistent regimes in the market, based on detecting correlated quantities in the electronic trading book.
  • Worked on the backtesting/trading platform (C#, MS SQL stack).
  • Developed with R/Python for EDA and prototyping and estimation of upper bound of strategy performance before trading complications such as latency and transaction costs are considered.
  • Researched about order book dynamics (e.g., the expected lifetime of bids).
Technologies: Microsoft SQL Server, R, Python, C#, Machine Learning, Mathematical Finance, Statistics, Time Series Analysis, Convex Optimization, Principal Component Analysis (PCA)

Quantitative and Back-end Developer

2012 - 2012
Cayetano Gaming
  • Developed a slot game with a game designer who would specify the game logic, what type of bonuses and mini-games existed, and provided the vision of how the game should "feel." This is expressed in terms of volatility of payout, bonus structure, bonus frequency, etc. For example, a "chill" could pay out small amounts very often, while a suspense-filled game might have less frequent larger payouts.
  • Worked in a team that was responsible for writing game logic and developing in-house combinatorial optimizer in order to find suitable symbol distribution so that the game "feel" and expected payout properties are satisfied.
  • Wrote three games, one of which was novel in that there was some strategy involved on the player side. This required different pricing techniques.
  • Implemented an ad-hoc statistical analysis for roulette behavior.
Technologies: Java

High-frequency Backtesting Engine

I developed a backtesting engine for semi high-frequency trading (1 minute) in R. The trading system achieved a Sharpe ratio of 1.85 in backtesting. I used R, XGBoost, regularized linear models, and an interface in Shiny.
2009 - 2012

Master's Degree in Mathematical Modeling in Economics

Sofia University - Sofia, Bulgaria

2008 - 2012

Bachelor's Degree in Computer Engineering

Nagoya Institute of Technology - Nagoya, Japan

2005 - 2009

Bachelor's Degree in Applied Mathematics

Sofia University - Sofia, Bulgaria

2007 - 2008

Certificate in Japanese Language Course

Tokyo University of Foreign Studies - Tokyo, Japan


Scikit-learn, SciPy, TensorFlow, Flask-RESTful, XGBoost


StatsModels, Mathematica, JetBrains, CPLEX, IBM Watson, Tableau


Python, Python 3, R, SQL, F#, Wolfram, Julia, C#, Scala, Java


RStudio Shiny, Apache Spark, .NET


Data Science, Linear Programming, Constraint Programming, Business Intelligence (BI), Anomaly Detection


MongoDB, Teradata, Microsoft SQL Server, PostgreSQL


Jupyter Notebook, RStudio, Docker, Linux, Ubuntu, Google Cloud SDK


Data Analytics, Algorithms, Applied Mathematics, Time Series Analysis, Forecasting, Linear Regression, Data Visualization, Graph Theory, Mathematical Modeling, Time Series, Machine Learning, Data Reporting, Product Analytics, Project Leadership, Data Mining, ARIMA Models, Statistical Modeling, Neural Networks, Natural Language Processing (NLP), Software Development, SaaS, Mathematical Finance, Statistics, Bayesian Statistics, Supply Chain Optimization, Mixed-integer Linear Programming, Gradient Boosted Trees, Customer Segmentation, GPT, Generative Pre-trained Transformers (GPT), Product Design, Spatial Analysis, Reinforcement Learning, Operations Research, Team Leadership, Teamwork, Gradient Boosting, Convex Optimization, Data Analysis, Probability Theory, Numerical Programming, Dashboards, Principal Component Analysis (PCA), Economics, Computer Engineering, Root Cause Analysis, Logistic Regression, Logistics, Deep Neural Networks, Recurrent Neural Networks (RNNs), Random Forests, Support Vector Machines (SVM), Clustering Algorithms, Stochastic Modeling, Hierarchical Clustering, Google Data Studio

Collaboration That Works

How to Work with Toptal

Toptal matches you directly with global industry experts from our network in hours—not weeks or months.


Share your needs

Discuss your requirements and refine your scope in a call with a Toptal domain expert.

Choose your talent

Get a short list of expertly matched talent within 24 hours to review, interview, and choose from.

Start your risk-free talent trial

Work with your chosen talent on a trial basis for up to two weeks. Pay only if you decide to hire them.

Top talent is in high demand.

Start hiring