add new model architecture

This commit is contained in:
Hannes Signer 2025-02-11 17:17:43 +01:00
parent 67b1f23fa3
commit a0145576f4
2 changed files with 361 additions and 131 deletions

File diff suppressed because one or more lines are too long

View File

@ -70,7 +70,7 @@ class FuncTransform():
return X_log
def clustering(X, n_clusters=2, random_state=42, x_length=50, y_length=50):
def clustering(X, n_clusters=2, random_state=42, x_length=50, y_length=50, species='Barite'):
'''
Function to cluster data with KMeans.
'''
@ -80,7 +80,7 @@ def clustering(X, n_clusters=2, random_state=42, x_length=50, y_length=50):
iterations = int(len(X) / grid_length)
for i in range(0, iterations):
field = np.array(X['Barite'][(i*grid_length):(i*grid_length+grid_length)]
field = np.array(X[species][(i*grid_length):(i*grid_length+grid_length)]
).reshape(x_length, y_length)
kmeans = KMeans(n_clusters=n_clusters, random_state=random_state).fit(
field.reshape(-1, 1))