## How machine learning works?

Artificial intelligence is a buzzword nowadays, as most of the biggest companies use AI to bring innovation and assure profits. But how does it work actually? In fact, a concept called machine learning (ML) is what runs most of the tasks for artificial intelligence applications to operate precisely.

With machine learning, programmers don’t need to teach computers what it needs to do to finish tasks. Instead, computers can learn themselves using significant amounts of data. With machine learning, the software can behave like people or animals – learn from experience. To conclude, machine learning meaning is straightforward – machines can learn to do various tasks just like us.

## Machine learning jobs

The simplest machine learning example is a basic linear regression. It predicts how variable behaves for different values of the argument. Important to realize, linear regression can give you a lot of insightful information for bivariate processes. You can calculate the linear equation and r-squared values even with your calculator if there are few data points. In contrast, if there are countless data points and you’ll have further use of the regression model, then Python or R-statistics come in use.
Looking at the following picture, we see how machine learning answers the trivial question: “Does longer experience means bigger salary?”.

In this case, we can use a machine learning model that predicts employees salary knowing how many years of experience they have.

Machine Learning is one of the essential tools in Data Science. By the same token, data scientists need to have all the corresponding skills to use and develop machine learning algorithms. Overall, machine learning jobs can be divided into those that need to create or use the ML algorithms.
Machine learning engineer usually needs to develop and deploy ML algorithms. The most used tools for this job are Python or R; Big data technologies; SQL databases.
A data scientist’s work specter is broader than pure ML engineer’s. In reality, it is often a universal employee that completes most of the data related tasks that a company needs. Besides creating machine learning models, this person also analyzes data and visualizes its insights. This type of employee usually is the only one working with data in a small or average company.
ML related job ads always have some job titles to it. Still, never judge those jobs only by the title name. Most HRs in big companies don’t know the difference between data science terms, so it is better to read all of the job ads that could be related to your skill-set. In some cases, a data analyst would be required to use or develop machine learning algorithms. Likewise, there can be times when the job description in the ad might be totally misleading, and the complete picture of what the employer wants from you can only be known in the job interview.

### Salary - One of the best in USA

The average machine learning engineer salary in the USA is around 110k USD per year, according to payscale.com.

As it is one of the newest jobs in the market, most of the ML engineers are in the early stage of career (1-4 years of experience).

Yet, even for entry-level engineers, the average salary is 94k USD/year. Given that requirements for junior ML engineers or data scientists are very high, it can often mean that those entry-level engineers might have master’s or Ph.D. diplomas or great job experience as pure data analysts or mathematicians.

## Types of machine learning

There are these three types of machine learning:

• Supervised;
• Unsupervised;
• Reinforcement learning.

### Supervised learning

In a supervised learning model, the algorithm learns on a labeled dataset, to generate reasonable predictions for the response to new data. Supervised learning classifies into regression and classification.

Regression

It is one of the main concepts in statistics and finance. Regression determines whether the relationship between dependent (Y) and independent variables (X) is strong enough, so it could prove to us that some insight is valid.

Classification
Classification is a supervised learning approach in which software learns from data input given to it and then uses this to classify new observations. Classification methods can put items into two or more classes.

Here are some of the methods used in classification:
• Logistic regression;
• Naive-Bayes;
• Decision trees;
• Random forest;
• Neural networks;
• K-nearest neighbors.

### Unsupervised learning

This type of machine learning group and interpret data based only on input data. Samples don’t have any labels prior.
The most common unsupervised learning type is clustering. It finds hidden patterns or groupings in data. Clustering has many techniques, including:

• fuzzy c-means;
• hidden Markov models;
• hierarchical;
• subtractive clustering.

The unsupervised learning techniques detect anomalies, find associations, and extract features with autoencoders.

### Reinforcement learning

The third paradigm of machine learning deals with how software agents ought to take actions in an environment to maximize some results. Unlike other supervised and unsupervised learning, it does not have any labelled input/output. In application fields, reinforcement learning may help us to explain how equilibrium may arise under bounded rationality.

## Applications

#### Transportation optimization

Surprisingly, all of the taxi-booking, travel advisor, and route planning apps run on machine learning. Taxi-booking apps learn from customer experience ratings, supply-demand data to save your time, and give the best experience. Likewise, using prediction models and live data, apps like google can give you an approximate travel time for your trip taking usual peak hour traffic, other users GPS data into account. Similarly, Vacation planning software uses the same prediction system to recommend the cheapest flight tickets, hotel bookings, museums and more.

#### Money laundering detection

Countless bank officials let money laundering to strive for years as often it was not possible to check the significant amounts of transactions. At the same time, machine learning techniques of supervised and unsupervised learning became useful in identifying bank accounts that are possible money launders.
Now banks have data science specialists that improve machine learning models to find the most suspicious bank transfers using the least amount of employees for checking. For this reason, banks can use computers to find “a needle in a haystack” easily.

#### Social media solutions

Machine learning is a critical component of the popular social networks you use every day. Facebook uses advanced machine learning to do everything from content selection to face recognition in photos to user targeting in advertising. Instagram uses artificial intelligence to identify visual objects.
Similarly, LinkedIn uses machine learning to offer job recommendations, suggest people you might want to connect with, and serving you specific content in your feed.
Snapchat leverages the power of computer vision to track your features and overlay filters that move with your face in real-time.
These are just a few examples of how AI works behind the scenes to power features of the world’s most popular social networks.

#### Automatic Translation

Google Translate uses Natural Language Processing tools to learn itself from numerous languages big data. There are many techniques to teach translating model, including:

Agreement regulation: ML algorithms read text from left to right and then from right to left again to create a match. The end result is a consensus from both directions to eradicate errors.

Dual learning: Texts are translated from one language to another repeatedly until a natural and predict translation is delivered.

Deliberation Networks: Similar to dual learning, this method involves translating the same text over and over again to improve the final results.

#### Surveillance cameras recognition

Video files contain more information compared to texts and other media files. Because of this, extracting useful information from the automated video surveillance system has become a hot research issue. With this regard, video surveillance is one of the advanced application of an artificial intelligence approach.
Security companies need to identify humans from the videos saved. The facial pattern is the most widely applied parameter to recognize a person.
A system with the ability to gather information about the presence of the same person in a different frame of a video is highly demanding. There are several techniques of artificial learning algorithms to track the movement of a person and identifying them.

## Mastering machine learning with Kaggle

Kaggle is the community-based website that could be called home to data science. It has courses to learn machine learning in general, various python libraries, deep learning, SQL, NLP, and so on.

With Kaggle, you can test your data science skills without a need to get a job. Kaggle users provide access to various exciting databases that can be analyzed using multiple machine learning methods. For example, we can use supervised or unsupervised learning to examine the following data:

• Titanic passengers death/survive data;
• House prices;
• CO2 emissions;
• Democratic debate transcripts;
• Multidimensional taxi data in various cities;
• Crime rates;
• Cats classification;
• Russian troll tweets;
• Formula 1 races, …, and many more.

For every dataset page in Kaggle, there are many research versions with code from different users. Users post Python or R code to show their insights for the dataset. Also, there are many data science competitions in which you can compare your machine learning skills among fellow users of Kaggle. Winners of competitions are decided by other members that evaluate their peers. The best kagglers in competitions win as many as 10 thousand dollars that go to 1st place winners.

## Machine learning with Knime Analytics

Knime Analytics is free software that lets you apply machine learning techniques on your datasets. Simple and intuitive design helps you not only learn machine learning and data science; it also carries the most demanding real-world tasks for problem-solving. It uses an object-node structure in which you can see a whole tree of used operations and inputs/outputs.

There are informative descriptions for most of the available nodes and commands what help you gain deeper understanding instantly.

## What is a Tableau Heat Map?

Heat map in Tableau is a data visualization type for which you need to have one or more dimensions and 1 or 2 measures. In these heat maps, Tableau is displaying a table consisting of many squares. Tableau can represent these squares in different sizes and colors. You can choose measures that will reveal data by size, color, or both.

## How do you create a Heat map?

To create a heat map, you need to have a data set with at least in dimension and one measure. Ideally, you must have two dimensions, of which one should be a date and one or two measures. When you select your data source, follow these steps:

1. Select your dimensions and measures when holding a CRTL button.
2. Press Show Me button in the top-right corner and select Heat Maps to create our Tableau heat map.

## What are the best practices to use heat maps?

To use a heat map in Tableau is a go-to practice when you have some measure that you can analyze by timeline or sub-categorical dimensions that divides the sum of that measure. If you have too many rows and columns in your heat map, then you can add filters to make finding insights easier.

### Example 1. Determining which region has the most sales

We will use Superstore Sales data for this first example. Firstly, connect to our data by selecting the Orders sheet as our data source. Then we immediately go to our Tableau Sheet 1 and renaming it to what we want to find in it. In this instance, change Sheet 1 to Product Subcategory Sales by Region. As a result, we now see the modified sheet header and can go to the next steps that will create a heat map.
As you can see in the following video, we are selecting Product Subcategory, Region, and Sales. Then, we choose Heat Maps from Show Me list. As a result, we have our first heat map that can be formatted to look better. We switch column with header because instantly, Tableau put it in alphabetical order. Then, change Region header alignment to vertical.

#### Tweaking the heat map

Even though a Tableau heat map is intact, we still not have the best version of the chart in front of us. Indeed, there are a few things that we can improve here. First, increase the size of a heat map so it would look more appealing. Second, switch SUM(Sales) pill in the marks field from Size to Color and choose whatever color palette you like.

Now we can see that most sales were in Ontario, Prairie, and West regions. Also, it’s clear there were no Office Machines sales in the Nunavut region as it’s rectangle is white.
Moreover, we can use the second measure in the heat map to display both different sizes and colors for rectangles. Let’s change SUM(Sales) pill to size and drag Profit measure to colors field. As a result, we can understand which subcategories by region have the most sales (width of rectangles) and profit (color of boxes). With this addition, we can recognize negative profit cases. For example, we can see that Bookcases our store sold with negative profit in Yukon, Northwest Territories, Ontario, and Quebec.

### Example 2. Best App Store games 2008-2019

Let’s open the 17k app store games database from Kaggle. Steps that I use to create a Tableau heat map are in this video:

Using various filters, you can determine multiple app store games that have the biggest User Rating Count. As we know that the best games get rated more, the big User Rating count can indicate the best seller games in the Apple app store. If you want to know the best Role-Playing games, filter this genre and set the minimum User Rating count such that optimal number games could appear in a worksheet. For example, after placing the minimum User Rating to 20.000, you can see a Tableau heat map consisting of probably the best Role Playing Games in App Store history. Tableau Public worksheet is shared below.

### Example 3. CO2 Emissions By country in the Tableau Heat Map

This example is meant to show countries with the most significant CO2 emission and also changes in the emission numbers in the timeline. You can download the CO2 Emission data here. I am not going into further aspects of what steps I am taking to build a heat map in this case. Just watch the video below and digest it.

## Conclusion

To summarize, a Tableau heat map is an excellent alternative over traditional excel tables with numbers. In numerous circumstances, it is easier to find patterns using the size and color of cells over numbers.

## Tableau pie chart: full tutorial

The pie chart concept comes from old times. The pie distribution problem: how to divide a pie into X equal parts for X people. Nowadays people use pie charts to asses what components have the biggest share in some totality. In Tableau visualization, a pie chart is one of the most popular charts. For business applications, this chart is most appropriate to demonstrate profit by country, sales by client or expenditures by a company branch.

For this tutorial I am going to use the same Superstore Sample data set that I’ve used in Tableau bar chart tutorial.

## Creating a pie chart

To create a pie chart in Tableau, we need to have 1 and more dimensions and 1 or 2 measures. In this tutorial, I drag Sales to rows and Product Category to columns. However, a bar chart was created automatically at first. After that, we press Show Me and select pie charts. By doing so, we create a pie chart.

### Other creation method

If we want to avoid creating a bar chart, we need to follow this instruction:

1. Select Pie in the Marks field;
2. Drag Sales (a measure that you want to asses) to Size and Angle buttons;
3. Drag Product Category (a dimension by which you want to divide your measure) to Color button.

## Formatting a Tableau pie chart

### Changing size

Changing a size for a Tableau pie chart is one of the most annoying tasks. We have to move our pointer to the right next to a pie chart. As our pointer changes it’s appearance to a two way arrow, we can press, hold and drag it to the right to widen chart size limiter. Also do the same with the bottom limiter to attain a bigger chart.

### Display labels

To display labels, drag Product Category dimension to a Label button. If you want your labels to be inside of a chart, you can click on those labels and drag to a center of an angle or wherever you want. To see what percentage of a whole share each category has, drag Sales to a label button. After that, select the SUM(Sales) label mark and add Quick table calculation – percent of total.

## Tableau Donut chart

Donut chart is a variation of a Tableau pie chart. To create it, we need to:

1. Drag Number of Record measure to rows column twice;
2. Set measure to a minimum for both of those Number of Records marks that are in rows field;
3. Then we select Dual-axis in the second Number of Records mark;
4. In the marks field of MIN(Number of Records) 2, remove Product Category from colors;
5. Then, press the labels button and mark out “Show mark labels” field;
6. Select white color or whatever color that suits your Tableau worksheet;
7. Press on Size button and shrink your additional pie chart that will serve as a donut hole;
8. Select one of the axes and mark out a header.

## Tableau Advanced: Gauge KPI chart

Business people love seeing Key Performance Indexes (KPI) expressed in Donut or Gauge charts. There are no pre-built Gauge chart in Tableau, so users are using their creativity to build it themselves. A Gauge chart in Tableau is usually just a half of the Donut Pie chart.

You can find a lot of tutorials over the internet of how to create Tableau KPI Gauge charts of different style:

The sad part of creating a gauge chart using those tutorials is a lack of clarity. Great attention to detail is required to understand the concepts used in those methods. Additionally, you have to ascertain how to implement those methods with your data. Luckily, if you’ll take your time to comprehend Gauge creating concepts, completing your analytic work tasks will be easy.

### Creation steps for Gauge chart

I am taking Gauge creation concept from Vizartpandey.com blogpost about creating semi donut chart, because it is as simple as possible.

First, we have to understand that default pie chart angle order can’t be used to represent a gauge chart. You can see why in this picture:

#### 1. Creating supporting data and calculated fields

To change pie chart angle order so it would suit gauge chart, we need to create supporting data that will make new angles.

 Sections Zero_To_Value Value_To_50 After_50 Remainder Bottom Half

We add column ‘Number of Records’ and enter ‘1’ for every section row. Also, we do the same with whatever data for which we want to create gauge charts. You can do this addition in Excel easily. This will allow those rows cross-join, when doing FULL-OUTER join on ‘Number of Records’=’1’ in Tableau Data Source window. As a result, we will have 5 different sections for each row of our data-set.

We are going to create a gauge chart that will represent Free Throw percentage of NBA players. Lets use 2018-2019 season stats from https://www.basketball-reference.com.

Now we create calculated fields.

[Max %]– Free Throw Percentage Value based on each player

MAX({FIXED [Player]:MAX([FT%])})

[Arc Angle] – Logical calculations needed to transform our percentage value so that it will be represented in upper half of a circle.

CASE ATTR([Sections])
WHEN “Zero_To_Value” THEN IF ([Max %])<= 0.5 THEN ([Max %])/2 ELSE 0.25 END
WHEN “Value_To_50” THEN IF ([Max %])<= 0.5 THEN (0.5-[Max %])/2 ELSE 0 END
WHEN “After_50” THEN IF ([Max %])> 0.5 THEN (([Max %])-0.5)/2 ELSE 0 END
WHEN “Remainder” THEN IF ([Max %])<= 0.5 THEN 0.25 ELSE (1-([Max %]))/2 END
WHEN “Bottom Half” THEN 0.5
END

#### 2. Build a Doughnut

To build a Doughnut chart that will be used to create a Gauge chart, we:

1. Drag ‘Number of Records‘ to Rows field twice;
2. Set the aggregation of it to minimum;
3. Right-click on second pill of ‘MIN([Number of Records])’ and select Dual Axis.
4. In the marks section, select first ‘MIN([Number of Records])’ mark and set the chart type to Pie. For the same mark, drag Sections to Color and Arc Angle to Angle.
5. Then select second ‘MIN([Number of Records])’ and set the chart type to Circle. Add Max % to label of this circle and drag this label higher so it will be showing in the top part. Change circle color to white and reduce size of the circle. Now we see a doughnut.

#### 3. Finish the Gauge chart

To finish Gauge chart we finish these steps:
1. Sort Sections manually in this manner (Also assign following colors):
 Sections After_50 –Yellow Remainder –Grey Bottom Half –Any Color (Bottom will be hidden after we’ll fix the axis) Zero_To_Value –Yellow Value_To_50 –Yellow
2. Drag Players to Filters card. Press Analysis –> Filters and add Players filter to the right panel. Change Players filter so it will be single value drop-down;
3. Edit axis so it’s range will be fixed from 1 to 2;
4. Remove axis headers so we will be left with a Gauge chart.
You can copy numerous of these Gauge charts to the Tableau dashboard. In this case I am duplicating my sheet and moving both Gauges to the Dashboard to compare FT% of two players. Check my Tableau Public dashboard below:

## A lovely chart indeed

The pie chart is commonly used in Tableau and for a reason. It’s one of the best Tableau charts you can use. It presents data accurately, shows both proportions and values, and is very easy to interpret. Notably, the classical pie chart is easy to make. Additionally, there are more complicated variations of the Tableau pie chart like Donut chart, Gauge chart and Pie chart on Map. These charts can be used to represent data in BI visualization reports more clearly.

## What is Google Reach around Europe?

Almost anyone uses Google or some other search engine nowadays. Those that do not use Google may be very old and poor people. If you have internet, then it’s almost 100% chance that you are using Google, Bing, Yandex, Yahoo, etc. Then is the Google reach number reflect if a country has many old and poor people? In this article, I will analyze Europe countries Google reach numbers against various aspects.

Google describes that reach is an estimate of how many people are in, or interested in, the location you select. It’s based on the number of signed-in users visiting Google sites. This means that Google reach number is how many residents are using google, gmail, google sheets, google disc, etc. in that country on an everyday basis.

In the first two bar charts below I am showing which Europe countries have the best Google reach and reach/population ratio.

Russia and Germany have most people (about 60 million) that use this search engine, despite the fact that Russia’s (140m) population is almost double of what Germany (84m) has. The second chart is representing the reach and population ratio.

### Why does only 44% of Russian population use Google?

Let’s think why do less than half of the Russian people use google sites. Some would say that there are many poor and old people in Russia, so there are fewer people that are using the internet. The average salary in Russia these days is 45100 rubles per month as tradingeconomics.com reports. 45100 rubles equivalent is 700 dollars or 635 euros. It’s not that little in terms of the poorest European Union countries, so it isn’t Russia’s economy’s fault.

I think that the decisive factor of a bad Russian Google reach and population ratio has to be that many Russians use alternative search engines. Around 43% of people use Yandex.ru search engine in Russia.

Yandex.ru, like Google, provides many services like e-mail, local news, etc., so we can conclude that Russians are content with Yandex quality and don’t need to use Google. This reason has enough weight to exclude Russia from the following analysis.

Below we see TOP8 countries with the biggest reach/population ratio are mostly so called microstates. Usually there are a lot more people living, working and visiting those microstates than actual population. For example, Monaco has a population of 38695, but it has a lot of temporary residents who are not counted for population. Only Netherlands, Cyprus and Croatia are not microstates here, although these countries are popular among tourists.

Looking at the reach/population ratio vs population data, we can see that small population does not mean low reach/population ratio.

Small Balkan countries (Albania, Armenia, Kosovo) has very low reach rating. Although, we know that those three countries are very poor and very wealthy people lives in Monaco/Luxembourg.

## Does wealthy countries have better Google reach / population ratio?

Let’s see how it will play against net income of Europe countries. I am taking median equalized net income data of year 2018 from eurostat and other sources. I drawn the scatter plot in Tableau to see if there are any correlation between measures that I have mentioned (Monaco is excluded because it is a small city state for millionaires).

## Conclusion: Google reaches richer countries better

From what we see in those two scatter plots, we conclude that there are more google users per population in wealthier countries. R-squared values for trendlines are very convincing for this kind of analysis. R-squared value for Linear regression is 0.396 and for third-degree polynomial regression it is 0.445. Moreover, we could also exclude some borderline countries to make trendline even more accurate. These countries could be:

• San Marino (smallest Europe country),
• Azerbaijan (many people live in poverty and can’t afford internet, there is a big gap between the “middle class” and the poorest people ),
• Switzerland, Norway, Denmark (old school villagers usually don’t use the internet even though they earn more money)

In conclusion, this is a very interesting finding and I am eager to expand the research. I plan to add countries from the rest of the World to confirm this trend.

## Tableau bar chart tutorial

The fastest way to compare your data is creating Tableau bar chart. In this tutorial, I choose to open Superstore Sales file that I’ve mentioned in my datasets for analysis page. After opening excel file, I choose Orders sheet and drag to data source field.

## Selecting measures and dimensions

After connecting with the Super Store Sales file, we see these measures and dimensions: –>

Let’s think what we want to see in our bar chart.

Profit is one of the main KPI’s in business, we are choosing that measure and dragging to rows field. Furthermore, to see what product categories and sub-categories are generating most profit, we need to drag those dimensions to the columns field.

## Polishing the Tableau Bar Chart

The bar chart is made now, but we have to make it more beautiful and easier to read. Here are the steps that we follow to upgrade our chart:
1.  Move Office supplies category to the left, because it has most sub-categories. Also move technology category in front of the office supplies, because technology bars are much higher. This way it will look better.
2.  Add profit numbers to bars by dragging Profit measure to label field
3. Now we see that Telephones and Communication category label is not there. Number that would be used for a label is too big, so we decrease text size from 9 to 8.
4. Sort sub-categories by profit (descending).
5. Add colors to Tableau bar chart to make things further clear. Drag Profit measure to color field. I chose to use red-green diverging for this example. Also, I have marked Use Full Color Range box so that the worst sub-category will be visualized with the richest red in the range.

## Final chart view

After finishing our bar chart we can see which categories and sub-categories makes good profit numbers. We see that “the Store” loses money by selling Bookcases and Tables. In a real-world situation, middle managers would be required to report what were the reasons for that. Additionally, as analysts, we can drill-down into subcategories and try to find those reasons in our data.

## Share of interest for different visualization software in USA

Data was taken from Ubersuggest free keyword tool. We can see from this data that in May 2019 the biggest interest was for Microsoft POWER BI and Tableau software. Although there are many other software that people from USA are interested in. For example, Looker had 100+ k searches, but I excluded it because this keyword can be searched for some different meanings and it is too difficult to estimate what percentage searched exactly for data visualization software called “Looker”.

## Qlik Sense tips. How to use a snapshot?

You can not share your snapshots externally like with a printscreen. Qlik Sense saves snapshots into the same app file. These snapshots are for Story telling. If you have a map of US, then zooming out to see Alaska and Hawaii is not very convenient. For this situation the best decision is to take a snapshot of Alaska and paste it into your story besides west border where Pacific ocean is.

## Qlik Sense Maps. How to get your USA area layer right?

I’ve had a lot of pain while trying to get USA states right in Qlik Sense layer maps. Some states were showing outside of USA. Remember this: USA states column has to contain short code in Qlik Sense. Full names of states will not work.

How to get it right?

1. Select data layer -> Location.
2. Make scope for locations custom
3. Location type. Administrative area (Level1)
4. Type ‘US’ in country field. (‘USA’ do not work!!!)
6. Celebrate!

## Hip and Knee Replacements complications. Visualization with Qlik Sense

Measure time span: 2013-07-01 2015-06-30.

These visualizations is still under construction. There is an issue with USA cities and states recognition – I will address how to solve this problem in my future blog post. For now, Qlik visualizes most of the cities on the USA map. Also I have just understand that it isn’t possible to share Qlik Sense visualizations with interactivity. This is a big negative for Qlik in comparison with Tableau. I will just use charts sharing from Qlik Sense cloud. You can change map size, but can’t change filter. That means I will have to share more charts and explain my insights better.

Now my plan is to fix cities and states data. Although ZIP codes works better with mapping, I still haven’t found out how to put points on a map with Zip codes and show Cities names.

## How to write Latex formulas in wordpress sites? WP KATEX PLUGIN

Have you ever wanted to put your Latex formulas or entire research papers to your wordpress blog?  You can do this easily with WP Katex plugin from Andrew Sun. I recommend to read more details about this program in Andrew’s website if you are interesting of using it heavily.
When WP Katex is installed, just put latex in brackets [ ] before the formula and /latex in [ ] brackets after it. Here are few of the examples:

$$\mathcal{L}(s)= \sum\limits_{m=1}^{\infty}\frac{a(m)}{m^s}$$$$\Lambda_{\mathcal{L}}(s) = w \overline{\Lambda_{\mathcal{L}}(1-\overline{s})}$$$$D_{\mathcal{L}} = \left \{ s\in \mathbb{C}: \max \left( \frac{1}{2}, 1 – \frac{1}{d_{\mathcal{L}}} \right) <\sigma <1 \right \}$$

Source code (if you use: display=”true”, then your formulas will be centered like in  mode):

1 2