prediction

Incorporating user feedback in a ML model

隐身守侯 提交于 2019-12-02 18:31:56
I have developed a ML model for a classification (0/1) NLP task and deployed it in production environment. The prediction of the model is displayed to users, and the users have the option to give a feedback (if the prediction was right/wrong). How can I continuously incorporate this feedback in my model ? From a UX stand point you dont want a user to correct/teach the system more than twice/thrice for a specific input, system shld learn fast i.e. so the feedback shld be incorporated "fast". (Google priority inbox does this in a seamless way) How does one build this "feedback loop" using which

Cross validation for glm() models

浪子不回头ぞ 提交于 2019-12-02 17:19:05
I'm trying to do a 10-fold cross validation for some glm models that I have built earlier in R. I'm a little confused about the cv.glm() function in the boot package, although I've read a lot of help files. When I provide the following formula: library(boot) cv.glm(data, glmfit, K=10) Does the "data" argument here refer to the whole dataset or only to the test set? The examples I have seen so far provide the "data" argument as the test set but that did not really make sense, such as why do 10-folds on the same test set? They are all going to give exactly the same result (I assume!).

Java, Lambda: How to find a List from a Collection of Lists with different Types?

佐手、 提交于 2019-12-02 17:11:03
问题 Which is the best way in Java 8 to get a List with elements of Type1 from a List of Lists -> (Records) {List<Type1>, List<Type2>, List<Type3>, ...} ? Records has several Lists with different Types -> {List<Type1>, List<Type2>, List<Type3>, ...} List<T> getList(T t) { // t is instance of Type1 return Records -> List<t>; } Thanks so much for your help. 回答1: class Utils<T> { List<T> getList(T t, List<List> list) { return list.stream().filter(i -> t.getClass().isInstance(i.get(0))).flatMap(List<T

stock price prediction by using nnet

北慕城南 提交于 2019-12-02 16:31:55
问题 stock<-structure(list(week = c(1L, 2L, 5L, 2L, 3L, 4L, 3L, 2L, 1L, 5L, 1L, 3L, 2L, 4L, 3L, 4L, 2L, 3L, 1L, 4L, 3L), close_price = c(774000L, 852000L, 906000L, 870000L, 1049000L, 941000L, 876000L, 874000L, 909000L, 966000L, 977000L, 950000L, 990000L, 948000L, 1079000L, NA, 913000L, 932000L, 1020000L, 872000L, 916000L), vol = c(669L, 872L, 3115L, 2693L, 575L, 619L, 646L, 1760L, 419L, 587L, 8922L, 366L, 764L, 6628L, 1116L, NA, 572L, 592L, 971L, 1181L, 1148L), obv = c(1344430L, 1304600L, 1325188L

How to solve “log4j:WARN No appenders could be found for logger” error on Twenty Newsgroups Classification Example

不问归期 提交于 2019-12-02 13:31:30
I am trying to run the 2newsgroup classification example in Mahout. I have set MAHOUT_LOCAL=true, the classifier doesn't display the Confusion matrix and gives the following warnings : ok. You chose 1 and we'll use cnaivebayes creating work directory at /tmp/mahout-work-cloudera + echo 'Preparing 20newsgroups data' Preparing 20newsgroups data + rm -rf /tmp/mahout-work-cloudera/20news-all + mkdir /tmp/mahout-work-cloudera/20news-all + cp -R /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/alt.atheism /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/comp.graphics /tmp/mahout

Simple Regression Prediction Algorithm in JavaScript

无人久伴 提交于 2019-12-02 10:04:06
I am trying to do a simple forecast of future profit of an organization based on the past records by using regression. I am following this link . For testing purpose, I have changed the sample data and it produced these results: My actual data will be date and profit, and they will be going up and down rather than in a contiguous increment way. I realized that the method above works for sample data which keep on increasing as the prediction is quite accurate. However, when I changed the data to the one in the screenshot which goes up and down crazily, the prediction is not so accurate anymore.

stock price prediction by using nnet

[亡魂溺海] 提交于 2019-12-02 09:28:31
stock<-structure(list(week = c(1L, 2L, 5L, 2L, 3L, 4L, 3L, 2L, 1L, 5L, 1L, 3L, 2L, 4L, 3L, 4L, 2L, 3L, 1L, 4L, 3L), close_price = c(774000L, 852000L, 906000L, 870000L, 1049000L, 941000L, 876000L, 874000L, 909000L, 966000L, 977000L, 950000L, 990000L, 948000L, 1079000L, NA, 913000L, 932000L, 1020000L, 872000L, 916000L), vol = c(669L, 872L, 3115L, 2693L, 575L, 619L, 646L, 1760L, 419L, 587L, 8922L, 366L, 764L, 6628L, 1116L, NA, 572L, 592L, 971L, 1181L, 1148L), obv = c(1344430L, 1304600L, 1325188L, 1322764L, 1365797L, 1355525L, 1308385L, 1308738L, 1353999L, 1364475L, 1326557L, 1357572L, 1362492L,

Java, Lambda: How to find a List from a Collection of Lists with different Types?

坚强是说给别人听的谎言 提交于 2019-12-02 08:48:51
Which is the best way in Java 8 to get a List with elements of Type1 from a List of Lists -> (Records) {List<Type1>, List<Type2>, List<Type3>, ...} ? Records has several Lists with different Types -> {List<Type1>, List<Type2>, List<Type3>, ...} List<T> getList(T t) { // t is instance of Type1 return Records -> List<t>; } Thanks so much for your help. class Utils<T> { List<T> getList(T t, List<List> list) { return list.stream().filter(i -> t.getClass().isInstance(i.get(0))).flatMap(List<T>::stream).collect(Collectors.toList()); } } 来源: https://stackoverflow.com/questions/46894007/java-lambda

R Warning: newdata' had 15 rows but variables found have 22 rows [duplicate]

喜欢而已 提交于 2019-12-02 03:42:58
This question already has an answer here: Predict() - Maybe I'm not understanding it 4 answers I have read few answers on this here but I am afraid I have not been able to figure out an answer. My R code is: colors <- bmw[bmw$Channel=="Colors" & bmw$Hour=20,] colors_test <- tail(colors, 89) colors_train <- head(colors, 810) colors_train_agg <- aggregate(colors_train$Impressions, list(colors_train$`Position of Ad in Break`), FUN=mean, na.rm=TRUE) colnames(colors_train_agg) <- c("ad_position", "avg_impressions") lm_colors <- lm(colors_train_agg$avg_impressions ~ poly(colors_train_agg$ad_position

Keras Extremely High Loss

六月ゝ 毕业季﹏ 提交于 2019-12-02 00:54:29
问题 I'm trying to predict price by characteristics. I chose a pretty simple model, but it works very strange. Loss function is extremely high and I can't see where the problem is. Here is my model: # define base model def baseline_model(): # create model model = Sequential() model.add(Dense(62, input_dim = 62, kernel_initializer='normal', activation='relu')) model.add(Dense(31, kernel_initializer='normal', activation='relu')) model.add(Dense(15, kernel_initializer='normal', activation='relu'))