Commit 20f1182c authored by Feliks Kiszkurno's avatar Feliks Kiszkurno
Browse files

Start of work on sql stuff

parent 2d653089
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="SlopeStability_Tests.sqlite" uuid="1bec2fa2-8163-4762-aacf-5861deb0ba9b">
<driver-ref>sqlite.xerial</driver-ref>
<synchronize>true</synchronize>
<remarks>DB containing information about all executed tests</remarks>
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
<jdbc-url>jdbc:sqlite:$PROJECT_DIR$/SlopeStability_Tests</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SqlDialectMappings">
<file url="file://$PROJECT_DIR$/sql_scripts/create_table_executed_tests.sql" dialect="SQLite" />
<file url="PROJECT" dialect="SQLite" />
</component>
</project>
\ No newline at end of file
......@@ -83,8 +83,8 @@
" y_train[idx] = test_hist[test_names_training[idx]]['n_class']\n",
"clf.fit(x_train, y_train)\n",
"y_pred = clf.predict(x_train)\n",
"training_accuray = len(np.where(y_train == y_pred)[0])/len(y_train)*100\n",
"print('Trained with accuracy: {accuracy:.2f}%'.format(accuracy=training_accuray))"
"training_accuracy = len(np.where(y_train == y_pred)[0])/len(y_train)*100\n",
"print('Trained with accuracy: {accuracy:.2f}%'.format(accuracy=training_accuracy))"
],
"metadata": {
"collapsed": false,
......@@ -112,8 +112,8 @@
" x_pred[idx,:] = test_hist[test_names_prediction[idx]]['hist']\n",
" y_corr[idx] = test_hist[test_names_prediction[idx]]['n_class']\n",
"y_pred = clf.predict(x_pred)\n",
"prediction_accuray = len(np.where(y_corr == y_pred)[0])/len(y_pred)*100\n",
"print('Predicted with accuracy: {accuracy:.2f}%'.format(accuracy=prediction_accuray))"
"prediction_accuracy = len(np.where(y_corr == y_pred)[0])/len(y_pred)*100\n",
"print('Predicted with accuracy: {accuracy:.2f}%'.format(accuracy=prediction_accuracy))"
],
"metadata": {
"collapsed": false,
......
CREATE TABLE ExecutedTests (
TestID INTEGER PRIMARY KEY AUTOINCREMENT ,
DatasetID INTEGER NOT NULL,
NormData INTEGER,
NormDataMethod TEXT,
NormClass INTEGER,
NClass INTEGER,
Sensitivity INTEGER,
Depth INTEGER,
InversionID INTEGER,
FOREIGN KEY (InversionID)
REFERENCES InversionParameters (InversionID),
ResultsID INTEGER,
'FOREIGN KEY (ResultsID)
REFERENCES ClassificationResults (ClassificationID)'
);
\ No newline at end of file
CREATE TABLE InversionParameters (
InversionID INTEGER PRIMARY KEY AUTOINCREMENT,
Lambda NUMERIC,
ParaDX NUMERIC,
ParaDepthCoeff NUMERIC,
Quality NUMERIC,
Zpower NUMERIC,
MaxDepthCoeff NUMERIC,
WidthCoeff NUMERIC,
MaxDepth NUMERIC
);
\ No newline at end of file
CREATE TABLE ClassificationResults (
ClassificationID INTEGER PRIMARY KEY AUTOINCREMENT,
TrainingADA NUMERIC,
TrainingGBC NUMERIC,
TrainingKNN NUMERIC,
TrainingSGD NUMERIC,
TrainingSVM NUMERIC,
PredictionADA NUMERIC,
PredictionGBC NUMERIC,
PredictionKNN NUMERIC,
PredictionSGD NUMERIC,
PredictionSVM NUMERIC
);
\ No newline at end of file
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