To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 0f71a3ca authored by felikskiszkurno's avatar felikskiszkurno
Browse files

Further development

parent 335fa749
......@@ -3,7 +3,7 @@
"""
Created on Fri Jan 8 10:29:00 2021
@author: felikskrno
@author: Feliks Kiszkurno
"""
import numpy as np
......
......@@ -11,12 +11,13 @@ import slopestabilitytools
import random
import math
def svm_run(test_results):
# https://stackabuse.com/implementing-svm-and-kernel-svm-with-pythons-scikit-learn/
test_number = len(test_results.keys())
test_prediction = random.choice(list(test_results.keys()),
k=math.ceil(test_number*0.1))
test_prediction = random.choices(list(test_results.keys()),
k=math.ceil(test_number * 0.1))
test_training = slopestabilitytools.set_diff(list(test_results.keys()), set(test_prediction))
......@@ -26,7 +27,6 @@ def svm_run(test_results):
# Train classifier
for test_name in test_training:
# Prepare data
data_set = test_results[test_name]
X = data_set.drop('Z', '')
......
......@@ -5,3 +5,5 @@ Created on
@author:
"""
def
\ No newline at end of file
......@@ -54,20 +54,20 @@ def create_data(test_name, test_config, max_depth):
model_inverted = ert_manager.invert(data=data, lam=20, paraDX=0.25, paraMaxCellSize=5, paraDepth=max_depth,
quality=34,
zPower=0.4)
result = ert_manager.inv.model
result_array = result.array()
#result = ert_manager.inv.model
#result_array = result.array()
input_model2 = pg.interpolate(srcMesh=mesh, inVec=input_model, destPos=ert_manager.paraDomain.cellCenters())
#input_model2 = pg.interpolate(srcMesh=mesh, inVec=input_model, destPos=ert_manager.paraDomain.cellCenters())
input_model2_array = input_model2.array()
##input_model2_array = input_model2.array()
experiment_results = pd.DataFrame(data={'X': ert_manager.paraDomain.cellCenters().array()[:, 0],
'Y': ert_manager.paraDomain.cellCenters().array()[:, 1],
'Z': ert_manager.paraDomain.cellCenters().array()[:, 2],
'INM': input_model2_array,
'RES': result_array,
'INPUT_MODEL': input_model2,
'RESULT': result})
# experiment_results = pd.DataFrame(data={'X': ert_manager.paraDomain.cellCenters().array()[:, 0],
# 'Y': ert_manager.paraDomain.cellCenters().array()[:, 1],
# 'Z': ert_manager.paraDomain.cellCenters().array()[:, 2],
# 'INM': input_model2_array,
# 'RES': result_array,
# 'INPUT_MODEL': input_model2,
# 'RESULT': result})
# experiment_results.to_csv('results/results/'+test_name+'.csv')
......@@ -80,16 +80,24 @@ def create_data(test_name, test_config, max_depth):
input_model3 = pg.interpolate(srcMesh=mesh, inVec=input_model, destPos=grid.cellCenters())
result_grid = ert_manager.invert(data=data, mesh=grid, lam=20, paraDX=0.25, paraMaxCellSize=5, paraDepth=max_depth, quality=34,
zPower=0.4)
class_array = np.asarray(result_grid)
class_array = np.ones_like(input_model3) * resistivity_map[-1][0]
layer_id = 1
layer_depth_previous = 0
for depth in test_config['layers_pos']:
class_array[np.where((grid.cellCenters().array()[:, 1] >= depth) & (
grid.cellCenters().array()[:, 1] < layer_depth_previous))] = layer_id
layer_depth_previous = depth
layer_id += 1
experiment_results_grid = pd.DataFrame(data={'X': grid.cellCenters().array()[:, 0],
'Y': grid.cellCenters().array()[:, 1],
'Z': grid.cellCenters().array()[:, 2],
'INM': input_model3.array(),
'RES': result_grid.array(),
'INPUT_MODEL': input_model3,
'RESULT': result_grid,
'CLASS': })
'CLASS': class_array})
experiment_results_grid.to_csv('results/results/' + test_name + '.csv')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment