This file contains hidden or 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
problem = scikits.bvp_solver.ProblemDefinition(num_ODE = 2, | |
num_parameters = 0, | |
num_left_boundary_conditions = 1, | |
boundary_points = (0, TF), | |
function = function, | |
boundary_conditions = boundary_conditions) |
This file contains hidden or 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
wAltitude, wSpeed = 1,+1 | |
def function(a , T): | |
return numpy.array([T[1] , # evaluate dx1/dt | |
(wAltitude/wSpeed)*T[0]]) # evaluate dx2/dt | |
def boundary_conditions(Ta,Tb): | |
return (numpy.array([Ta[0] - X1T0]), | |
numpy.array([Tb[0] - X1Tf])) |
This file contains hidden or 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
import scikits.bvp_solver | |
import numpy,math | |
# next we define bounday conditions and the final time | |
# next we define the important constants | |
X1T0 = 0 | |
X1Tf = 11 | |
X2T0 = 0 | |
X2Tf = -2 | |
TF = 10 |
This file contains hidden or 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
""" | |
First we import scikits.bvp_solver and numpy because the callback functions must return numpy arrays. | |
""" | |
import scikits.bvp_solver | |
import numpy | |
# next we define the important constants | |
T10 = 130 | |
T2Ahx = 70 | |
Ahx = 5 |
This file contains hidden or 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
%% | |
% Enjoy | |
% Giovanni Balestrieri | |
% userk.co.uk | |
% | |
%%Insert the path of your csv file | |
fileID = fopen('~/accRaw.csv'); | |
C = textscan(fileID, '%s %f %f %f %d %s','delimiter', ',', 'EmptyValue', -Inf) | |
N=200; |
This file contains hidden or 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
#!/bin/bash | |
# Path variables | |
wekaPath="/home/userk/programs/weka-3-6-13" | |
csvPath="/tmp" | |
testSet="testSetAll.csv" | |
testSetWeka="testSetWeka" | |
echo Please, enter the initial portion of the filename you want to modify | |
read filename |
This file contains hidden or 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
sed -i '1ititleAffinity,genre,category,director,actor1,actor2,imageFeature1,imageFeature2,imageFeature3,imageFeature4,class' $csvPath/${testSet} > /dev/null |
This file contains hidden or 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
testSetWeka="testSetWeka" | |
#Create Folde if does not exist | |
mkdir -p ${wekaPath}/${filename} | |
relativePath=${wekaPath}/${filename} | |
# Create Arff file | |
java -cp ${wekaPath}/weka.jar weka.core.converters.CSVLoader -S "2,3" -N "last" ${csvPath}/${testSet} > ${relativePath}/${testSetWeka}.arff |
This file contains hidden or 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
trainingSet="trainingSet" | |
#Merge positive and negative instances in a new Training file | |
cat $csvPath/${file} $csvPath/${fileNo} > $csvPath/${trainingSet}.csv | |
#Sort lines in file | |
sort -R $csvPath/${trainingSet} -o $csvPath/${trainingSet} |
This file contains hidden or 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
# Controls the length of files | |
echo "Controlling length of files:" | |
numLab=$(cat $csvPath/${file} | wc -l) | |
echo "Labelled: ${numLab}" | |
numUnLab=$(cat $csvPath/${fileNo} | wc -l) | |
echo "UnLabelled: ${numUnLab}" |