This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
---------------------------------------------- | |
--- Author : Ahmet Özlü | |
--- Mail : [email protected] | |
--- Date : 1st September 2017 | |
---------------------------------------------- | |
*/ | |
#include <stdio.h> | |
#include <malloc.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#---------------------------------------------- | |
#--- Author : Ahmet Ozlu | |
#--- Mail : [email protected] | |
#--- Date : 21st September 2017 | |
#---------------------------------------------- | |
import face_recognition | |
import cv2 | |
import os | |
import create_csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#---------------------------------------------- | |
#--- Author : Ahmet Ozlu | |
#--- Mail : [email protected] | |
#--- Date : 21st September 2017 | |
#---------------------------------------------- | |
import sys | |
import os.path | |
import csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//---------------------------------------------- | |
//--- Author : Ahmet Ozlu | |
//--- Mail : [email protected] | |
//--- Date : 26th October 2017 | |
//---------------------------------------------- | |
/*declaration of variables*/ | |
int sensorValue; | |
int sensorValue2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# imports | |
from keras.models import Sequential | |
from keras.layers import Dense | |
from keras.layers import Dropout | |
from sklearn.metrics import r2_score | |
import matplotlib.pyplot as plt | |
import numpy | |
from keras.optimizers import Adam | |
import keras | |
from matplotlib import pyplot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Read data from csv file for training and validation data | |
TrainingSet = numpy.genfromtxt("./training.csv", delimiter=",", skip_header=True) | |
ValidationSet = numpy.genfromtxt("./validation.csv", delimiter=",", skip_header=True) | |
# Split into input (X) and output (Y) variables | |
X1 = TrainingSet[:,0:6] | |
Y1 = TrainingSet[:,6] | |
X2 = ValidationSet[:,0:6] | |
Y2 = ValidationSet[:,6] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create model | |
model = Sequential() | |
model.add(Dense(128, activation="relu", input_dim=6)) | |
model.add(Dense(32, activation="relu")) | |
model.add(Dense(8, activation="relu")) | |
# Since the regression is performed, a Dense layer containing a single neuron with a linear activation function. | |
# Typically ReLu-based activation are used but since it is performed regression, it is needed a linear activation. | |
model.add(Dense(1, activation="linear")) | |
# Compile model: The model is initialized with the Adam optimizer and then it is compiled. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Plot training history | |
pyplot.plot(history.history['loss'], label='train') | |
pyplot.plot(history.history['val_loss'], label='test') | |
pyplot.legend() | |
pyplot.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Plot actual vs prediction for training set | |
TestResults = numpy.genfromtxt("trainresults.csv", delimiter=",") | |
plt.plot(Y1,TestResults,'ro') | |
plt.title('Training Set') | |
plt.xlabel('Actual') | |
plt.ylabel('Predicted') | |
# Compute R-Square value for training set | |
TestR2Value = r2_score(Y1,TestResults) | |
print("Training Set R-Square=", TestR2Value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Plot actual vs prediction for validation set | |
ValResults = numpy.genfromtxt("valresults.csv", delimiter=",") | |
plt.plot(Y2,ValResults,'ro') | |
plt.title('Validation Set') | |
plt.xlabel('Actual') | |
plt.ylabel('Predicted') | |
# Compute R-Square value for validation set | |
ValR2Value = r2_score(Y2,ValResults) | |
print("Validation Set R-Square=",ValR2Value) |
OlderNewer