Techno Blender
Digitally Yours.
Browsing Tag

Albanese

Optimization: Capacitated Facility Location Problem in Python | by Nicolo Cosimo Albanese | Feb, 2023

Find the optimal number and location of warehouses to reduce costs and meet demandImage by author.IntroductionProblem statementImplementation3.1. The dataset3.2. Customers, warehouses and demand3.3. Supply and fixed costs3.4. Transportation costs3.5. OptimizationExplore the resultsConclusionsFacility Location Problems (FLPs) are classical optimization tasks. They aim at determining the best among potential sites for warehouses or factories.Warehouses may or may not have a limited capacity. This distinguishes the…

Implementing the Steepest Descent Algorithm in Python from Scratch | by Nicolo Cosimo Albanese | Feb, 2023

Image by author.IntroductionThe steepest descent algorithm2.1 The search direction 2.2 The step size2.3 The algorithmImplementation3.1 Constant step size3.2 Line search with the Armijo conditionConclusionsOptimization is the process of finding the set of variables x that minimize or maximize an objective function f(x). Since maximizing a function is equivalent to minimizing its negative, we may focus on minimization problems alone:For our example, let us define a quadratic, multivariable objective function f(x) as…

Introduction to Optimization Constraints with SciPy | by Nicolo Cosimo Albanese | Jan, 2023

Explore bounds, linear and nonlinear constraints with practical Python examplesImage by author.IntroductionImplementation2.1 Unconstrained optimization2.2 Bounds2.3 Linear constraints2.4 Nonlinear constraints2.5 Applying different constraint types togetherConclusionsOptimization is the process of picking the best elements from a set of potential candidates to reach a specific goal.We perform a lot of optimization tasks in our everyday life: finding the shortest or fastest route to reach a destination, preparing a to-do…

Survival Analysis: Optimize the Partial Likelihood of the Cox Model | by Nicolo Cosimo Albanese | Dec, 2022

Finding the coefficients that maximize the log-partial likelihood in PythonLog-partial likelihood of the Cox model with local optimum. Image by author.IntroductionThe Cox proportional hazard modelOptimization problemImplementationConclusionsReferencesSurvival analysis encompasses a collection of statistical methods for describing time to event data.In this post, we introduce a popular survival analysis algorithm, the Cox proportional hazards model¹. Then, we define its log-partial likelihood and the gradient, and optimize…

Topic Modeling with LSA, pLSA, LDA, NMF, BERTopic, Top2Vec: a Comparison | by Nicolo Cosimo Albanese | Sep, 2022

A comparison between different topic modeling strategies including practical Python examplesImage by author.IntroductionTopic Modeling Strategies2.1 Introduction2.2 Latent Semantic Analysis (LSA)2.3 Probabilistic Latent Semantic Analysis (pLSA)2.4 Latent Dirichlet Allocation (LDA)2.5 Non-negative Matrix Factorization (NMF)2.6 BERTopic and Top2VecComparisonAdditional remarks4.1 A topic is not (necessarily) what we think it is 4.2 Topics are not easy to evaluateConclusionsReferencesIn Natural Language Processing (NLP), the…

Introduction to Deep Learning with Keras in R | by Nicolo Cosimo Albanese | Aug, 2022

A step-by-step tutorialView from Monte San Vigilio (Vigiljoch), Trentino-Alto Adige, Italy. Image by author.IntroductionEnvironment SetupDatasetPreprocessingBuilding the neural network5.1 Define the layers5.2 Compile5.3 FitTest set performancesConclusionsReferencesBoth R and Python are useful and popular tools for Data Science. However, when it comes to Deep Learning, it is most common to find tutorials and guides for Python rather than R.This post provides a simple Deep Learning example in the R language. It aims at…