I have a dataset with a message (string) and an associated mood. I am trying to use an ANN to predict one of the 6 moods using the encoded inputs. This is how my X_train looks like: array([list([1, 60, 2]), list([1, 6278, 14, 9137, 334, 9137, 8549, 1380, 7]), list([5, 107, 1, 2, 156]), ..., list([1, 2, 220, 41]), list([1, 2, 79, 137, 422, 877, 5, 230, 621, 18]), list([1, 11, 66, 1, 2, 9137, 175, 1, 6278, 5624, 1520])], …
I wanted to implement RNN on a dataset that contains a dependent and multiple independent features. I've used ANN and DT before to do so. However, RNN seems a lot more different and doesnt focus on these variables/features but rather just using a singular column to make predictions. So i was wondering, is it possible? or is there another Deep Learning algorithm i could use for this? thanks
How could I randomly split a data matrix and the corresponding label vector into a X_train, X_test, X_val, y_train, y_test, y_val for regression model with Keras or tensorflow..??? I have also added a picture where the data was splitter in three different classes. in each column the value of R (Coefficient of determination) is given. Please also let me know about how can i calculate this value of R in Keras/Tensor flow. Please help me in this regard.
I am getting 100% accuracy for the below models. can you please advise me where I am doing wrong? If it is due to overfitting then why other models like below do not over-fit the model. Attached same code for random forest from sklearn.ensemble import RandomForestClassifier rf = RandomForestClassifier(random_state = 1) kfold = StratifiedKFold(n_splits=10, shuffle=True, random_state=seed) cv_score = cross_val_score(rf, X_train, y_train.values.ravel(), cv=kfold) cv_score = cross_val_score(rf, X_train, y_train.values.ravel(), cv=kfold) rf_score = cv_score.mean() print('Random Forest K-fold Scores:') print(cv_score) print() print('Random Forest Average …
I have multiple vector fields in one collection. My use-case is to find similar sentences in similar contexts. The sentences and contexts are encoded to float vectors. Therefore, I have one vector for the sentence and another vector for the context (surrounding text). I would like take both vectors in consideration to find similar sentences. Unfortunately, most approximate nearest neighbor (ann) search libraries only support to search for one field. I have tried to use PostgreSQL with the cube extension …
I recently stumbled upon the Self-Organized Map - an ANN architecture used to cluster high dimensional data - while simultaneously imposing a neighborhood structure on it. It is trained through a competitive learning approach where neurons compete to respond to a given input. The strongest responding neuron / best matching unit (BMU) is rewarded by being moved closer to the given input in the data space, as well as its neighbors. However, within the literature and implementations, I find some …
I am using keras currently, and I want to see which inputs the model is "looking at". It would be like a saliency map, but my model is a simple two-layered perceptron for classification, so the input and ouput vectors are one dimensional. There is any library to do it easily? I don't quite understand the full programming of saliency maps.
I apologise if this is a bit long winded, but it was suggested by another user that I post. I will start by saying that I am very new to the world of machine learning and deep learning. As such, the most important thing I am after is the understanding of what I am doing. I am trying to build an ANN for binary classification. I have a binary feature matrix in the form of N x D, where N …
I am fitting a Keras model, using SGD Input dataset X_train has 55000 entries. Can anyone explain the yellow highlighted values? For me, when each epoch is done, this should correspond to 55000/55000. model = keras.models.Sequential() model.add(keras.layers.Flatten(input_shape=[28,28])) model.add(keras.layers.Dense(300, activation="relu")) model.add(keras.layers.Dense(100, activation="relu")) model.add(keras.layers.Dense(10, activation="softmax")) model.compile(loss="sparse_categorical_crossentropy", optimizer="sgd",metrics=["accuracy"]) history = model.fit(X_train , y_train, epochs=30 , validation_data=(X_valid, y_valid))
I am trying to use RFE with Artificial neural nets but I am getting the error that "'Sequential' object has no attribute '_get_tags'" . Here is my code snippet. Any help would be appreciated. model_2 = Sequential([ Dense(9, activation='linear'), Dense(200, activation=tf.keras.layers.LeakyReLU(alpha=0.3)), Dense(1, activation='linear'), ]) adam = keras.optimizers.Adam(lr=0.0001, beta_1=0.9, beta_2=0.999,epsilon=None, decay=0.0, amsgrad=False) model_2.compile(optimizer=adam,loss='mse',metrics=['accuracy']) rfe = RFE(model_2, n_features_to_select=5) pipeline = Pipeline(steps=[('s',rfe),('m',model_2)]) hist_2 = pipeline.fit(X2_train.iloc[:,10:20].values, y2_train.iloc[:,1].to_numpy(), m__batch_size=10, m__epochs=4000, m__validation_data=(X2_test.iloc[:,10:20].values, y2_test.iloc[:,1]))
I have a features extraction algorithm that works well to extract features from images. I want to develop an ANN to classify those images based on those features. I have extracted features in a csv file as columns and rows. I know we can use CNN to extract and classify images but my scerio is only the second half (features classification). Thanks
In the neural networks model, how many numbers of hidden units need to keep to get an optimal result, as per Cybenko theorem which demonstrates that only one hidden layer is sufficient to solve any regression/classification problem but the selection of the number of units in a hidden layer is very important because it impacts the model performance. Is there a theory to tell us how to choose the optimal number of units for a hidden layer?
I made an application that uses neural networks, its function is to classify the type of user that is, it can be legitimate or intrusive, the data was saved in the database, when I give it in the classify button it returns several results that vary a bit (70%, 75%, 76% ...), for all the classifications I use the same data but I get different results, is this normal? I used this library. this is the code for classification: const …