scripts/sgdml_error_flattened_model.py
def smallest_max_distance_euclidean(sample,clusters):
	'''
	Finds the cluster that the given sample belongs to. Simple euclidean distance is used.
	(The metric used should be the same as for the agglomerative clustering.)
	
	Paramters:
		-sample: 
			numpy array containing positions of atoms of one samples
			Dimensions: (n_atoms,n_dimensions)
		
		-clusters: 
			numpy array containing positions within each cluster
			Dimensions: (n_clusters,n_atoms,n_dimensions)
					
	Returns:
		-index of cluster that the sample belongs to / closest cluster
										 
	'''
	
	g=np.zeros(len(clusters))
	for i in range(len(clusters)):
		g[i]=np.max(np.sum(np.square(clusters[i]-sample),1))   #numpy difference=>clusters[c]-sample elementwise for each c
	return np.argmin(g)

	Finds the cluster that the given sample belongs to. Simple euclidean distance is used.
	(The metric used should be the same as for the agglomerative clustering.)
	
	Paramters:
		-sample: 
			numpy array containing positions of atoms of one samples
			Dimensions: (n_atoms,n_dimensions)
		
		-clusters: 
			numpy array containing positions within each cluster
			Dimensions: (n_clusters,n_atoms,n_dimensions)
					
	Returns:
		-index of cluster that the sample belongs to / closest cluster
										 
	
Finds the cluster that the given sample belongs to. Simple euclidean distance is used.
(The metric used should be the same as for the agglomerative clustering.)

numpy array containing positions of atoms of one samples
Dimensions: (n_atoms,n_dimensions)


Finds the cluster that the given sample belongs to . Simple euclidean distance is used . ( The metric used should be the same as for the agglomerative clustering . ) numpy array containing positions of atoms of one samples Dimensions : ( n_atoms n_dimensions )
def smallest_max_distance_euclidean(sample,clusters):
	g=np.zeros(len(clusters))
	for i in range(len(clusters)):
		g[i]=np.max(np.sum(np.square(clusters[i]-sample),1))   
	return np.argmin(g)
def smallest_max_distance_euclidean ( sample , clusters ) : g = np . zeros ( len ( clusters ) ) for i in range ( len ( clusters ) ) : g [ i ] = np . max ( np . sum ( np . square ( clusters [ i ] - sample ) , 1 ) ) return np . argmin ( g )
Finds the cluster that the given sample belongs to.
Finds the cluster that the given sample belongs to .
'''
	Finds the cluster that the given sample belongs to. Simple euclidean distance is used.
	(The metric used should be the same as for the agglomerative clustering.)
	
	Paramters:
		-sample: 
			numpy array containing positions of atoms of one samples
			Dimensions: (n_atoms,n_dimensions)
		
		-clusters: 
			numpy array containing positions within each cluster
			Dimensions: (n_clusters,n_atoms,n_dimensions)
					
	Returns:
		-index of cluster that the sample belongs to / closest cluster
										 
	''' #numpy difference=>clusters[c]-sample elementwise for each c
index of cluster that the sample belongs to / closest cluster
index of cluster that the sample belongs to / closest cluster
sample
clusters