mirror of
https://git.gfz-potsdam.de/naaice/model-training.git
synced 2025-12-13 10:28:22 +01:00
add new model architecture
This commit is contained in:
parent
67b1f23fa3
commit
a0145576f4
File diff suppressed because one or more lines are too long
@ -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))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user