dataspelunking / mlwr Goto Github PK
View Code? Open in Web Editor NEWMachine Learning with R
Machine Learning with R
I am trying to replicate the output on page 216. When I run:
m.m5p <- M5P(quality ~ ., data = wine_train)
I get this mess in my log:
Aug 20, 2019 9:19:10 AM com.github.fommil.netlib.BLAS
WARNING: Failed to load implementation from: com.github.fommil.netlib.NativeSystemBLAS
Aug 20, 2019 9:19:11 AM com.github.fommil.netlib.BLAS
WARNING: Failed to load implementation from: com.github.fommil.netlib.NativeRefBLAS
Aug 20, 2019 9:19:11 AM com.github.fommil.netlib.LAPACK
WARNING: Failed to load implementation from: com.github.fommil.netlib.NativeSystemLAPACK
Aug 20, 2019 9:19:11 AM com.github.fommil.netlib.LAPACK
WARNING: Failed to load implementation from: com.github.fommil.netlib.NativeRefLAPACK
I found another person (on reddit) who reported the same problem (he was on Windows 10 and I am on Mac) and there were no clues on how to fix it.
Unsurprisingly, the model output does not match what is in the book. The head of the output looks like this:
``
M5 pruned model tree:
(using smoothed linear models)
alcohol <= 10.85 :
| volatile.acidity <= 0.237 :
| | fixed.acidity <= 6.85 :
| | | sulphates <= 0.485 :
| | | | fixed.acidity <= 6.55 :
| | | | | chlorides <= 0.038 : LM1 (34/79.918%)
summary(m.m5p)
gives me this:
=== Summary ===
Correlation coefficient -0.2222
Mean absolute error 124.1163
Root mean squared error 165.4731
Relative absolute error 18429.7475 %
Root relative squared error 18670.7196 %
Total Number of Instances 3750
I am running:
macOS: 10.14.6
RWeka Version: 0.4-40
R version 3.6.1.
Java version "11.0.2" 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Do you have any ideas on how to get the code to work?
With R 3.5.3 running caret 6.0-84. The chunk of code below (around line 61 on GITHUB)
library(ipred)
library(caret)
set.seed(300)
ctrl <- trainControl(method = "cv", number = 10)
bagctrl <- bagControl(fit = svmBag$fit,
predict = svmBag$pred,
aggregate = svmBag$aggregate)
svmbag <- train(default ~ ., data = credit, "bag",
trControl = ctrl, bagControl = bagctrl)
throws this warning 10 times:
10: model fit failed for Fold10: vars=35 Error in fitter(btSamples[[iter]], x = x, y = y, ctrl = bagControl, v = vars, :
task 1 failed - "no applicable method for 'predict' applied to an object of class "c('ksvm', 'vm')""
Then this
11: In nominalTrainWorkflow(x = x, y = y, wts = weights, info = trainInfo, ... :
There were missing values in resampled performance measures.
Help....
For example on https://github.com/dataspelunking/MLwR/blob/master/Machine%20Learning%20with%20R%20(2nd%20Ed.)/Chapter%2004/sms_spam.csv#L79
Allo! We have braved the buses and taken on the trains and triumphed. I mean we€˜re in b€˜ham. Have a jolly good rest of week
Should be
Allo! We have braved the buses and taken on the trains and triumphed. I mean we're in b'ham. Have a jolly good rest of week
There's a few issues like this. Would you accept a PR to fix them?
create a document-term sparse matrix code is giving error. error is _"Error in simple_triplet_matrix(i, j, v, nrow = length(terms), ncol = length(corpus), : 'i, j' invalid". how to solve this error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.