Weka classifier MultilayerPerceptron - classification

I have a problem with weka =/.
I'm using weka for data mining time series with neural network, in other words: the classifier MultilayerPerceptron.
my configuration is "MultilayerPerceptron -L 0.3 -M 0.1 -N 1000 -V 0 -S 0 -E 20 -H a"
There is the problem... the weka never ends.
I have 1904 instances and 18 attributes, corresponding to five days of time series, is not much data =/.
the last time the weka run for 8 days and it stop to run but don't give me a result.
any idea ?

I have run a MultilayerPerceptron using 10-fold Cross-Validation using a generated dataset containing 1904 instances and 18 attributes.
Given the configuration outlined above, each fold took 12 seconds on my PC and completed quite fine. Given the size of the dataset and the number of training runs, it shouldn't really take too long to train the MLP.
Perhaps there is something up with the data that you are using (Perhaps you could supply the arff header and some sample lines) or the system stopped training for some reason. You could try on another computer, but I'm not sure if that would resolve the issue.
I can't see why it would take 8 days to train a network like this. You probably don't need to wait that long before realising that there is an issue in the training. :)
Hope this Helps!

Related

Predict Test Sample Response for SVM Regression

I am running test on data samples using the example of SVM Regression Model, in the case of the example given in this MathWorks documentation (link: https://uk.mathworks.com/help/stats/compactregressionsvm.predict.html#buvytaz) the training data needs to have the same number of rows as the predict data, this is required so far to be able to run the prediction. What can I do if my data varies from the number of rows? How can I train my support vector machine with a data that have different number of samples and still be able to predict with the consequence of having maybe bigger error?
Data sample of the training data for the model and the data that I want to use for Mdl = fitrsvm.
ans=10×2 table
Training data Data to predict
___________ ____________
14 9.4833
27 28.938
10 7.765
28
22 21.054
29 31.484
24.5 30.306
18.5
32 28.225
28
Step by step verification of what I wanted to do:
What I did was:
1. Built a model
2. Test it with YFit
3. Modify the table and it did work!.
4. I doubled the size of the table to predict and it did work!.
I did something wrong before.
You can't train your model with unlabelled data, i.e. that has no "predict" value. I would suggest you just filter out all the unlabelled data points and train the model on this subset.
From intuition this just represents the fact, that you cannot learn from these data points. If I want to learn the relationship between age -> income, it does not help me at all to ask someone JUST their age and not their income. The information is useless to answer my question.

Caffe calculate issue

I have a question. I have a dataset that contains 5-10 photos (only for test run).
Using the example of a model bvlc_reference_caffenet I ran caffe.
But caffe process works about ~ 1 day. Please tell me if this is normal?

Encog predictive neural network results

I have been using the Encog Neural Net workbench (version 3.2) to run the sunspot prediction routine and have noticed that when changing the future prediction window to greater than 1 the results in the sunspot_output.csv appear to be time offset so that the output when the network evaluates at t=0 are not really (t+1), (t+2), (t+3) etc. It's very likely I'm not understanding how the workbench is displaying the results so perhaps someone could clarify this for me.
As I understand it if you use a past window of 30 and a future window of 14 then the network will look at the last 30 records and predict forward from the last available record (in this case lets say 11/1/1951 is the last available record). So an evaluation on 11/1/1951 will look back 30 records to 5/1/1949 and use this information to feed through the trained network to predict data for 12/1/1951 (t+1), 1/1/1952 (t+2), 2/1/1952 (t+3), etc. However, looking at the result file this does not appear to be the case. The "prediction" really appears to be a repeat of the pattern from the previous 14 records. So that (t+1) is really more representative of (t-14) 08/01/1950 than the next record forward from (t=0) which would be on 12/1/1951.
I have an image that shows this but unfortunately I don't appear have the reputation points to post it yet. To reproduce this issue I suggest using the Encog workbench and using a past window of 30, future window of 14 and training error of 1 or 2%.
To Summarize:
Has anyone else noticed this issue when looking at the predictive network results, particularly for greater than one time step ahead?
Why do the workbench results show that the encog predictive neural network is not properly predicting into the future when you look at the dates associated with the outputs.
Thank you for any thoughts you may have!
That's not an issue is how a sliding window time series forecaster works.
I would suggest you to deepen here https://www.cs.rutgers.edu/~pazzani/Publications/survey.pdf
It really depends on how you tune the neural network.
If you want more predictive power you have to extract features or syntetize new features (for example I would use wavelet extraction and denoising).
Pay attention to normalization. Use range normalization if you know that there are known ranges otherwise z-normalization.
Use the proper activation function: Sigmoid if the normalized range is 0,1 or tanh if the range is -1,1.
But before ending that the neural network is not predicting I would suggest you to use SVR (Support Vector Regression) included in encog.
It guarantees (if it is present) to reach the global minimum.
See if the SVR predicts better than the ANN.
If not use my firsts suggestions ;-)
Vincenzo

Encog Neural Network for Classifying Images : Training

I'm having problem training a neural network for image classification. Basing it on the performance of the NN, it doesn't seem to be learning.
I basically run the given program in encog-examples (ImageNeuralNetwork) to classify a set of images. The following is the sample program output
Training set created
Added input image:./faces/at33_straight_neutral_open.png; identity: shadesNone
Added input image:./faces/night/night_up_happy_sunglasses_4.png; identity: shades
...<more files here>...
Added input image:./faces/cheyer/cheyer_up_neutral_open_4.png; identity: shadesNone
Downsampling images...
Created network: [BasicNetwork: Layers=3]
Training Beginning... Output patterns=2
Beginning training...
Iteration #1 Error:199.591952% elapsed time = 00:00:00 time left = 00:01:00
Iteration #2 Error:196.384178% elapsed time = 00:00:00 time left = 00:01:00
Iteration #3 Error:160.422574% elapsed time = 00:00:00 time left = 00:01:00
...
Iteration #16 Error:99.733657% elapsed time = 00:00:00 time left = 00:01:00
...
Iteration #202 Error:99.489796% elapsed time = 00:00:04 time left = 00:01:00
...
Iteration #203 Error:199.605091% elapsed time = 00:00:04 time left = 00:01:00
As you can see, the NN oscillates from error close to 200% then to error close to 100%.
In the first place, I'm not even sure if an error above 100% is possible, much less 200%.
Below is my input file containing the commands and parameters to the NN :
CreateTraining: width:16,height:15,type:Brightness
Input: image:./faces/at33_straight_neutral_open.png, identity:shadesNone
Input: image:./faces/night/night_up_happy_sunglasses_4.png, identity:shades
Input: image:./faces/choon/choon_up_angry_open_4.png, identity:shadesNone
Input: image:./faces/cheyer/cheyer_left_angry_sunglasses_4.png, identity:shades
<more files...>
Network: hidden1:10, hidden2:10
Train: Mode:console, Minutes:1, StrategyError:0.25, StrategyCycles:100
Whatis: image:./faces/tammo/tammo_right_sad_sunglasses_4.png
<more files...>
My initial guess was that either the actual images or the ideal values were not properly fed to the NN, but I checked the inputs (e.g. outputting the images and ideal values that I have read), and they were ok.
Now my hunch is that some directories (perhaps of the java library or where the input files are read) are not properly set. Below is my Eclipse Run Configuration:
Classpath Tab
Bootstrap Entries
JRE System Library [jre7]
User Entries
encog-examples (default classpath)
encog-examples
encog-core-3.2.0-SNAPSHOT.jar \encog-examples\lib
Incidentally, I can't also properly run the Forest Cover example (which require an input file), while I can run the Lunar Lander and XOR examples (which don't require input files). This strengthens my assumption that my problem is directory-related.
Any help is much appreciated. Thanks.
Ignore my post above, 3.2.0 works just fine.
I had same problem like newind27, network just seemed to not learn anything and error changing was going wild. After doing a bit more research I found that encog kinda hates pictures with too much white.
Solution that worked for me was reducing the brightness of pictures that were used for network learning. One way to do this (without destroying original image in the process) is using RescaleOp class with BufferedImage.
Other possible (not tested) solution could be changing the order of images that are being fed up to the network in learning process.
seems to be bug with 3.2.0, had same problem
try training network with 3.1.0, should fix it

Prediction/delay forcasting using Machine Learning?

I have a set of data for the past 5 years. Approx 7000 rows of data with features that are binary {yes/no} or are multi-classed {product A, B, C} A total of about 20+ features.
I am trying to make a program (or one time analysis project) to determine (predict) the product shipdate(shipping delay days) based on this historical data. I have 2 columns that indicate when a product was planned to be shipped and another column of when it was actually shipped! Currently.
I'm wondering how I can make a prediction program that determines based on the historic data when new data input of a product will expect to ship. I don't care about a getting a specific date but even just a program that can tell me number of delay days to add...
I took an ML class a while back and I wasn't sure how to start something like this. Any advice? Plus the closest thing to this I can think of is an image recognition assignment using NN. but that was too easy here I have to deal with a date instead of pixel white/black.... I used Matlab back in the day (I still know how to use it) but I just downloaded Weka data mining tool.
I was thinking of a neural network but I'm not sure how to set it up to have my program give me a the expected delay time (# of days/month) from the inputed ship date.
Basically,
I want to input (size = 5, prod = A, ....,expected ship date = jan 1st)
and the program returns the number of days to add as a delay onto my expected ship date given the historical trends...
Would appreciate any any help on how start something like this the correct/easiest/best way... Thanks in advance.
If you use weka, then get your input/label data into the arff format and then you try out all the different regressors (this is a regression problem after all). To avoid having to do too much programming quite yet (if you are just in an exploratory phase), use the weka experimenter which has a GUI for trying out a whole bunch of regressors on your dataset.
Then when you find one that does something expected and you want to do some more data analysis using MATLAB, then you can use a weka/matlab interface.