<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by SSP on Medium]]></title>
        <description><![CDATA[Stories by SSP on Medium]]></description>
        <link>https://medium.com/@_SSP?source=rss-4c8ea90ea0a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Vqo-gkYpf-CapK3B</url>
            <title>Stories by SSP on Medium</title>
            <link>https://medium.com/@_SSP?source=rss-4c8ea90ea0a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 14:15:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@_SSP/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Validating Machine Learning Regression Models: A Comprehensive Guide]]></title>
            <link>https://medium.com/@_SSP/validating-machine-learning-regression-models-a-comprehensive-guide-b94fd94e339c?source=rss-4c8ea90ea0a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b94fd94e339c</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[r-squared]]></category>
            <category><![CDATA[validation]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[model-evaluation]]></category>
            <dc:creator><![CDATA[SSP]]></dc:creator>
            <pubDate>Tue, 16 Jul 2024 04:50:51 GMT</pubDate>
            <atom:updated>2024-07-16T04:50:51.992Z</atom:updated>
            <content:encoded><![CDATA[<h4>Introduction</h4><p>In the world of machine learning, building a model is only half the battle. The real challenge lies in validating its performance and ensuring its reliability. This is especially true for regression models, where predicting continuous values requires careful evaluation. In this blog post, we’ll dive deep into various validation methods for regression models, exploring when and how to use them effectively.</p><h4>What is Validation?</h4><p>Validation is the process of assessing how well our model’s predictions align with actual data. It’s a crucial step that helps us understand the model’s performance, identify potential issues like overfitting or underfitting, and make informed decisions about model selection and improvement.</p><h4>Key Validation Methods for Regression Models</h4><p>Let’s explore five essential validation metrics for regression models:</p><p>1. R-squared (R²)<br>2. Adjusted R-squared<br>3. Mean Squared Error (MSE)<br>4. Mean Absolute Error (MAE)<br>5. Root Mean Squared Error (RMSE)</p><p><strong>1. R-squared (R²)</strong></p><p>R-squared, also known as the coefficient of determination, is one of the most popular metrics for evaluating regression models.</p><p><strong>Formula:<br>R² = 1 — (SSE / SST)</strong></p><p>Where:<br>- SSE (Sum of Squared Errors) = Σ(y_i — ŷ_i)²<br>- SST (Total Sum of Squares) = Σ(y_i — ȳ)²<br>- y_i is the actual value<br>- ŷ_i is the predicted value<br>- ȳ is the mean of actual values</p><p>Interpretation:<br>- R² ranges from 0 to 1<br>- Higher values indicate better fit (closer to 1 is better)<br>- R² = 0.7 means the model explains 70% of the variability in the target variable</p><p>When to use:<br>- Good for comparing models on the same dataset<br>- Useful when you want to know how much of the variance in Y is predictable from X</p><p>Limitations:<br>- Doesn’t indicate whether predictions are biased<br>- Can increase with the addition of variables, even if they don’t improve the model</p><p><strong>2. Adjusted R-squared</strong></p><p>Adjusted R-squared addresses one of the main limitations of R-squared by penalizing the addition of unnecessary variables.</p><p><strong>Formula:<br>Adjusted R² = 1 — [(1 — R²) * (n — 1) / (n — k — 1)]</strong></p><p>Where:<br>- n is the number of observations<br>- k is the number of predictors</p><p>Interpretation:<br>- Similar to R², ranges from 0 to 1<br>- Always lower than or equal to R²<br>- Increases only if the new term improves the model more than would be expected by chance</p><p>When to use:<br>- When comparing models with different numbers of predictors<br>- To guard against overfitting when adding variables</p><p><strong>3. Mean Squared Error (MSE)</strong></p><p>MSE measures the average squared difference between predicted and actual values.</p><p><strong>Formula:<br>MSE = (1/n) * Σ(y_i — ŷ_i)²</strong></p><p>Interpretation:<br>- Lower values indicate better fit<br>- Heavily penalizes large errors due to squaring</p><p>When to use:<br>- When large errors are particularly undesirable<br>- Useful for optimization algorithms during training</p><p><strong>4. Mean Absolute Error (MAE)</strong></p><p>MAE measures the average absolute difference between predicted and actual values.</p><p><strong>Formula:<br>MAE = (1/n) * Σ|y_i — ŷ_i|</strong></p><p>Interpretation:<br>- Lower values indicate better fit<br>- Easier to interpret as it’s in the same unit as the target variable</p><p>When to use:<br>- When you want to treat all errors equally<br>- When outliers are less of a concern</p><p><strong>5. Root Mean Squared Error (RMSE)</strong></p><p>RMSE is the square root of MSE, bringing the metric back to the same unit as the target variable.</p><p><strong>Formula:<br>RMSE = √MSE</strong></p><p>Interpretation:<br>- Lower values indicate better fit<br>- In the same unit as the target variable, making it interpretable</p><p>When to use:<br>- When you want a metric that balances interpretability and penalization of large errors<br>- Often preferred in practice due to its statistical properties</p><p>Choosing the Right Validation Method</p><p>The choice of validation method depends on your specific needs:</p><p>1. For model comparison, consider R-squared or Adjusted R-squared.<br>2. For error interpretation in the original unit, use MAE or RMSE.<br>3. If large errors are a significant concern, lean towards MSE or RMSE.<br>4. When dealing with many features, Adjusted R-squared can help prevent overfitting.</p><p>Remember, it’s often beneficial to use multiple metrics to get a comprehensive view of your model’s performance.</p><p><strong>Conclusion</strong></p><p>Validating regression models is crucial for ensuring their reliability and usefulness. By understanding and appropriately applying these validation methods, you can gain valuable insights into your model’s performance, make informed decisions about model selection, and ultimately build more robust and accurate predictive models.</p><p>Remember, validation is not just about numbers — it’s about gaining confidence in your model’s ability to generalize to new, unseen data. Always consider the context of your problem and the implications of your model’s predictions when interpreting these metrics.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b94fd94e339c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond Accuracy: Mastering the Confusion Matrix for Advanced Model Evaluation]]></title>
            <link>https://medium.com/@_SSP/confusion-matrix-f7ff01c5bbb6?source=rss-4c8ea90ea0a------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7ff01c5bbb6</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[results]]></category>
            <category><![CDATA[confusion-matrix]]></category>
            <category><![CDATA[validation]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[SSP]]></dc:creator>
            <pubDate>Sun, 07 Jul 2024 19:27:41 GMT</pubDate>
            <atom:updated>2024-07-07T19:37:29.859Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Confusion Matrix and Advanced Classification Metrics?</h3><p>Once model is developed, the next phase is to calculate the performance of the developed model using some evaluation metrics. In this article, you will just discover about confusion matrix though there are many classification metrics out there.</p><p>Mainly, it focuses on below points:</p><ul><li>What is confusion matrix?</li><li>Four outputs in confusion matrix</li><li>Advanced classification metrics</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/0*TsXuwwoeyoRWQZZG.jpg" /><figcaption><strong>Table 1. Confusion matrix with advanced classification metrics</strong></figcaption></figure><p><strong>Confusion Matrix</strong> is a tool to determine the performance of classifier. It contains information about actual and predicted classifications. The below table shows confusion matrix of two-class, spam and non-spam classifier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*4VrQPSGtOH5BzMy7.jpg" /><figcaption><strong>Table 2. Confusion matrix of email classification</strong></figcaption></figure><p>Let’s understand four outputs in confusion matrix.</p><p>1.<em> </em><strong>True Positive<em> </em>(TP)</strong> is the number of correct predictions that an example is positive which means positive class correctly identified as positive.</p><p>Example: Given class is spam and the classifier has been correctly predicted it as spam.</p><p><em>2. </em><strong>False Negative</strong><em> </em>(FN) is the number of incorrect predictions that an example is negative which means positive class incorrectly identified as negative.<br>Example:<em> </em>Given class is spam however, the classifier has been incorrectly predicted it as non-spam.</p><p>3.<em> </em><strong>False positive</strong><em> </em>(FP) is the number of incorrect predictions that an example is positive which means negative class incorrectly identified as positive.<br>Example:<em> </em>Given class is non-spam however, the classifier has been incorrectly predicted it as spam.</p><p>4.<em> </em><strong>True Negative</strong><em> </em>(TN) is the number of correct predictions that an example is negative which means negative class correctly identified as negative.<br>Example:<em> </em>Given class is spam and the classifier has been correctly predicted it as negative.</p><p>Now, let’s see some advanced classification metrics based on confusion matrix. These metrics are mathematically expressed in Table 1 with example of email classification, shown in Table 2. Classification problem has spam and non-spam classes and dataset contains 100 examples, 65 are Spams and 35 are non-spams.</p><p><strong>Sensitivity</strong> is also referred as <em>True Positive Rate</em> or <em>Recall</em>. It is measure of positive examples labeled as positive by classifier. It should be higher. For instance, proportion of emails which are spam among all spam emails.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*tK0NA5yg9cIbk9AN.jpg" /><figcaption><strong>Table 3. Sensitivity in confusion matrix</strong></figcaption></figure><p><em>Sensitivity = 45/(45+20) = 69.23% .</em></p><p>The <em>69.23% </em>spam emails are correctly classified and excluded from all non-spam emails.</p><p><strong>Specificity </strong>is also know as <em>True Negative Rate</em>. It is measure of negative examples labeled as negative by classifier. There should be high specificity. For instance, proportion of emails which are non-spam among all non-spam emails.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*BVMXCY8nD5C89AZt.jpg" /><figcaption><strong>Table 4. Specificity in confusion matrix</strong></figcaption></figure><p><em>specificity = 30/(30+5) = 85.71% .</em></p><p>The 85.71% non-spam emails are accurately classified and excluded from all spam emails.</p><p><strong>Precision </strong>is ratio of total number of correctly classified positive examples and the total number of predicted positive examples.<em> </em>It shows correctness achieved in positive prediction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*f3YNjcV0sfRdy6De.jpg" /><figcaption><strong>Table 5. Precision in confusion matrix</strong></figcaption></figure><p><em>Precision = 45/(45+5)= 90%</em></p><p>The 90% of examples are classified as spam are actually spam.</p><p><strong>Accuracy</strong> is the proportion of the total number of predictions that are correct.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*fN_YKKfkbT1Np-1V.jpg" /><figcaption><strong>Table 6. Accuracy in confusion matrix</strong></figcaption></figure><p><em>Accuracy = (45+30)/(45+20+5+30) = 75%</em></p><p>The 75% of examples are correctly classified by the classifier.</p><p><strong>F1 score</strong> is a weighted average of the recall (sensitivity) and precision. F1 score might be good choice when you seek to balance between Precision and Recall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*d1G13Hxbknveq9JY.jpg" /></figure><p>It helps to compute recall and precision in one equation so that the problem to distinguish the models with low recall and high precision or vice versa could be solved.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7ff01c5bbb6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is RAG?]]></title>
            <link>https://medium.com/@_SSP/what-is-rag-306e03a1e5e7?source=rss-4c8ea90ea0a------2</link>
            <guid isPermaLink="false">https://medium.com/p/306e03a1e5e7</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[SSP]]></dc:creator>
            <pubDate>Sun, 09 Jun 2024 12:58:48 GMT</pubDate>
            <atom:updated>2024-06-09T13:00:17.256Z</atom:updated>
            <content:encoded><![CDATA[<p>What is RAG?<br>Retrieval Augmented Generation (RAG) is a technique that enhances the capabilities of language models by incorporating external knowledge sources during the generation process. This allows the model to access and utilize up-to-date and factual information, leading to more comprehensive and reliable outputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9g4Do6HBewXji5iH8bAYaQ.jpeg" /></figure><p>At its core, RAG aims to improve the factual accuracy and context-awareness of language models by combining two key principles:</p><p>Information Retrieval: Finding and retrieving relevant information from external knowledge sources.<br>Language Generation: Using language models to generate text, translate languages, write different kinds of creative content, and answer your questions in an informative way.</p><p>Conventional language models undergo rigorous training using a substantial volume of data in a process known as pre-training. This training phase involves millions or billions of tokens and the training is done on specialised hardware such as Graphical Processing Units (GPUs). These pre-trained models (commonly referred to as foundational models) have good text-generative capabilities but often produce inconsistent or incorrect responses for queries beyond the scope of their training data. As a result, these large language models often face challenges such as factual inconsistencies, outdated information, and a lack of real-world context. The RAG method addresses these challenges by grounding the generation process based on the information retrieved from factual knowledge combining the advantages of information retrieval and language generation creating a more informed and reliable AI system, that is grounded on real-world data. The knowledge sources of RAG could range from databases and knowledge graphs to documents and the open web.</p><p>RAG enables developers to create more robust and reliable language models that provide accurate and contextually relevant information. The unique proposition of combining LLMs with data opens the avenue for a wide range of applications such as chatbots that can query enterprise data, personalised virtual shopping assistants etc.</p><p>The system design for RAG is illustrated in the image below.</p><p>RAG System Design<br>RAG System Design<br>Let&#39;s briefly look at each step of the RAG pipeline:</p><p>Step 1: Build the Vector Store<br>This step involves creating a database of vector representations for your knowledge base. Each text document (or chunk of text) is converted into a numerical vector that captures its semantic meaning. The knowledge source for this step could be a collection of documents, a knowledge graph, a database, or even specific websites on the internet.</p><p>This step typically utilizes a pre-trained embedding model (e.g., Sentence-BERT) to transform each text piece into a vector. Once the embeddings are generated, these vectors can be stored in a specialized database optimized for similarity search. Vector store enables efficient retrieval of relevant information based on semantic similarity rather than keyword matching.</p><p>Step 2: Embed the Query and Perform Semantic Search<br>In this step, the user&#39;s query is converted into a vector using the same embedding model used for the knowledge base. Then, a similarity search is performed in the vector store to identify the most relevant documents (or chunks) to the query. This is done by comparing the vectors of both the query and the document information using a distance metric usually cosine similarity. This step effectively retrieves information/ documents that are semantically closest to the user&#39;s query ensuring that only the most relevant information from the knowledge base is used for generating the response, improving the accuracy and context-awareness of the output. This process is termed as semantic similarity search.</p><p>Step 3: Pass the Prompt with the Query and Relevant Documents to a Large Language Model (LLM)</p><p>The retrieved documents, along with the original query, are combined into a prompt and fed to a large language model. The LLM processes this information and generates a response that incorporates the retrieved knowledge.</p><p>This step involves two main components:</p><p>Prompt Engineering: The relevant documents and the query are structured into a prompt that provides context and guides the LLM&#39;s generation process.<br>LLM Inference: The prompt is passed to the LLM, which generates a response based on its understanding of the query and the retrieved knowledge.<br>The LLM leverages its language generation capabilities to provide a coherent and informative response while ensuring factual accuracy and grounding its output in the retrieved knowledge.</p><p>In addition to the above steps, the RAG process also involves additional considerations such as:</p><p>Document Chunking: Breaking down large documents into smaller chunks before the embedding process to improve retrieval accuracy and efficiency.<br>Relevance Scoring/ Ranking: Further refining the retrieved results (i.e. documents, text chunks etc.) based on factors beyond semantic similarity, such as document recency, metadata filtering or source reliability.</p><p>In the upcoming segments, you will go through each stage of the RAG pipeline in detail.</p><p>NOTE: In this project, we will be using GPT-3.5 as the Large Language Model for building the RAG application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=306e03a1e5e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning in Trading: Unleashing the Power of AI in Financial Markets]]></title>
            <link>https://medium.com/@_SSP/machine-learning-in-trading-unleashing-the-power-of-ai-in-financial-markets-bda9190c1d04?source=rss-4c8ea90ea0a------2</link>
            <guid isPermaLink="false">https://medium.com/p/bda9190c1d04</guid>
            <category><![CDATA[trading]]></category>
            <dc:creator><![CDATA[SSP]]></dc:creator>
            <pubDate>Sat, 01 Jun 2024 03:08:33 GMT</pubDate>
            <atom:updated>2024-06-01T03:08:33.951Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*xCmqWa-DceBXSSjEmbK3aQ.png" /></figure><p>In the rapidly evolving financial markets, traders and investors constantly seek innovative strategies to gain an edge. Machine learning (ML), a transformative subset of artificial intelligence (AI), has emerged as a critical tool in this pursuit, reshaping the approach to trading with its ability to learn from data, identify patterns, and make predictions. This blog post delves into the integration of ML in trading, exploring its fundamental concepts, significant applications, potential benefits, and the challenges faced by practitioners.</p><h4>What is Machine Learning?</h4><p>Machine learning is a branch of AI that focuses on developing algorithms capable of learning from and making predictions or decisions based on data. Unlike traditional programming, where tasks are performed following explicit instructions, ML involves training an algorithm to recognize patterns and infer the rules governing them from data. This capability allows ML models to improve autonomously over time as they are exposed to more information.</p><h4>Why Machine Learning in Trading?</h4><p>The financial markets, characterized by their complexity, vast data volumes, and rapid movements, are ripe for the application of machine learning (ML) technologies. The ability of ML to process and analyze large datasets far more quickly and efficiently than human traders is a driving force behind its integration into trading strategies. Here are several compelling reasons to leverage ML in trading:</p><p><strong>Enhanced Decision-Making:</strong> ML algorithms can analyze vast amounts of data from various sources — including market data, economic indicators, and news sources — to identify potential trading opportunities or risks that might not be apparent through traditional analysis methods.</p><p><strong>Real-Time Processing:</strong> In financial markets, conditions change rapidly. ML models can process real-time data feeds to make immediate trading decisions based on the most current market data, a capability that is particularly valuable in high-frequency trading.</p><p><strong>Predictive Power:</strong> Through historical data analysis, ML models can predict trends and market movements, helping traders to make more informed decisions. While not infallible, these predictions typically provide a better basis for decision-making than mere speculation.</p><p><strong>Automated Trading:</strong> ML enables the automation of trading activities, which can execute trades at optimal times based on the criteria set by their human overseers, thereby increasing efficiency and reducing the likelihood of costly human errors.</p><p><strong>Risk Management: </strong>Machine learning can significantly enhance risk assessment capabilities by forecasting potential downturns and providing insights into risk exposure, thus helping traders to manage and mitigate risks more effectively.</p><p><strong>Applications of Machine Learning in Trading</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*ZbI-WLLEMFknOpkbYICy2g.png" /></figure><p>Machine learning is versatile and can be applied in several key areas of trading:</p><p><strong>Algorithmic Trading</strong>: ML models are used to develop sophisticated trading algorithms that can decide when to buy or sell based on predictive models. These algorithms can adapt to new data and changing market conditions without human intervention.</p><p>Let’s explore some illustrative examples of how ML models are transforming algorithmic trading:</p><p><strong>Trend Following Strategies:</strong></p><ul><li><strong>Concept:</strong> These strategies aim to capture profits by identifying and following trends in asset prices.</li><li><strong>ML Application:</strong> ML algorithms, such as linear regression or support vector machines, can be trained on historical price data to identify trends and their potential reversal points. The algorithm can then generate buy or sell signals based on the detected trend direction and strength.</li></ul><p><strong>Mean Reversion Strategies:</strong></p><ul><li><strong>Concept:</strong> Mean reversion strategies exploit the tendency of asset prices to revert to their average values over time.</li><li><strong>ML Application:</strong> ML algorithms, like autoregressive models or hidden Markov models, can analyze historical price data to determine the mean and variance of price fluctuations. When prices deviate significantly from the mean, the algorithm can generate a signal to enter a trade, anticipating a return to the average.</li></ul><p><strong>Statistical Arbitrage Strategies:</strong></p><ul><li><strong>Concept:</strong> These strategies seek to profit from temporary price discrepancies between related assets.</li><li><strong>ML Application:</strong> ML algorithms can analyze pairs of stocks, ETFs, or other financial instruments to identify statistically significant price relationships. When these relationships deviate from their historical norms, the algorithm can generate signals to buy the undervalued asset and sell the overvalued one, expecting the prices to converge.</li></ul><p><strong>Sentiment Analysis</strong>: This involves using natural language processing (NLP) to analyze news headlines, social media posts, and other textual information to gauge market sentiment. This analysis can provide traders insights into potential market movements driven by traders’ perceptions and reactions.</p><p><strong>Fraud Detection and Anomaly Identification</strong>: Machine learning can identify unusual patterns that may indicate fraudulent activity or market manipulation. Early detection helps maintain market integrity and protect the investments of all market participants.</p><p><strong>Portfolio Management:</strong> ML can assist in constructing diversified portfolios that are optimized according to risk preferences and expected returns. It can continuously monitor and adjust the portfolio to align with market conditions or a trader’s changing risk appetite.</p><p><strong>Price Forecasting:</strong> Although predicting exact prices is highly challenging due to the market’s complexity and the number of influencing factors, ML models are adept at identifying potential price trends and movements, providing traders with additional insights.</p><h4>Challenges in Machine Learning for Trading:</h4><p><strong>1. Data Quality and Volume</strong></p><p>High-quality, relevant data is the lifeblood of machine learning models. Inaccurate, incomplete, or biased data can lead to unreliable predictions and flawed trading strategies. For instance, if a model is trained on historical data that doesn’t account for a major market event, it might make erroneous forecasts when faced with similar circumstances in the future.</p><p><strong>Example: </strong>Consider an ML model trained on stock market data from a period of economic stability. If it encounters a sudden market crash due to unforeseen geopolitical events, the model’s predictions may be wildly inaccurate because it lacks the experience to handle such extreme volatility.</p><p><strong>Solution:</strong> To mitigate this challenge, traders and investors need to invest in robust data collection and cleaning processes. This involves sourcing data from diverse and reliable sources, ensuring its accuracy, and dealing with missing or inconsistent values. Additionally, using large datasets that encompass a variety of market conditions can help improve model robustness.</p><p><strong>2. Model Overfitting</strong></p><p>Overfitting occurs when a model becomes too specialized to the training data, learning its idiosyncrasies and noise rather than the underlying patterns. This can lead to excellent performance on the training data but poor performance on new, unseen data.</p><p><strong>Example:</strong> Imagine an ML model trained to predict stock prices based on historical data. If it overfits, it might memorize specific price fluctuations from the past but fail to generalize to future market movements.</p><p><strong>Solution:</strong> Several techniques can help prevent overfitting. These include using regularization methods, cross-validation to assess model performance on different subsets of the data, and ensemble methods that combine multiple models to improve overall accuracy.</p><p><strong>3. Lack of Transparency</strong></p><p>Some ML models, particularly complex deep learning models, are often referred to as “black boxes” because their decision-making processes are not readily interpretable. This lack of transparency can be problematic in trading, where understanding the reasons behind a model’s decisions is crucial for risk management and regulatory compliance.</p><p><strong>Example:</strong> A hedge fund using a black-box ML model might struggle to explain to investors or regulators why a specific trade was executed, especially if it results in a significant loss. This lack of transparency can erode trust and raise ethical concerns.</p><p><strong>Solution:</strong> Researchers are actively working on developing <a href="https://www.ibm.com/topics/explainable-ai#:~:text=Explainable%20artificial%20intelligence%20(XAI)%20is,expected%20impact%20and%20potential%20biases."><em>explainable AI</em></a> (XAI) techniques that aim to make ML models more transparent. These techniques provide insights into how a model arrives at its decisions, making it easier to understand and justify its actions.</p><p><strong>4. Regulatory Compliance</strong></p><p>The financial industry is heavily regulated, and the use of ML in trading introduces additional complexities. Regulatory bodies are concerned about issues such as market manipulation, fairness, and the potential for systemic risks.</p><p><strong>Example:</strong> A high-frequency trading firm using ML algorithms to execute trades at lightning-fast speeds might inadvertently trigger a flash crash due to a flawed model or unexpected market conditions. This could have far-reaching consequences for the market and its participants.</p><p><strong>Solution:</strong> To ensure regulatory compliance, trading firms need to have robust governance frameworks in place that include rigorous testing and validation of ML models, clear documentation of their decision-making processes, and measures to prevent unintended market disruptions.</p><h4><strong>Conclusion</strong></h4><p>Machine learning is transforming the trading landscape by providing tools that can analyze complex datasets, predict market trends, automate trades, and manage risk with greater accuracy than ever before. As technology advances, the integration of ML in trading is likely to become more prevalent, making it an essential tool for modern traders. However, successful implementation requires careful consideration of the associated challenges, particularly concerning data quality, model transparency, and regulatory compliance. By addressing these issues, traders can harness the full power of machine learning to enhance their decision-making processes and gain a competitive edge in the financial markets.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bda9190c1d04" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Faster Data fetch and Optimal Data Storage]]></title>
            <link>https://medium.com/@_SSP/faster-data-fetch-and-optimal-data-storage-5075375ca250?source=rss-4c8ea90ea0a------2</link>
            <guid isPermaLink="false">https://medium.com/p/5075375ca250</guid>
            <category><![CDATA[training-datasets]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[data-storage]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[SSP]]></dc:creator>
            <pubDate>Fri, 03 May 2024 07:56:01 GMT</pubDate>
            <atom:updated>2024-05-03T07:57:34.526Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w-Q3OtLJnRwasz5lYSDf2Q.jpeg" /></figure><p><strong>Harnessing HDF5 for Optimized Financial Data Storage and Analysis</strong></p><p>If you’re a data scientist or analyst in the financial world, you know the struggle of managing massive amounts of market data. Traditional text files aren’t efficient for storing and quickly accessing the data points you need for analysis. HDF5 offers a powerful solution!</p><p><strong>What is HDF5?</strong></p><ul><li>A versatile binary data format designed to handle large and complex datasets.</li><li>No inherent file size limitations — ideal for the ever-growing volume of financial data.</li><li>Optimized for parallel I/O (input/output), allowing you to rapidly query the data you need.</li><li>Provides built-in optimizations for faster analysis and smaller storage requirements.</li></ul><p><strong>Getting Started with h5py (Python)</strong></p><p>Let’s explore how to use the h5py Python library to work with HDF5 in finance. (<strong>Note:</strong> Installing HDF5 itself can be more complex; h5py is easier to install with a package manager.)</p><p><strong>1. Setup</strong></p><p>Python</p><pre>import numpy as np<br>import h5py</pre><p><strong>2. Creating HDF5 Files</strong></p><p>Python</p><pre># Simulate high-frequency tick data<br>tick_data = np.random.rand(1000000, 5)  # Timestamp, price, volume, bid, ask</pre><pre># Create HDF5 file<br>hf = h5py.File(&#39;market_data.h5&#39;, &#39;w&#39;) </pre><pre># Add dataset for tick data<br>hf.create_dataset(&#39;ticks&#39;, data=tick_data)</pre><pre>hf.close()  # Save changes to disk</pre><p><strong>3. Reading HDF5 Files</strong></p><p>Python</p><pre>hf = h5py.File(&#39;market_data.h5&#39;, &#39;r&#39;)  # Open in read mode<br>print(hf.keys())  # View datasets</pre><pre># Extract a slice of tick data<br>ticks = np.array(hf.get(&#39;ticks&#39;)) <br>print(ticks[1000:2000])  # Example: Get ticks for a specific timeframe</pre><pre>hf.close()</pre><p><strong>4. Organizing with Groups</strong></p><p>Python</p><pre>hf = h5py.File(&#39;portfolio_data.h5&#39;, &#39;w&#39;)</pre><pre># Create groups by asset class<br>stocks = hf.create_group(&#39;stocks&#39;)<br>bonds = hf.create_group(&#39;bonds&#39;)</pre><pre># Add datasets for individual holdings within each group<br>stocks.create_dataset(&#39;AAPL&#39;, data=np.random.rand(100, 4))  # Price, volume, etc.<br>bonds.create_dataset(&#39;US10YT&#39;, data=np.random.rand(50, 3))   </pre><pre>hf.close()</pre><p><strong>5. Compression for Space Efficiency</strong></p><p>Python</p><pre>hf = h5py.File(&#39;data.h5&#39;, &#39;w&#39;)</pre><pre>hf.create_dataset(&#39;dataset_1&#39;, data=d1, compression=&quot;gzip&quot;, compression_opts=9)  # Adjust compression level</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w-Q3OtLJnRwasz5lYSDf2Q.jpeg" /></figure><pre>hf.close()</pre><p><strong>Real-World Use Cases</strong></p><ul><li><strong>Storing high-frequency tick data:</strong> Analyze market microstructure and develop trading algorithms</li><li><strong>Time-series analysis:</strong> HDF5 efficiently handles large historical price datasets for technical analysis.</li><li><strong>Portfolio risk management:</strong> Store complex portfolio holdings data along with risk factors for in-depth analysis.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5075375ca250" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Difference between Prediction and Estimation]]></title>
            <link>https://medium.com/@_SSP/difference-between-prediction-and-estimation-5e76cd146103?source=rss-4c8ea90ea0a------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e76cd146103</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[estimations]]></category>
            <category><![CDATA[statistical-learning]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[predictions]]></category>
            <dc:creator><![CDATA[SSP]]></dc:creator>
            <pubDate>Thu, 13 Jul 2023 04:03:45 GMT</pubDate>
            <atom:updated>2024-06-14T03:23:18.351Z</atom:updated>
            <content:encoded><![CDATA[<p>Prediction ≠ Estimation</p><p>I was surprised that even seasoned data scientists believed that Ordinary Least Squares (OLS) is a prediction technique rather than a technique to fit the data !!</p><p>I know many of us use the words Estimation and Prediction synonymously.</p><p>However, if you are a hands-on statistician or Data Scientist, it is good to know the distinction between the two in a statistical sense.</p><p>Firstly, let us unpack a few terms: Statistics and Parameter</p><p>▪️ Statistic describes the sample whereas a Parameter describes the population.</p><p>▪️ An estimator is a statistic that helps us infer the value of an unknown parameter.</p><p>For example:</p><p>The sample mean is an estimator of the Population mean (a parameter).</p><p>Therefore, an estimate is a guess about the true state of nature (the parameter).</p><p>In my post “Most Important Assumption Checks of Linear Regression”, I covered Andrew Gelman’s concept of ‘Representativeness’.</p><p>Just to recap the concept: “A regression model is fit to data and is used to make inferences about a larger population, hence the implicit assumption in interpreting regression coefficients is that the sample is representative of the population.”</p><p>So, you see whenever we write the Regression equation, we ideally need to use ŷ instead of Y. Because we are actually estimating the true value of Y through ŷ.</p><p>This is illustrated in the image below. Please note, I have put a hat on top of Error (which is to be read as residual) in the first equation because in a way residuals are estimates of error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/0*yaRHxlw0sH2peLJV" /></figure><p>So, now come to what is predictor and prediction.</p><p>The predictor uses the data to guess at some random value that is not part of the dataset.</p><p>A prediction in essence is a guess about another random value.</p><p>So let&#39;s say we take the same regression model as an example. The regression model has dependent variable (Y) — weight of people and X (independent variable) — height</p><p>Now we have the data as follows:</p><p>Y (in pounds): 110, 130, 145, 160, 175<br>X (in inches): 50, 60, 70, 80, 90</p><p>Now if were to use our regression model to predict the weight of a person say at 100 inches in height, then it would be a prediction.</p><p>You see the height of 100 inches is not part of the dataset. However, we did use the data at hand.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e76cd146103" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Types of Null Values]]></title>
            <link>https://medium.com/@_SSP/types-of-null-values-e9e1fa7436e?source=rss-4c8ea90ea0a------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9e1fa7436e</guid>
            <category><![CDATA[time]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[nan]]></category>
            <category><![CDATA[none]]></category>
            <dc:creator><![CDATA[SSP]]></dc:creator>
            <pubDate>Sun, 04 Jun 2023 18:06:20 GMT</pubDate>
            <atom:updated>2023-06-04T18:06:20.522Z</atom:updated>
            <content:encoded><![CDATA[<p>In how many ways can you say ‘No’? No, Nein, Non? Well, Python can say this in three different ways.</p><p>Whenever we source data for reporting, analysis, and machine learning our first hurdle is the same. Cleaning it. One of the significant challenges when we clean data, is dealing with missing values. In Python, we face different values in place of missing data, such as None, NaN, and NaT. We know they are missing values, but what’s the difference, and how should we handle them?</p><p>NaN:</p><p>NaN (Not a Number) means missing value. It appears in numerical columns showing a missing value in that column. The presence of NaN in an integer column makes it a float type.</p><p>For example, let’s create a series with integer values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*BW1fdoOD8uzJVqpgkE4noA.png" /></figure><p>We can see that the column type is detected as an integer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/232/1*xd63iTggy2cYWu_EYDI4eQ.png" /></figure><p>But if we reindex this series with an additional row, it is filled with NaN as it has no values, and the column type automatically changes to float.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*g9v8Vfy3JBcW83QeWEgjlg.png" /></figure><p>This conversion happens due to memory and performance. But, if we want to keep the column in an integer type, we can use the nullable integer extension dtypes provided by pandas such as Int8Dtype, Int16Dtype, Int32Dtype, and Int64Dtype.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*d4JIDi2lev2VHbmV2pRqkQ.png" /></figure><p>And when we reindex the series with new columns with null values, the type remains integer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*UrHrybK_Gc2KUtwR8sqJqA.png" /></figure><p>None:</p><p>None is very similar to NaN, but the only distinction is the type of None is not numeric, whereas the type of NaN is numeric (NaN — Not a Number)</p><p>Let’s create a series with the value None and numbers in it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*gC0Db0QNsede2rRSDCa0DQ.png" /></figure><p>The series declared with ‘None’ is automatically changed to ‘NaN’. This is because pandas automatically convert ‘None’ to ‘NaN’ since the other values in the series are numeric, allowing the dtype to change to float64.</p><p>If this conversion didn’t occur, the column type would be “object”, which would be inaccurate. <a href="https://stackoverflow.com/questions/21018654/strings-in-a-dataframe-but-dtype-is-object">This StackOverflow</a> is helpful in understanding the inner workings of the “object” dtype.</p><p>Let us consider a non-numeric series as an example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*8klYaiFP-Ipy7y6tm-Zd8A.png" /></figure><p>In this series, we can see that the None remains the same, and no casting occurs since the rest of the values in the series are of the object type. This is because the series has a mixture of Python string objects and a Python None object.</p><p>In comparison, if we create a series with np.NaN:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*eIJrLbfdVTkOSS4h8EcKYw.png" /></figure><p>We can see that the value remains as NaN as the object type allows mixed values.</p><p>There is another difference between None and NaN, that occurs when we perform equality comparisons.</p><p>For example, when we try to check if a column contains None, we can equate it with None and see if the value is None.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*zOx4y_x_xysOFPbccNBK5g.png" /></figure><p>However, we can’t do the same validation with np.nan because np.nan!= np.Nan.… confusing we know! <a href="https://stackoverflow.com/questions/20320022/why-in-numpy-nan-nan-is-false-while-nan-in-nan-is-true">This StackOverflow</a> explains the inner workings of np.nan and why this is the case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*HlRsC7FdHjhz_onuI0KaRg.png" /></figure><p>In the above example, we can see that it verified for None correctly, but didn’t work the same way for np.NaN.</p><p>NaT:</p><p>NaT represents a missing date. This is specific to columns with the type DateTime. NaT stands for Not a Time.</p><p>For example, let us create a dataframe with numerical values and a column with the dtype DateTime.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*6T236iFrLnx-iD5YE8UilQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/241/1*PsnwOH1lP2WxV1VGbFAUuA.png" /></figure><p>Suppose we substitute some of the values with np.NaN automatically replaces it with NaT in the column with the DateTime type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*YSAd5d6l2EexJzQx2AC56g.png" /></figure><p>NaT is similar to NaN when it comes to equating as pd.NaT != pd.NaT.</p><p>Handling missing values:</p><p>All these three types of missing values can be verified in similar ways.</p><p>Isna() — This gives a boolean value, True or False if a value is null. It can be NaN, None, or NaT. This will still identify that prompt True if any of these values are present.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*PrThwS6isswKosNf0eou2A.png" /></figure><p>In the previous example, we replaced null values in indexes 1 and 4, and the “isna()” prompts it as True.</p><p>Notna() — Checks for the opposite. It also returns a Boolean value but gives True if the value is present.</p><p>We can drop the null rows with null values,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*PrThwS6isswKosNf0eou2A.png" /></figure><p>or fill the rows with null values using dropna() and fillna().</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*3hn_F7X7e5o0-9ASCVG5OA.png" /></figure><p>Interpolate() — This function is helpful when we handle time-series data. For example, if there are missing values in data that are reported daily, the interpolate function fills the missing data with midpoints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*1GhTprGAfPaQQtultUu9xg.png" /></figure><p>From this example, we can see that the interpolate() function, fills the NaNs with midpoints between 2 values.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9e1fa7436e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Best Free Data Sources for Algorithmic Trading]]></title>
            <link>https://medium.com/@_SSP/best-free-data-sources-for-algorithmic-trading-77a7c1c00356?source=rss-4c8ea90ea0a------2</link>
            <guid isPermaLink="false">https://medium.com/p/77a7c1c00356</guid>
            <category><![CDATA[financial-data]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[equity]]></category>
            <dc:creator><![CDATA[SSP]]></dc:creator>
            <pubDate>Thu, 18 May 2023 20:04:38 GMT</pubDate>
            <atom:updated>2023-07-13T02:50:23.320Z</atom:updated>
            <content:encoded><![CDATA[<p>Having access to reliable, clean, and live data is one of the most important requirements for developing profitable strategies. Although many data vendors only cater to big hedge funds with generous yearly data budgets that are outside of the possibilities of small proprietary firms and retail investors, there are countless fintech companies that have emerged in the last couple of years that offer investment-grade data to the general public.</p><p>In this article, I’ll go through the most relevant and interesting data sources available to retail investors. Although most of these also have paid subscriptions, I only listed the ones that also have good free subscriptions.</p><p>I organized the data into categories, but some sources offer more than one type of data and could very well have been classified in another category.</p><p>In summary, these are the best data sources freely available for algorithmic trading:</p><p>When it comes to stock market data Polygon.io, Alpaca, Yahoo Finance, The Kenneth French Data Library, Damodaran Data, SimFin, and EODData are the most relevant vendors available. In the case of cryptocurrencies, the most popular providers are Binance, Coinbase, and CoinmarketCap. For economic data, the most reliable statistics are available in FRED, The US Bureau of Labor Statistics, The Bureau of Economic Analysis, and the World Bank. Last but not least, Finnhub, Tiingo, Nasdaq, FlightRadar, and Reddit are websites to consider when it comes to alternative data.</p><p>Table of Contents</p><ul><li>Stock Market Data</li><li>Polygon.io</li><li>Alpaca</li><li>Yahoo Finance</li><li>Kenneth French Data Library</li><li>Damodaran Data</li><li>SimFin</li><li>EODData</li><li>Cryptocurrencies</li><li>Binance</li><li>Coinbase</li><li>Coinmarketcap</li><li>Alternative Data</li><li>Finnhub</li><li>Tiingo</li><li>Nasdaq</li><li>FlighRadar24</li><li>Reddit</li><li>Economic Data</li><li>FRED</li><li>US Bureau of Labor Statistics</li><li>Bureau of Economic Analysis</li><li>World Bank</li></ul><h3>Stock Market Data</h3><p>Having easy access to up-to-date market data for all major exchanges around the world is almost a requirement for setting up an efficient research pipeline. Although the following list is not exhaustive, it sure is extensive:</p><h3>Polygon.io</h3><p>Polygon.io is one of the most popular data vendors used by programmers in the financial industry. Because of its API, good documentation, and access to stocks, options, forex, and cryptos, Polygon is definitely an option to keep in mind.</p><ul><li>Website: <a href="https://polygon.io/">Link</a></li></ul><h3>Alpaca</h3><p>Alpaca is a relatively new stockbroker that specializes in catering to the algorithmic trading community. It has a very simple user interface, but a very powerful, extensively tested, and well-documented API. It not only offers up to 1Minute intraday data for all US-based exchanges but also for an everyday increasing number of cryptocurrencies.</p><p>It also offers quotes and trades streaming via WebSockets and a few alternative data streams, like for example news data from Benzinga.</p><ul><li>Website: <a href="https://alpaca.markets/">Link</a></li><li>API: <a href="https://alpaca.markets/deprecated/docs/api-documentation/api-v2/">Link</a></li><li>Websocket: <a href="https://alpaca.markets/deprecated/docs/api-documentation/api-v2/streaming/">Link</a></li><li>News API: <a href="https://alpaca.markets/docs/market-data/news/">Link</a></li></ul><h3>Yahoo Finance</h3><p>Due to its popularity and its ease of use, yahoo finance is the most used source of historical data used by students and hobbyists. Although not always reliable, also offers fundamental data, option chains, statistics, and sentiment data for most companies. Yahoo Finance makes it very easy to download all the data in CSV format. Additionally, although it is not officially maintained, it has an open API that can be accessed by libraries available in most programming languages.</p><ul><li>Website: <a href="https://finance.yahoo.com/">Link</a></li><li>YFinance (Python Library): <a href="https://pypi.org/project/yfinance/">Link</a></li></ul><h3>Kenneth French Data Library</h3><p>The Kenneth French Data Library offers up to date data regarding the <a href="https://en.wikipedia.org/wiki/Fama%E2%80%93French_three-factor_model">Fama-French 3 Factor Model</a>, in addition to having information regarding related models derived from the seminal paper that revolutionized the financial markets in 1993. It does not offer programmatic access</p><ul><li>Website: <a href="http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html">Link</a></li></ul><h3>Damodaran Data</h3><p>Aswath Damodaran is one of the most prestigious professors and professionals when it comes to valuation. You can find updated information regarding betas (both levered and unlevered), cost of capital, cash flow and growth rate estimation, multiples valuation, and option pricing models. The website does not offer programmatic access.</p><ul><li>Website: <a href="http://pages.stern.nyu.edu/~adamodar/">Link</a></li></ul><h3>SimFin</h3><p>SimFin offers reliable and up-to-date fundamental information. It is very easy to use, has an intuitive user interface, and even offers an API. Additionally, non-programmers can download SimFin’s data in bulk and load it into Excel.</p><ul><li>Website: <a href="https://simfin.com/">Link</a></li></ul><h3>EODData</h3><p>EODData is a service that allows users to download mainly End Of Day data from a broad list of companies. Although intraday prices are behind a paywall, the free access to daily prices is still advantageous due to its reliability.</p><ul><li>Website: <a href="https://www.eoddata.com/">Link</a></li></ul><h3>Cryptocurrencies</h3><h3>Binance</h3><p>Binance not only is the most liquid cryptocurrency exchange in the world, but also has one of the most reliable and functional API’s in the crypto available community. In addition to having intraday data and websocket streaming, its API also allows for accessing tick data.</p><ul><li>Website: <a href="https://www.binance.com/">Link</a></li><li>API: <a href="https://www.binance.com/en/landing/data">Link</a></li><li>Websocket: <a href="https://docs.binance.org/api-reference/dex-api/ws-connection.html">Link</a></li><li>Unofficial Python Library: <a href="https://python-binance.readthedocs.io/en/latest/">Link</a></li></ul><h3>Coinbase</h3><p>Much like Binance, Coinbase offers an API with intraday cryptocurrency data and Websockets for live access to market data.</p><ul><li>Website: <a href="https://www.coinbase.com/">Link</a></li><li>API: <a href="https://developers.coinbase.com/api/v2">Link</a></li><li>Websocket: <a href="https://docs.cloud.coinbase.com/prime/docs/websocket-feed">Link</a></li></ul><h3>Coinmarketcap</h3><p>Coinmarketcap is widely known due to its breath of information available. It not only has a very nice user interface for exploring cryptocurrencies, exchanges and blocks in the blockchain, but also allows for programmatic access via its API. It has useful tools (like price conversion), listings of all major exchanges, global market data, and blockchain exploration, amongst many more. Although it also has a paid version, the free version is also worth it.</p><ul><li>Website: <a href="https://coinmarketcap.com/">Link</a></li><li>API: <a href="https://coinmarketcap.com/api/">Link</a></li></ul><h3>Alternative Data</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cVwh4MaFh2x6Df8u.jpg" /></figure><p>Alternative data has had a spike in interest in recent years, and for good reason. Hedge funds and proprietary firms have introduced novel datasets, even ones that seem to be unrelated to financial markets to the naked eye. The following list goes through a few reliable and interesting alternative data vendors.</p><h3>Finnhub</h3><p>Finnhub is one of the most interesting fintech data startups that I’m aware of right now. It sources its data from a broad repertoire of data vendors and makes it accessible via a single, consistent, and reliable API.</p><p>In addition to offering institutional-grade information regarding stock markets, bonds, ETFs, fundamentals, and estimates, they also offer a broad range of alternative data: Social sentiment, USPTO Patents, H1-B Visa Applications, and Senate Lobbying, among many more.</p><ul><li>Website: <a href="https://finnhub.io/">Link</a></li><li>API: <a href="https://finnhub.io/docs/api">Link</a></li></ul><h3>Tiingo</h3><p>In addition to offering traditional datasets like fundamental data, and end of day prices, Tiingo shines when it comes to their News API. It covers more than 65.000 equity tickers, 4.000 cryptocurrencies, and 75 currencies and offers historical data dating back to 1995. The free plan allows for 500 requests per hour, which is more than enough for most usecases.</p><ul><li>Website: <a href="https://www.tiingo.com/">Link</a></li><li>News API: <a href="https://api.tiingo.com/products/news-api">Link</a></li></ul><h3>Nasdaq</h3><p>Nasdaq Data has one of the most extensive data catalogs available in the industry. Although most of the datasets are behind a paywall, their interface allows to filter them and only keep the ones that are free to access. Since the catalog is simply too big to describe, it’s best if you go ahead and take a look at it yourself.</p><ul><li>Data Catalog: <a href="https://data.nasdaq.com/">Link</a></li></ul><h3>FlighRadar24</h3><p>Live flight data might seem like an odd addition to this list at first, but hedge funds have used this type of data in the past. By keeping an eye on private jet landings in Omaha (Nebraska), savvy traders could anticipate potential deals made by Warren Buffet before they were disclosed.</p><ul><li>Website: <a href="https://www.flightradar24.com/">Link</a></li></ul><h3>Reddit</h3><p>Since the r/WallStreetBets event with GME, everyone is aware of Reddit’s relevance when it comes to investor sentiment. It is also good to know that Reddit offers a generous API, which makes the task of estimating trends a lot easier.</p><ul><li>API: <a href="https://www.reddit.com/dev/api/">Link</a></li></ul><h3>Economic Data</h3><h3>FRED</h3><p>The Federal Reserve Bank of St. Louis Database is one of the most widely used sources for economic research and is widely cited in prestigious journals. It not only offers a wide range of datasets for free but they are maintained and kept up to date. It has extensive information regarding labor statistics, census data, economic activity, commodity prices, international trade, and interest rates, just to name a few.</p><p>Unlike many other public data vendors, FRED offers an easy-to-use Excel Plugin. Programmers can also access the data programmatically via an API.</p><ul><li>Website: <a href="https://fred.stlouisfed.org/">Link</a></li><li>Database Catalogue: <a href="https://fred.stlouisfed.org/categories">Link</a></li><li>Excel Add-In: <a href="https://fred.stlouisfed.org/fred-addin/">Link</a></li><li>API: <a href="https://fred.stlouisfed.org/docs/api/fred/">Link</a></li></ul><h3>US Bureau of Labor Statistics</h3><p>As you might have guessed, this source offers very detailed employment and wage data. Although rather limited and poorly documented, you can also access the information via an API</p><ul><li>Website: <a href="https://www.bls.gov/">Link</a></li><li>API: <a href="https://www.bls.gov/developers/">Link</a></li></ul><h3>Bureau of Economic Analysis</h3><p>BEA holds interesting data from multiple categories, such as consumer spending, income and saving, and investment in fixed assets, among others. It even has a “special topics” category that gathers data from arts and culture economic activity, intellectual property, space economy, marine production, and many others.</p><p>As is the case with other public sector databases, the BEA offers an API, but its documentation is a little bit outdated by today’s standards.</p><ul><li>Website: <a href="https://www.bea.gov/">Link</a></li><li>Categories: <a href="https://www.bea.gov/data/gdp">Link</a></li><li>API: <a href="https://apps.bea.gov/API/signup/index.cfm">Link</a></li></ul><h3>World Bank</h3><p>The WB is one of the most widely cited data sources in econometric journals. Although not all datasets are updated on a regular basis, the sheer number of data freely available is enough to keep have it as one of the go-to sources for modeling. It features a nice user interface for time series plotting, in addition to having an API.</p><ul><li>Website: <a href="https://databank.worldbank.org/">Link</a></li><li>API: <a href="https://datahelpdesk.worldbank.org/knowledgebase/topics/125589">Link</a></li><li>Data Catalog: <a href="https://datacatalog.worldbank.org/search?fq=(lineage%2Fharvest_system%20eq%20%27INDICATOR%27)&amp;q=&amp;sort=last_updated_date%20desc">Link</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77a7c1c00356" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>