Applying CNN for cross sectional dataConsistently inconsistent cross-validation results that are wildly...

Can an insurance company drop you after receiving a bill and refusing to pay?

How can I deliver in-universe written lore to players without it being dry exposition?

Find some digits of factorial 17

How much mayhem could I cause as a sentient fish?

Porting Linux to another platform requirements

Digits in an algebraic irrational number

Intern applicant asking for compensation equivalent to that of permanent employee

Why zero tolerance on nudity in space?

Writing a character who is going through a civilizing process without overdoing it?

A starship is travelling at 0.9c and collides with a small rock. Will it leave a clean hole through, or will more happen?

Would a National Army of mercenaries be a feasible idea?

Does paint affect EMI ability of enclosure?

How to limit sight distance to 1 km

Why isn't there a non-conducting core wire for high-frequency coil applications

Strange Sign on Lab Door

Advice for a new journal editor

Explain the objections to these measures against human trafficking

Injecting creativity into a cookbook

Why do no American passenger airlines still operate dedicated cargo flights?

What is the purpose of easy combat scenarios that don't need resource expenditure?

Why publish a research paper when a blog post or a lecture slide can have more citation count than a journal paper?

How can I get my players to come to the game session after agreeing to a date?

In Linux what happens if 1000 files in a directory are moved to another location while another 300 files were added to the source directory?

Avoiding morning and evening handshakes



Applying CNN for cross sectional data


Consistently inconsistent cross-validation results that are wildly different from original model accuracyUsing small CNN for de-noising on a full imageChoosing between prepadding and postpadding for variable length sequence data in a CNNResources for CNN example with KerasMy Keras CNN doesn't learnBatch data before feed into CNN networkkeras Sequential CNN for image data reshaping data issuesValue of loss and accuracy does not change over EpochsWrangling data for CNNUsing Image Data along with CSV file data for CNN model













0












$begingroup$


I have a data-set with around 1K features along with 200K observations and a target having 5 different categories. My target is amount categories containing how much a client can invest (e.g. 0-25K category 1, 25K-50K category 2 and so on). As for the features, I have quite rich info such as value of the total assets in a bank, total amount in a saving account, total amount in a current account, occupation code, if he/she has a loan or mortgage etc.



For my multi-class classification, I have tried GBM and MLP(Keras with Tensorflow backend) and got 0.69, 0.68 accuracy, respectively. As seen I could not beat GBM by MLP whose code is given below.



import time 

from datetime import timedelta from keras.wrappers.scikit_learn
import KerasClassifier from keras.layers import LeakyReLU

start_time = time.time()

df_results = pd.DataFrame()

np.random.seed(666)

def baseline_model():
model = Sequential()
model.add(Dense(2000, input_dim=X_train.shape[1]))
model.add(LeakyReLU())


for j in range(0,5):

model.add(Dense(100))
model.add(LeakyReLU())
model.add(Dropout(0.3))

model.add(Dense(5, activation='softmax'))

opt = keras.optimizers.Adam(lr=0.00001)
model.compile(loss='categorical_crossentropy', optimizer=opt, metrics=['accuracy'])

return model


estimator = KerasClassifier(build_fn=baseline_model)
#print("Training...")
estimator.fit(X_train, Y_train, epochs=50,batch_size=128,validation_split=0.2,verbose=2)
predictions = estimator.predict(X_test)
print(predictions)
print(encoder.inverse_transform(predictions))
elapsed_time = time.time() - start_time


Now I want to try the same task with CNN (if it makes sense?) From the blog link it is stated that CNN should be used when there is a spatial relationship in data.



So are there examples where CNN has been successfully applied to non-image, non-text and non-time series data? Could you guide me how to prepare the input data?










share|improve this question











$endgroup$

















    0












    $begingroup$


    I have a data-set with around 1K features along with 200K observations and a target having 5 different categories. My target is amount categories containing how much a client can invest (e.g. 0-25K category 1, 25K-50K category 2 and so on). As for the features, I have quite rich info such as value of the total assets in a bank, total amount in a saving account, total amount in a current account, occupation code, if he/she has a loan or mortgage etc.



    For my multi-class classification, I have tried GBM and MLP(Keras with Tensorflow backend) and got 0.69, 0.68 accuracy, respectively. As seen I could not beat GBM by MLP whose code is given below.



    import time 

    from datetime import timedelta from keras.wrappers.scikit_learn
    import KerasClassifier from keras.layers import LeakyReLU

    start_time = time.time()

    df_results = pd.DataFrame()

    np.random.seed(666)

    def baseline_model():
    model = Sequential()
    model.add(Dense(2000, input_dim=X_train.shape[1]))
    model.add(LeakyReLU())


    for j in range(0,5):

    model.add(Dense(100))
    model.add(LeakyReLU())
    model.add(Dropout(0.3))

    model.add(Dense(5, activation='softmax'))

    opt = keras.optimizers.Adam(lr=0.00001)
    model.compile(loss='categorical_crossentropy', optimizer=opt, metrics=['accuracy'])

    return model


    estimator = KerasClassifier(build_fn=baseline_model)
    #print("Training...")
    estimator.fit(X_train, Y_train, epochs=50,batch_size=128,validation_split=0.2,verbose=2)
    predictions = estimator.predict(X_test)
    print(predictions)
    print(encoder.inverse_transform(predictions))
    elapsed_time = time.time() - start_time


    Now I want to try the same task with CNN (if it makes sense?) From the blog link it is stated that CNN should be used when there is a spatial relationship in data.



    So are there examples where CNN has been successfully applied to non-image, non-text and non-time series data? Could you guide me how to prepare the input data?










    share|improve this question











    $endgroup$















      0












      0








      0





      $begingroup$


      I have a data-set with around 1K features along with 200K observations and a target having 5 different categories. My target is amount categories containing how much a client can invest (e.g. 0-25K category 1, 25K-50K category 2 and so on). As for the features, I have quite rich info such as value of the total assets in a bank, total amount in a saving account, total amount in a current account, occupation code, if he/she has a loan or mortgage etc.



      For my multi-class classification, I have tried GBM and MLP(Keras with Tensorflow backend) and got 0.69, 0.68 accuracy, respectively. As seen I could not beat GBM by MLP whose code is given below.



      import time 

      from datetime import timedelta from keras.wrappers.scikit_learn
      import KerasClassifier from keras.layers import LeakyReLU

      start_time = time.time()

      df_results = pd.DataFrame()

      np.random.seed(666)

      def baseline_model():
      model = Sequential()
      model.add(Dense(2000, input_dim=X_train.shape[1]))
      model.add(LeakyReLU())


      for j in range(0,5):

      model.add(Dense(100))
      model.add(LeakyReLU())
      model.add(Dropout(0.3))

      model.add(Dense(5, activation='softmax'))

      opt = keras.optimizers.Adam(lr=0.00001)
      model.compile(loss='categorical_crossentropy', optimizer=opt, metrics=['accuracy'])

      return model


      estimator = KerasClassifier(build_fn=baseline_model)
      #print("Training...")
      estimator.fit(X_train, Y_train, epochs=50,batch_size=128,validation_split=0.2,verbose=2)
      predictions = estimator.predict(X_test)
      print(predictions)
      print(encoder.inverse_transform(predictions))
      elapsed_time = time.time() - start_time


      Now I want to try the same task with CNN (if it makes sense?) From the blog link it is stated that CNN should be used when there is a spatial relationship in data.



      So are there examples where CNN has been successfully applied to non-image, non-text and non-time series data? Could you guide me how to prepare the input data?










      share|improve this question











      $endgroup$




      I have a data-set with around 1K features along with 200K observations and a target having 5 different categories. My target is amount categories containing how much a client can invest (e.g. 0-25K category 1, 25K-50K category 2 and so on). As for the features, I have quite rich info such as value of the total assets in a bank, total amount in a saving account, total amount in a current account, occupation code, if he/she has a loan or mortgage etc.



      For my multi-class classification, I have tried GBM and MLP(Keras with Tensorflow backend) and got 0.69, 0.68 accuracy, respectively. As seen I could not beat GBM by MLP whose code is given below.



      import time 

      from datetime import timedelta from keras.wrappers.scikit_learn
      import KerasClassifier from keras.layers import LeakyReLU

      start_time = time.time()

      df_results = pd.DataFrame()

      np.random.seed(666)

      def baseline_model():
      model = Sequential()
      model.add(Dense(2000, input_dim=X_train.shape[1]))
      model.add(LeakyReLU())


      for j in range(0,5):

      model.add(Dense(100))
      model.add(LeakyReLU())
      model.add(Dropout(0.3))

      model.add(Dense(5, activation='softmax'))

      opt = keras.optimizers.Adam(lr=0.00001)
      model.compile(loss='categorical_crossentropy', optimizer=opt, metrics=['accuracy'])

      return model


      estimator = KerasClassifier(build_fn=baseline_model)
      #print("Training...")
      estimator.fit(X_train, Y_train, epochs=50,batch_size=128,validation_split=0.2,verbose=2)
      predictions = estimator.predict(X_test)
      print(predictions)
      print(encoder.inverse_transform(predictions))
      elapsed_time = time.time() - start_time


      Now I want to try the same task with CNN (if it makes sense?) From the blog link it is stated that CNN should be used when there is a spatial relationship in data.



      So are there examples where CNN has been successfully applied to non-image, non-text and non-time series data? Could you guide me how to prepare the input data?







      python neural-network deep-learning keras cnn






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 15 hours ago







      mlee_jordan

















      asked 15 hours ago









      mlee_jordanmlee_jordan

      1264




      1264






















          0






          active

          oldest

          votes











          Your Answer





          StackExchange.ifUsing("editor", function () {
          return StackExchange.using("mathjaxEditing", function () {
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          });
          });
          }, "mathjax-editing");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "557"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f46402%2fapplying-cnn-for-cross-sectional-data%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Data Science Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f46402%2fapplying-cnn-for-cross-sectional-data%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown