## Simple Python implementation of the Weiszfeld algorithm

##### Sun March 14, 2021
machine-learning python weiszfeld_algorithm

Following is a simple implementation of the Weiszfeld algortihm that was discussed in a previous post in python.

import numpy as np
import math
from numpy import array

def weiszfeld(points):

max_error = 0.0000000001

x=np.array([point for point in  points])
y=np.array([point for point in  points])

ext_condition = True

start_x = np.average(x)
start_y = np.average(y)

while ext_condition:

sod = (((x - start_x)**2) + ((y - start_y)**2))**0.5

new_x = sum(x/sod) / sum(1/sod)
new_y = sum(y/sod) / sum(1/sod)

ext_condition = (abs(new_x - start_x) > max_error) or
(abs(new_y - start_y) > max_error)

start_y = new_y
start_x = new_x

print(new_x, new_y)

if __name__=="__main__":
weiszfeld([(2,1), (12,2), (3,9), (13,11)])


#### Paper Implementation - Uncertain rule-based fuzzy logic systems Introduction and new directions-Jerry M. Mendel; Prentice-Hall, PTR, Upper Saddle River, NJ, 2001,    555pp., ISBN 0-13-040969-3. Example 9-4, page 261

##### October 8, 2022
type2-fuzzy type2-fuzzy-library fuzzy python IT2FS paper-workout

#### Notes about Azure ML, Part 10 - An end-to-end AzureML example; Model Optimization

##### Creation and execution of an AzureML Model Optimization Experiment
machine-learning azure ml hyperparameter tuning model optimization

#### Notes about Azure ML, Part 9 - An end-to-end AzureML example Pipeline creation and execution

##### Creation and execution of a multi-step AzureML pipeline the selects the best model for a given dataset.
machine-learning azure ml pipeline