In [1]:
library(caret)

data <- read.csv('../facies_vectors.csv', colClasses=c(rep("factor",3), rep("numeric",6), "factor", "numeric"))
head(data)


Warning message:
"package 'caret' was built under R version 3.2.5"Loading required package: lattice
Loading required package: ggplot2
FaciesFormationWell.NameDepthGRILD_log10DeltaPHIPHINDPENM_MRELPOS
3 A1 SH SHRIMPLIN2793.0 77.45 0.664 9.9 11.915 4.6 1 1.000
3 A1 SH SHRIMPLIN2793.5 78.26 0.661 14.2 12.565 4.1 1 0.979
3 A1 SH SHRIMPLIN2794.0 79.05 0.658 14.8 13.050 3.6 1 0.957
3 A1 SH SHRIMPLIN2794.5 86.10 0.655 13.9 13.115 3.5 1 0.936
3 A1 SH SHRIMPLIN2795.0 74.58 0.647 13.5 13.300 3.4 1 0.915
3 A1 SH SHRIMPLIN2795.5 73.97 0.636 14.0 13.385 3.6 1 0.894

In [2]:
train <- data[data$Well.Name != "SHANKLE",]
test <- data[data$Well.Name == "SHANKLE",]
head(train)
head(test)


FaciesFormationWell.NameDepthGRILD_log10DeltaPHIPHINDPENM_MRELPOS
3 A1 SH SHRIMPLIN2793.0 77.45 0.664 9.9 11.915 4.6 1 1.000
3 A1 SH SHRIMPLIN2793.5 78.26 0.661 14.2 12.565 4.1 1 0.979
3 A1 SH SHRIMPLIN2794.0 79.05 0.658 14.8 13.050 3.6 1 0.957
3 A1 SH SHRIMPLIN2794.5 86.10 0.655 13.9 13.115 3.5 1 0.936
3 A1 SH SHRIMPLIN2795.0 74.58 0.647 13.5 13.300 3.4 1 0.915
3 A1 SH SHRIMPLIN2795.5 73.97 0.636 14.0 13.385 3.6 1 0.894
FaciesFormationWell.NameDepthGRILD_log10DeltaPHIPHINDPENM_MRELPOS
9382 A1 SH SHANKLE2774.5 98.36 0.642 -0.1 18.685 2.9 1 1.000
9392 A1 SH SHANKLE2775.0 97.57 0.631 7.9 16.745 3.2 1 0.984
9402 A1 SH SHANKLE2775.5 98.41 0.615 12.8 14.105 3.2 1 0.968
9412 A1 SH SHANKLE2776.0 85.92 0.597 13.0 13.385 3.4 1 0.952
9422 A1 SH SHANKLE2776.5 83.16 0.592 12.3 13.345 3.4 1 0.935
9432 A1 SH SHANKLE2777.0 82.56 0.599 12.9 13.105 3.5 1 0.919

In [12]:
shrimplin <- data[data$Well.Name == "SHRIMPLIN", c(1,5,6,7,8,9,10,11)]
head(shrimplin)


FaciesGRILD_log10DeltaPHIPHINDPENM_MRELPOS
3 77.45 0.664 9.9 11.9154.6 1 1.000
3 78.26 0.661 14.2 12.5654.1 1 0.979
3 79.05 0.658 14.8 13.0503.6 1 0.957
3 86.10 0.655 13.9 13.1153.5 1 0.936
3 74.58 0.647 13.5 13.3003.4 1 0.915
3 73.97 0.636 14.0 13.3853.6 1 0.894

In [13]:
print(levels(shrimplin$Facies))
print(table(shrimplin$Facies))
shrimplin$Facies <- factor(shrimplin$Facies)
print(levels(shrimplin$Facies))
print(table(shrimplin$Facies))
fitControl <- trainControl(method="none", classProbs=F)
fit <- train(Facies ~ ., data=shrimplin, trControl=fitControl, method="svmLinear", cost=10)
print(fit)


[1] "1" "2" "3" "4" "5" "6" "7" "8" "9"

  1   2   3   4   5   6   7   8   9 
  0 118 123  18  63  63   5  69  12 
[1] "2" "3" "4" "5" "6" "7" "8" "9"

  2   3   4   5   6   7   8   9 
118 123  18  63  63   5  69  12 
Support Vector Machines with Linear Kernel 

471 samples
  7 predictor
  8 classes: '2', '3', '4', '5', '6', '7', '8', '9' 

No pre-processing
Resampling: None