<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: iyissa</title>
    <description>The latest articles on DEV Community by iyissa (@iyissa).</description>
    <link>https://dev.to/iyissa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F801946%2Fe8e2cff7-7d5d-4c4e-bf02-640f21efd836.jpeg</url>
      <title>DEV Community: iyissa</title>
      <link>https://dev.to/iyissa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/iyissa"/>
    <language>en</language>
    <item>
      <title>Fake News Detection with Machine Learning and Flask</title>
      <dc:creator>iyissa</dc:creator>
      <pubDate>Wed, 15 Jun 2022 14:13:21 +0000</pubDate>
      <link>https://dev.to/iyissa/fake-news-detection-with-machine-learning-and-flask-e5l</link>
      <guid>https://dev.to/iyissa/fake-news-detection-with-machine-learning-and-flask-e5l</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;The world has become more digital, and there is an abundance of data available. Before being sent into space, all data cannot be checked. As the amount of data grows, some of it will be true while the rest will be false. All sources cannot be independently verified, and doing so manually is impossible.&lt;/p&gt;

&lt;p&gt;Machine Learning occupies a unique position in that when utilised correctly, it may construct a model based on a trusted dataset that can subsequently be used to sort through news. This project tries to develop a model that analyzes text to determine whether it is true news or not.&lt;/p&gt;

&lt;h2&gt;
  
  
  Diving into the Project
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Data
&lt;/h3&gt;

&lt;p&gt;The data used for this project was gotten from the &lt;a href="https://www.kaggle.com/datasets/clmentbisaillon/fake-and-real-news-dataset"&gt;Fake and real news dataset&lt;/a&gt; on Kaggle. For a simple guide on loading the data from Kaggle to Google Colab, check out this &lt;a href="https://medium.com/geekculture/how-to-download-datasets-from-kaggle-to-google-colab-7bb3c5a44c51"&gt;blog post&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Data Cleaning
&lt;/h3&gt;

&lt;p&gt;After the data has been loaded, there should be a bit of cleaning done.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;true['label'] = 1
fake['label'] = 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Data Cleaning at this stage is done to ensure text is converted to numbers for the model built to be able to interpret information. True news is hence labelled as 1, while Fake news is labelled as 0. &lt;/p&gt;

&lt;p&gt;To increase the speed of the experiment, only the first 5000 data points in the data are used and then put into a data frame.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;frames = [true.loc[:5000][:], fake.loc[:5000][:]]
df = pd.concat(frames)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;X and y datasets are then created for the process of dividing the earlier data frame into features and labels.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;X = df. drop('label', axis=1)
y = df['label']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dropping missing values and creating a copy data frame for later usage is then done.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df = df.dropna()
df2 = df.copy()
df2.reset_index(inplace=True)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Text Preprocessing&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Preprocessing is the process of converting data into a format that a computer can understand and then use. For working with text data, a form of preprocessing usually done is removing useless data. Useless data for text data are referred to as stop words. Stop words are commonly used words that programs and search engines have been instructed to ignore. Examples can include ('a', 'i', 'me', 'my', 'the', you')&lt;/p&gt;

&lt;p&gt;Continuing with the Fake News project, to preprocess we use the process&lt;br&gt;
&lt;strong&gt;nltk&lt;/strong&gt; is a python package that is used for text preprocessing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from nltk.corpus import stopwords
from nltk.stem.porter import PorterStemmer
import re
import nltk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After importing the required libraries, stemming is the next step. The next bit involves removing all punctuation, all capitalized characters, all stopwords and then stemming. Stemming is the process where words in the dataset are reduced to their base forms. For example, words like "likes", "liked", "likely", and "liking" are reduced to like. To eliminate data redundancy in a model, this is required. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Regex is used in this section, if you're not familiar, you can get an introduction to it &lt;a href="https://www.youtube.com/watch?v=sa-TUpSx1JA"&gt;here&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nltk.download('stopwords')
ps = PorterStemmer()
corpus = []
for i in range(0, len(df2)):
    review = re.sub('[^a-zA-Z]', ' ', df2['text'][i])
    review = review.lower()
    review = review.split()

    review = [ps.stem(word) for word in review if not word in stopwords.words('english')]
    review = ' '.join(review)
    corpus.append(review)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The next step involves Word Embedding. Word Embedding is a method used in extracting features from text data for machine learning models to be able to work with the data. There are different word embedding techniques such as Word2Vec, GloVe, BERT but Tfidf is sufficient for this project.&lt;/p&gt;

&lt;p&gt;Tfidf is a statistical method for capturing the significance of a text's terms in relation to the corpus/body of the text. It's ideal for retrieving information and extracting keywords from a document.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from sklearn.feature_extraction.text import TfidfVectorizer
tfidf_v = TfidfVectorizer(max_features=5000, ngram_range=(1,3))
X = tfidf_v.fit_transform(corpus).toarray()
y = df2['label']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once that is done, the next step involves splitting the dataset into train and test sets.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Training and Validating the Model
&lt;/h3&gt;

&lt;p&gt;The data has been split and is prime for modelling. For this project, the PassiveAggressiveClassifier is used. The PassiveAggressiveClassifier is an online learning algorithm that works well to detect fake news. Other algorithms can be used in this step such as Regression, XGBoost, or Neural Networks. This classifier works very well on fake news. For a more detailed explanation, check &lt;a href="https://www.geeksforgeeks.org/passive-aggressive-classifiers/"&gt;here&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from sklearn.linear_model import PassiveAggressiveClassifier
from sklearn import metrics
import numpy as np
import itertools
classifier = PassiveAggressiveClassifier(max_iter=1000)
classifier.fit(X_train, y_train)
pred = classifier.predict(X_test)
score = metrics.accuracy_score(y_test, pred)
print("accuracy:   %0.3f" % score)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A confusion matrix is then used to visualize the results. If you want to learn more about the confusion matrix, you can check out my &lt;a href="https://ayoyissa.hashnode.dev/what-is-a-confusion-matrix"&gt;previous article&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For the validation process.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Validation
import random
r1 = random.randint(5001, len(fake))

review = re.sub('[^a-zA-Z]', ' ', fake['text'][r1])
review = review.lower()
review = review.split() 
review = [ps.stem(word) for word in review if not word in stopwords.words('english')]
review = ' '.join(review)

# Vectorization
val = tfidf_v.transform([review]).toarray()

# Predict 
classifier.predict(val)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To save the model, we make use of the Pickle package&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pickle
pickle.dump(classifier, open('model2.pkl', 'wb'))
pickle.dump(tfidf_v, open('tfidfvect2.pkl', 'wb'))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Loading the model to confirm the results&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Load model and vectorizer
joblib_model = pickle.load(open('model2.pkl', 'rb'))
joblib_vect = pickle.load(open('tfidfvect2.pkl', 'rb'))
val_pkl = joblib_vect.transform([review]).toarray()
joblib_model.predict(val_pkl)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Deploying the model
&lt;/h3&gt;

&lt;p&gt;This section requires a user to have experience using Flask. There are many options to deploy a model but this model will be deployed using flask. The app.py used can be found on the GitHub &lt;a href="https://github.com/iyissa/Fake_News/blob/master/app.py"&gt;here&lt;/a&gt; and the index.html &lt;a href="https://github.com/iyissa/Fake_News/blob/master/templates/index.html"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The code for this project is available at this &lt;a href="https://github.com/iyissa/Fake_News"&gt;repo&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Bringing it All Together
&lt;/h3&gt;

&lt;p&gt;This blog post has gone through the steps from downloading data, to cleaning it, building the model, validating the model, and concluded with deploying on Flask. Thank you for reading through. Any feedback is appreciated.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://towardsdatascience.com/how-to-build-a-fake-news-detection-web-app-using-flask-c0cfd1d9c2d4"&gt;How to Build a Fake News Detection Web App Using Flask&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>machinelearning</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>What is a Confusion Matrix</title>
      <dc:creator>iyissa</dc:creator>
      <pubDate>Mon, 04 Apr 2022 10:50:18 +0000</pubDate>
      <link>https://dev.to/iyissa/what-is-a-confusion-matrix-3jb7</link>
      <guid>https://dev.to/iyissa/what-is-a-confusion-matrix-3jb7</guid>
      <description>&lt;p&gt;For beginners in Machine Learning, it is quite interesting that there is something as aptly named as the Confusion Matrix. It really is quite difficult to interpret or understand what is going on when you encounter it for the first time in your journey but for every machine learning engineer, the confusion matrix is a fundamental tool to have in your toolkit.&lt;/p&gt;

&lt;p&gt;The Confusion Matrix is a visualization tool for measuring the performance of a machine learning model. It can be used for measuring a number of things including Accuracy, Recall, Precision, Specificity and AUC-ROC curves. To know what metric to use while working on a problem is a different ballpark on its own.&lt;/p&gt;

&lt;p&gt;In machine learning, there are different methods to use to solve different problems. All of them involve separating training and test data from your problem dataset to know if the model created is correct or not instead of just going in blindly. After the creation of these sub-datasets, the model is then created. A tool for testing how correct the model that has been created is for the dataset is a Confusion Matrix. &lt;/p&gt;

&lt;p&gt;The rows in a Confusion Matrix signify the results that were predicted by the model while the columns stand for the truth that is known. This is where the concept of True Positives, True Negatives, False Positives and False Negatives come from. &lt;/p&gt;

&lt;p&gt;These are explained properly: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A true positive indicates that the prediction was positive and it is true (correct). It can also be explained by saying a true positive is an outcome where the model correctly predicts the positive class.  e.g A woman is predicted to be pregnant and she is pregnant &lt;/li&gt;
&lt;li&gt;A true negative indicates when the prediction is negative and it is true (correct). It can also be understood as an outcome where a model correctly predicts a negative class. e.g A man is predicted to not be pregnant and he is not pregnant &lt;/li&gt;
&lt;li&gt;A false positive indicates that the prediction is positive and it is false (incorrect). It can also be interpreted as an outcome where the model incorrectly predicts the positive class e.g A man is predicted to be pregnant but he is not pregnant &lt;/li&gt;
&lt;li&gt;A false negative indicates that the prediction is negative but it is false (incorrect). It can also be understood as an outcome where the model incorrectly predicts the negative class. e.g A woman is predicted to be not pregnant but she is.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v9KgMQpG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5a1ejwpfotztlvg7y3ww.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v9KgMQpG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5a1ejwpfotztlvg7y3ww.jpeg" alt="A Confusion Matrix" width="667" height="566"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As seen from the diagram above, the True Positive is in the top left corner and the True Negative is in the bottom right corner. Those are largely the important figures and they exist in the left diagonal. The numbers not in the diagonal show how many samples were classified wrong by the algorithm. So, a confusion matrix done using two different models can show at face value which is worse in predicting results. &lt;/p&gt;

&lt;p&gt;Not all confusion matrixes are 2*2, the size of a confusion matrix is determined by the number of things to be predicted. Something that is constant, no matter the size of the matrix is that the diagonal shows how correct the model predictions are.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Machine Learning and Tabular Data</title>
      <dc:creator>iyissa</dc:creator>
      <pubDate>Sun, 13 Mar 2022 15:53:30 +0000</pubDate>
      <link>https://dev.to/iyissa/machine-learning-and-tabular-data-mbm</link>
      <guid>https://dev.to/iyissa/machine-learning-and-tabular-data-mbm</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Machine Learning is quite simple but then it could be quite complicated at the same time. Neural networks are a fundamental aspect of machine learning. They are a series of algorithms that work together to identify underlying patterns in data, they usually mimic or behave in a way that the neurons of the human brain work and that is where the name is gotten from. &lt;/p&gt;

&lt;p&gt;Data comes in various forms, there is structured data, semi-structured and unstructured data. Structured data can be found in spreadsheets etc while unstructured data exists in log files, images, audios etc. Tabular data is a form of structured data. It is data that is structured into rows, where each of those rows contains information about something. &lt;/p&gt;

&lt;h2&gt;
  
  
  The Problems
&lt;/h2&gt;

&lt;p&gt;Using neural networks on tabular data has not always been ideal. Models that are usually built with neural networks typically have low performance compared to traditional machine learning models. Tabular data typically does not have the hyper non-linear relationships that image recognition, NLP datasets have and there isn’t enough information in tabular data for the models to capitalize on and increase their performance levels.&lt;/p&gt;

&lt;p&gt;The quality of data found is another one of the major concerns in tabular data. There are oftentimes outliers in the data, missing values. It is also difficult to find spatial correlations between the variables found in tabular datasets, which means that methods like Convolutional Neural Networks are unable to create models based on tabular data. Another important problem is the conversion of categorical attributes in the data. This is usually done using one-hot encoding but that increases the problem of dimensionality. Data augmentation is a very important part of machine learning as it helps the model become more accurate. It is very challenging to apply that for tabular data and all of these combine to show the complexity of using Neural networks with Tabular data.&lt;/p&gt;

&lt;p&gt;Models that perform very well on tabular data such as Gradient boosted trees, random forests, linear regression algorithms etc. all do very well when mapping “shallow” non-linear relationships and the mapping is done in an efficient and simple way. So, neural networks are not bad for tabular data, the amount of data required for a neural network to have good performance is not typically found in tabular data and explains the underperformance.&lt;/p&gt;

&lt;p&gt;The time and resources needed to tune neural networks and deep learning for tabular data are also not easily justifiable knowing how well gradient boosting algorithms work on the same type of data. &lt;/p&gt;

&lt;h2&gt;
  
  
  What ML algorithms work instead
&lt;/h2&gt;

&lt;p&gt;As alluded to earlier, gradient boosting algorithms have been shown to be the best for working on problems including tabular data, the best bet you can get for accurate modelling of these problems are LightGBM, XGBoost, Catboost.These three can be considered as the holy grail of tabular data and should be the first point of call in Tabular Data problems. Linear regression algorithms such as Logistic Regression, ElasticNet, etc. also perform admirably.&lt;/p&gt;

&lt;p&gt;If there is still a need for a deep learning model to be created for tabular data, there exists Tabnet. TabNet is a Deep Neural Network for working with Structured, Tabular Data. &lt;a href="https://paperswithcode.com/paper/tabnet-attentive-interpretable-tabular/review/"&gt;It has outperformed previously mentioned Decision Tree-based models on multiple benchmark datasets&lt;/a&gt; and can be used in practice. A simple guide for implementation in solving a problem can be found &lt;a href="https://towardsdatascience.com/tabnet-deep-neural-network-for-structured-tabular-data-39eb4b27a9e4"&gt;here&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Understanding what your problem needs and knowing what to prioritize will aid in choosing the right machine learning method to use. Hopefully, this article helps you understand the available options. Thank you.&lt;/p&gt;

&lt;p&gt;Some content that was used to gain an understanding of this issue include: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://arxiv.org/pdf/2110.01889.pdf"&gt;Deep Neural Networks and Tabular Data: A Survey&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.reddit.com/r/MachineLearning/comments/9826bt/d_why_is_deep_learning_so_bad_for_tabular_data/"&gt;Why is Deep Learning so bad for Tabular Data&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>machinelearning</category>
      <category>deeplearning</category>
      <category>neuralnetworks</category>
    </item>
    <item>
      <title>Evaluation Metrics for an ML Regression Model</title>
      <dc:creator>iyissa</dc:creator>
      <pubDate>Sun, 23 Jan 2022 17:59:58 +0000</pubDate>
      <link>https://dev.to/iyissa/evaluation-metrics-for-an-ml-regression-model-49op</link>
      <guid>https://dev.to/iyissa/evaluation-metrics-for-an-ml-regression-model-49op</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Building a machine learning model is not as difficult as it initially seems. The issues come with what to do after the initial model has been created. This article aims to answer questions such as “What is evaluation” “Why do you need it” “What are evaluation metrics” “What evaluation metrics should be used for a regression model” "Which situation should I use this metric in?” At the end of this article, you should understand the basics and most important parts of evaluating a created regression model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Recap
&lt;/h2&gt;

&lt;p&gt;Machine Learning can be called a fragment of Artificial Intelligence whose main focus is on building systems (models) that learn and improve based on the data that they consume. Machine Learning is a fundamental part of how the world operates with its use cases and applications visible in various sectors of the world. A machine learning model is a model that takes in independent variables (as input) and aims to predict a dependent variable (output) based on the data it has taken in and the relationships that exist amidst the data. More specifically, a linear regression model is one that makes use of the formula (y=mx+c) to model the relationship between the dependent variable and the independent variable(s)&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Evaluate?
&lt;/h2&gt;

&lt;p&gt;After the creation of a model, it is necessary to gauge the performance of how well the model performs on data. Evaluation is the process of testing the performance of the model. Evaluation is one of the most important aspects of Machine Learning as it is a method of testing how accurate a model is at predicting outcomes. It must be done because, without it, the risk of a bad model being used is greatly increased. An evaluation metric is a mathematical quantifier of the quality of the model that has been created. Examples of evaluation metrics are accuracy, precision, Inlier Ratio Metric, Mean Squared Error, Mean Absolute Error etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Residual Errors and Evaluation Metrics
&lt;/h2&gt;

&lt;p&gt;There are different evaluation metrics for different types of models such as the Classification model, Regression model, etc. A question frequently asked is “How can I calculate the accuracy of a regression model?” The simple answer is that you cannot because the output of a regression model is a numeric value such as a height or a dollar amount or something in that category. The output is not needed to predict the exact value but to instead measure how close the predicted value is to the actual value. That is where residual errors for regression models come in.&lt;/p&gt;

&lt;p&gt;For the evaluation of a Regression model, it is important to understand the concept of Residual Errors. A Residual error is a difference between the actual and predicted values. For each output, there is a residual. Residual errors could be either positive or negative. Technically, it is possible to manually check each residual to know how a model performed but in datasets where there are thousands and millions of points, that is not feasible. Hence, why there are evaluation metrics that are calculated using this residual error to simplify the evaluation process.&lt;/p&gt;

&lt;p&gt;There are a lot of metrics but the most common ones used are:&lt;/p&gt;

&lt;h3&gt;
  
  
  Mean Absolute Error (MAE):
&lt;/h3&gt;

&lt;p&gt;The MAE is simply calculated by taking the absolute of the residual errors and then finding the average value. The figure gotten is the absolute mean of the errors. How high or low it is determined how well the model is performing. The lower the MAE, the better the model fits the dataset.&lt;/p&gt;

&lt;p&gt;The MAE's advantage is that all the errors are computed on the same scale since the absolute value is used. Hence, not too much attention is given to the outliers in the data and it provides a fairly even measure of how well the model performs. The disadvantage is that if the outliers are very important in the model, the MAE is not very effective. This means that a model with a good MAE is usually great but they often make a few disappointingly poor decisions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mean Squared Error (MSE):
&lt;/h3&gt;

&lt;p&gt;The MSE is calculated by squaring the residual error and then finding the average. The value of the MSE is always vastly greater than that of the MAE due to the square that was taken. For the MSE, the closer the value gets to 0, the better the model is. Comparing multiple models, the one with the lowest MSE is the best.&lt;/p&gt;

&lt;p&gt;The advantage that comes with using the MSE is ensuring that the model has no outlier predictions that will produce huge errors as the MSE places greater influence on those errors since it squares them. The downside is that if the model makes one bad prediction, the squared function of the MSE greatly magnifies that error and it can skew the total.&lt;/p&gt;

&lt;h3&gt;
  
  
  Root Mean Squared Error (RMSE):
&lt;/h3&gt;

&lt;p&gt;The RMSE is simply taking the root of the mean squared error. The value of the RMSE should be as low as possible. The lower the RMSE, the better the predictions. A high RMSE shows a great deviation between predicted and actual values which shows that the model could be bad.&lt;/p&gt;

&lt;h3&gt;
  
  
  Huber Loss Function:
&lt;/h3&gt;

&lt;p&gt;The Huber Loss is something of a mid-point between the Mean Absolute Error and the Mean Squared Error. MSE identifiers outliers while MAE ignores the outliers. The calculation of the Huber loss function is somewhat complicated. Simplifying it is saying that for loss values that are less than the delta, the MSE should be used, and for loss values greater than the delta, the MAE should be used. That is a combination of the best from both error terms.&lt;/p&gt;

&lt;p&gt;The advantage of using the Huber is that using the MAE for the larger loss values lowers the weight given to outliers while using the MSE for the other loss values adds up to what is a well-rounded model.&lt;/p&gt;

&lt;p&gt;Other evaluation metrics that are not explained include the R-squared, Adjusted R-squared, Max Error, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Considerations and Recommendations
&lt;/h2&gt;

&lt;p&gt;For your model, The Huber Loss function should be used when a balance is needed between giving weight to outliers in the model but not so much that the model is entirely dependent on their presence. It is useful in regression model cases such as estimating location. For cases where outliers are very important, the MSE is advisable to be used and in cases, where outliers are not at all cared about, the MAE functions very well. For models where any slight variation in the error means a lot such as clinical trials, the RMSE should be used because it is the most exact of these metrics.&lt;/p&gt;

&lt;p&gt;Evaluation metrics as we have seen are quite useful and very helpful in reducing the stress of manual inspection of each point in the data.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It is recommended to use more than one metric for evaluating a model as some models are seen to perform very well on metric while failing to perform on another metric. That could give a false impression if only the good metric is reported on.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The majority of models created do not care much about outliers and are simply created to provide well-rounded predictions that perform well on the majority of the data. Final Thoughts and Further Reading Resources. It is important to understand how to evaluate a model because it is the bedrock for how good the model is. For further reading on other less used evaluation metrics and also greater in-depth readings on evaluation metrics for regression models, check out:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://keras.io/api/losses/regression_losses/"&gt;Keras Documentation&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.qualdo.ai/blog/complete-list-of-performance-metrics-for-monitoring-regression-models/"&gt;Complete List of Metrics&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
