Techno Blender
Digitally Yours.
Browsing Tag

cui

NBA Analytics Using PySpark. Win ratio for back-to-back games, mean… | by Jin Cui | Apr, 2023

Win ratio for back-to-back games, mean and standard deviation of game scores, and more with Python codePhoto by Emanuel Ekström on UnsplashJust over a week ago I was watching an NBA game between the Milwaukee Bucks and the Boston Celtics. This was a match-up between the top 2 teams in the league, which many considered to be a prequel to the Eastern Conference finals. Being a big basketball and NBA fan myself, the game turned out rather disappointing as the Milwaukee Bucks lost to the Boston Celtics 140–99, a rare blow-out…

Categorize Free-Text Bank Transaction Descriptions Using BERT | by Jin Cui | Jan, 2023

I built myself an Expense Tracking ToolExpense by Category. Chart by authorI purchased a property towards the end of calendar year 2022 with a mortgage. Given the increase in financial commitments, I wanted to keep a tab on my expenses. It had never occurred to me prior to this point, that I actually had no idea where I have been spending the most. Figuring this out may be a good starting point for my own expense management.Naturally I turned to the bank transactions data which I downloaded from the online banking portal…

Create Powerful Model Explanations for Classification Problems with Logistic Regression | by Jin Cui | Dec, 2022

A practitioner’s guide, with a demonstration using the IBM Telco Churn datasetPhoto by Pablo García Saldaña on UnsplashLogistic Regression is commonly used for modeling classification problems. It’s a parametric algorithm whose output provides for powerful model explanations (termed by many as explainable ML). In particular, in addition to overcoming the known limitations of a Linear Regression for modelling classification problems, and in comparison to the non-parametric Tree-based algorithms, it’s able to comfortably…

Interactive Geospatial Visualization with Shape Map Visual in PowerBI | by Jin Cui | Dec, 2022

A step-by-step guide/demonstration using public income and digital boundaries dataImage by authorPowerBI is a popular business intelligence reporting tool for most companies. In addition to the common use case of visualizing structured tabular data, it’s also able to read in geospatial data and turn them into interactive visualizations where reference layers such as average income for a particular region can be added to understand potential demographic patterns and relationships.Digital boundaries divide maps into…

How to Define Nonpublic Methods in a Python Class | by Yong Cui | Jul, 2022

Idiomatic ways to use Python as OOPPhoto by Nina Mercado on UnsplashAt its core, Python is an object-oriented programming (OOP) language, which builds its features around objects. A string is an object, an instance of a custom class is an object, and so is a class, module, and even package. One long-term principle in OOP coding is encapsulation — the design pattern where you expose the functionalities that the users need while hiding the implementation details and those that the users don’t need to have access to.For any…

Top 10 Categories of Pandas Functions That I Use Most | by Yong Cui | Jul, 2022

Get familiar with these functions to help you process dataPhoto by Firmbee.com on UnsplashPeople love to use Python because it has a versatile repository of third-party libraries for all kinds of work. For data science, one of the most popular libraries for data processing is Pandas. Over the years, because of its open-source nature, many developers have contributed to this project, making pandas powerful for almost any data processing job.I didn’t count, but I felt like there were hundreds of functions that you can use…

3 Things You May Not Know About Python Tuples | by Yong Cui | Jun, 2022

Getting better to use tuplesPhoto by Oscar Nilsson on UnsplashTuples are one important built-in data type in Python. Like lists, we often use tuples to save multiple objects as a data container. However, what makes them different from lists is their immutability — an immutable sequence of data. The following code snippet shows you some common usages for tuples.response = (404, "Can't access website")response_code = responseresponse_data = responseassert response_code == 404assert response_data == "Can't access website"The…

Tesla sold 32,165 China-made vehicles in May 2022, says CPCA

SHANGHAI: US electric vehicle maker Tesla sold 32,165 China-made vehicles in May, including 22,340 for export, the China Passenger Car Association (CPCA) said. That compares with 1,152 vehicles sold and none exported in April. The Tesla factory halted work for 22 days beginning late March to comply with a city-wide lockdown in Shanghai. The plant, which manufactures Model 3s and Model Ys, reopened on April 19 and resumed exports on May 11 but has struggled to get production back to pre-lockdown levels. Tesla's Shanghai…