Comments (3)
The easiest way to proceed is to start with simple TensorFlowLinearClassifier
- then you don't need to do anything with your data - just pass your features as it is.
If you really want to apply convolutional networks (though in this case it doesn't seem very meaningful) - you should just skip this conversion steps and do directly conv+pool and then logistic regression on top:
def my_conv_model(X, y):
X = tf.reshape(X, [-1, N_FEATURES, 1, 1]) # to form a 4d tensor of shape batch_size x n_features x 1 x 1
features = skflow.ops.conv2d(X, N_FILTERS, [WINDOW_SIZE, 1], padding='VALID') # this will give you sliding window of WINDOW_SIZE x 1 convolution.
pool = tf.squeeze(tf.reduce_max(features, 1), squeeze_dims=[1])
return return skflow.models.logistic_regression(pool, y)
But I think you really should just concentrate on TensorFlowLinearClassifier
or TensorFlowDNNClassifier
- if you only have bunch of inputs variables that don't have any inherent structure. The Convolution and RNNs are for getting signal from structured data (like images or text).
from skflow.
Thanks a lot,
When I use LinearClassifier, I achieved the accuracy 35% (without any tuning, just follow the example at homepage).
With DNNClassifier I achieved the accuracy of 40%, and with CNN you suggested I can reached to 50%. So I think CNN should be good.
However, I hope that I can improve the accuracy a little bit more. For CNN, what tuning parameters I should try to modify to see the difference?
Thanks a lot,
from skflow.
I should write more about tuning of the models, but here are few tips:
- Increase number of steps to train - better, do how it's in the https://github.com/google/skflow/blob/master/examples/text_classification_character_cnn.py with loop of train/evaluate and save model state.
- Try different learning rate - a lot of models are very sensitive to learning rate.
- For DNN - try different number of layers and hidden units (
hidden_units
variable) - For CNN - try increasing N_FILTERS and adding more layers of convolution / max pooling.
from skflow.
Related Issues (20)
- Verbose is not considered during the training. HOT 1
- need more models in skflow.models HOT 2
- seq2seq example doesn't work HOT 1
- IndexError: index 20860 is out of bounds for axis 0 with size 18805 HOT 3
- TypeError inside skflow HOT 1
- text_classification.py giving error HOT 2
- skflow and tensorboard HOT 1
- Conditional RBM and distributed computing HOT 1
- can not run two tensorflow program one by one HOT 1
- Exception in the Custom model example HOT 2
- Scikitflow documentation update requested HOT 1
- getting none values not supported error HOT 3
- neural_translation.py showing error HOT 4
- Exception when restore DNN model HOT 1
- Tensor name "hiddenlayer_2/biases" not found in checkpoint files HOT 1
- checkpoint can't be restored... HOT 1
- DNNClassifier init failed HOT 1
- Why hasn't this repo been archived yet?
- Is this project still working? HOT 1
- .travis.yml: The 'sudo' tag is now deprecated in Travis CI HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from skflow.