How to improve regression neural network?

I am new to deep learning and data science and trying to increase my knowledge by working on some hackathons. Currently, the hackathon project I am working on has the task to predict the closing price of crypto-currency based on 48 parameters with ~1200 records. By far I was able to achieve some good accuracy from the model but still, my score is very low. I have tried many things from knowledge but it doesn't seem to be affecting the …
Category: Data Science

What's the good index to choose number of clusters so that obtained clusters are homogeneous?

I perform a clustering on one-dimensional dataset and I need a way to automatically decide what's the optimal number of clusters from $k \in \{2, 3, 4, 5, 6\}$. The number of observations to cluster is low (usually around 10-13). I think I'd need to check optimising for one of two goals (or both at the same time) and see what works best: to achieve partitioning with the lowest within-cluster variances. Intuitively, I would go for something like average within-cluster …
Category: Data Science

Run search query again without pagination gives no results?

Update: This question isn't really relevant anymore. I switched some code, so now the filtering works. Looks like the query wasn't working, because I triggered the indexTaxonomyCounts function from a template? But I now have another problem, but will write a different question for that. Original question: I want to filter my custom products by some taxonomy and meta filters. This works for regular queries, but not for my search results. At least, the filtering works, but getting the right …
Category: Web

after augmentation validation accuracy going down?

My main question is about augmentation. if I process the augmentation I believe it always better than less data but in my case the validation accuracy going down train : 7000 images , validation: 3000 images : validation accuracy:0.89 train : 40000 images , validation: 17990 images : validation accuracy:0.85 my augmentation code def data_augmentation_folder(trainImagesPath,saveDir): #X_train=load_training_data(trainImagesPath,"train") print("=====================================================") X_train = cleanData(trainImagesPath) X_train = np.array(X_train) print(X_train[0].shape) for i in range(5): #print(i) datagen = ImageDataGenerator(rotation_range=15, width_shift_range=0.1, height_shift_range=0.1, shear_range=0.01, zoom_range=[0.9, 1.25], horizontal_flip=True, vertical_flip=False, fill_mode='reflect', …
Category: Data Science

wp_nav_menu seems to be printing the wrong menu

I'm learning WordPress and I'm can't understand what I'm doing wrong with a theme I'm creating. Here is how I create my menus in the functions.php file function my_custom_theme_setup() { add_theme_support('menus'); register_nav_menu('header', 'Menu that goes in the header of the website'); register_nav_menu('footer', 'Menu that goes in the footer of the website'); } add_action('init', 'my_custom_theme_setup'); And here is how I insert it the header.php: <?php wp_nav_menu(array('menu' => 'header','menu_class' => 'header__nav'));?> Here is how I configured the menu in the admin interface: …
Category: Web

Keras LSTM model not performant

I have trained a LSTM model to detect fake domain names. My dataset is like this: domain,fake google, 0 bezqcuoqzcjloc,1 ... with 50% normal and 50% fake domain names. Here's my code to train the LSTM: def build_model(max_features, maxlen): """Build LSTM model""" model = Sequential() model.add(Embedding(max_features, 128, input_length=maxlen)) model.add(LSTM(128)) model.add(Dropout(0.5)) model.add(Dense(1)) model.add(Activation('sigmoid')) model.compile(loss='binary_crossentropy', optimizer='rmsprop') return model def run(max_epoch=25, nfolds=10, batch_size=128): """Run train/test on logistic regression model""" indata = data.get_data() # Extract data and labels X = [x[1] for x in …
Topic: lstm keras python
Category: Data Science

Create a stored procedure on plugin activation

I want to know that is it possible to fire a stored procedure once the plugin is activated? //action hook for plugin activation register_activation_hook( __FILE__, 'my_func' ); //function to create stored procedure function my_func() { //code goes here to create a stored procedure } Any help would be appreciated. Thank you.
Topic: wpdb Wordpress
Category: Web

Attention network without hidden state?

I was wondering how useful the encoder's hidden state is for an attention network. When I looked into the structure of an attention model, this is what I found a model generally looks like: x: Input. h: Encoder's hidden state which feeds forward to the next encoder's hidden state. s: Decoder's hidden state which has a weighted sum of all the encoder's hidden states as input and feeds forward to the next decoder's hidden state. y: Output. With a process …
Category: Data Science

WP adding noopener and noreferrer to all links

I'm using Classic Editor (not Gutenberg) and WP is adding rel="noopener noreferrer" to ALL the links, whether it is target="" or target="_blank" or target="_self"! I want to remove noreferrer from my affiliate links - please help! Thank you!
Category: Web

Need to delete a wordpress website from Cpanel

I am a Maker. I am new to wordpress.com. I have registered a domain like example.com with the help of bluehost. I have got access to cpanel. There I installed wordpress for example.com/wp instead of example.com. Now my webpage is displayed on net as example.com/wp. I want to uninstall and re-install wordpress again for example.com/. I want all the old stuff/files to be purged (There is no data on the website as of now). Can anyone help me for this? …
Category: Web

Which metrics for evaluating a recommender system with implicit data?

I am currently in the process of creating a recommender system. This recommender system works with a neural network and then searches for the closest neighbors and thus gives recommendations for a user. The data is implicit. I only have in the data which products a user has bought.On the basis of this data, I create the recommendations. What are the best metrics to evaluate this recommender system with implicit data? Can I evaluate the model and then the search …
Category: Data Science

Display custom image field in user profile

I am trying to display user info from acf so far the normal text, radio and select and date fields display if I use the following: <?php $current_user = wp_get_current_user(); echo $current_user->user_gender; ?> I have created 2 image custom fields one of each I would like to use as an avatar. Ho do I get the images to display if the custom field name is user_banner and user_avatar. the fields are custom fields from acf are user_banner and user_avatar. Here's …
Category: Web

Predict continuous variable based on categorical columns mostly

I have a large dataset (40 mil rows, 50 columns) with mostly categorical columns (some of them are numerical) and I am using Python/Pandas. Categorical columns have up to 3000 unique labels. I am looking for best practices on how to approach this. Obviously one-hot encoding (OHE) as it is is out of question. I have tried to make smaller number of categories and do OHE in that way but the model was very bad, a lot of information is …
Category: Data Science

Use admin-post to submit form data to external database

I am creating a custom form in WordPress to store and send data to an external database. As part of testing, I was successful in creating a form that submitted form data to the external database by having the form refer back to itself upon clicking the submit button. I now would like to leverage WordPress admin-post functionality instead of having the form refer back to itself. I have set up the action hook correctly as I see the $_POST …
Category: Web

Can absolute or relative contributions from X be calculated for a multiplicative model? $\log{ y}$ ~ $\log {x_1} + \log{x_2}$

(How) can absolute or relative contributions be calculated for a multiplicative (log-log) model? Relative contributions from a linear (additive) model E.g., there are 3 contributors to $y$ (given by the three additive terms): $$y = \beta_1 x_{1} + \beta_2 x_{2} + \alpha$$ In this case, I would interpret the absolute contribution of $x_1$ to $y$ to be $\beta_1 x_{1}$, and the relative contribution of $x_1$ to $y$ to be: $$\frac{\beta_1 x_{1}}{y}$$ (assuming everything is positive) Relative contributions from a log-log …
Category: Data Science

WordPress Auto Login From Email Link

I am creating a membership site where I am trying to login a particular user from a link sent to their email address. I have a custom post typed called "Members", where I have stored a unique key with the name "user_key". After a particular process, the email is sent to that user with an auto login link. An example link looks like the following http://example.com/process/?key=DcP2K7cmBUrLVRjizs78RAuuoMGRFc6F6TMDm6E6 Process is the page which handles the login part. Here is the code used …
Category: Web

Sort by date, then by time

We have "events" that are specific dates, so the page is set to put the events based on the day of the event first - then they should be sorted by the time the event takes place. The dates are fine -- all the proper events are under the proper dates. But the times are not consistent. About 80% of them are correct but every once in a while one falls out of place....so I may see something like this: …
Category: Web

R Studio - grepl compare a column in a dataframe to a list of pattern

I have a column named "MATCH" in a dataframe and a list of patterns named "PATTERN". df1.MATCH <- c("ABC", "abc" ,"BCD") df1 <- as.data.frame(df1.MATCH) df2.PATTERN <- c("ABC", "abc", "ABC abc") I want to use grepl to compare MATCH column with PATTERN, if true, I will apply my functions. The desired result would be "ABC" matches "ABC" and "ABC abc". This is the code I used: df1 %>% filter(grepl(df1.MATCH,df2.PATTERN ))%>% ... I get error: "Warning message: In grepl(TXN_GROUP, parm[3]) :argument 'pattern' …
Topic: regex r
Category: Data Science

Redirect based on referer using Advanced Custom Fields

Im currently trying to protect some WP pages by assigning a specific template to them. Ive created the ACF fields "Referring URL" and "Redirect URL", as these could alter depending which page the template is assigned to. What changes would be needed to have the template functionality go: IF referer is not "referring_url" redirect to "redirect_url" Id like there to be no caching taking place either However, the code below, placed just below get_header();, doesn't seem to work consistently, either …
Category: Web

How do I create a dataset from many CSV files that is too large for RAM

I have been handed about 40 GB of CSV files that I need to turn into a database. The files are arranged in a file structure that uses location in that file structure to create a relationship between the different CSV files. /base - ancillary_information.csv - /Run1 - /Scenario A one.csv two.csv ... - /Scenario B one.csv ... - /Run2 - /Scenario C one.csv ... - /Scenario D one.csv ... - /Run3 ... Each CSV file is for a single …
Category: Data Science

Install a MU plugin from within another plugin

I am writing a plugin that needs to disable another plugin on specific pages of the site. I know how to do this using the option_active_plugins filter, but that filter only works from an MU plugin. So is it possible to programatically install a MU plugin from my main plugin so that I can run this filter? Or is there another way to tackle this?
Category: Web

Adding thumbnail to search results & changing content.php

Looking to discover how to alter my content.php code to add the thumbnail image of the specific posts to my search results located here for example: https://divesummit.com/?s=suunto&submit=Search I would like a thumbnail of the featured post’s image listed along with the smaller blurb of the post in the search results. <?php get_template_part( 'content', get_post_format() ); ?> by somehow changing content.php I can have it include a small thumbnail along with each search result. My theme already has thumb support I …
Category: Web

Dealing with multiple distinct-value categorical variables

So, I've got a dataset with almost all of its columns are categorical variables. Problem is that most of the categorical variables have so many distinct values. For instance, one column have more than one million unique value, it's an IP address column in case anyone is interested. Someone suggested to split it into multiple other columns using domain knowledge, so split it to Network Class type, Host type and so on. However wouldn't that make my dataset lose some …
Category: Data Science

How to choose max layers and units to search over in hyper parameter tuning

When performing any hyper parameter tuning, let's say random search for simplicity, and I want to search over a minimum to max units/nodes in a layer, and a minimum to max number of layers, are there rules to guide what is a "large enough" number for my search? Currently all I know is "that should be good enough/large enough, let's search in there". I could be not searching a large enough space, or searching a space that's far too large …
Category: Data Science

How best to embed large and noisy documents

I have a large corpus of documents (web pages) collected from various sites of around 10k-30k chars each, I am processing them to extract relevant text as much as possible, but they are never perfect. Right now I creating a doc for each page, processing it with TFIDF and then creating a dense feature vector using UMAP. My final goal is to really pick out the differences in the articles, for similarity analysis, clustering and classification - however at this …
Category: Data Science

Most common Machine Learning/ Natural Language Processing projects developed for/in businesses

I currently work as a data scientist developing software that classifies PDF documents into certain categories, using Machine Learning models with Natural Language Processing methods. I am thinking about finding a certain niche or specialization to work in either full time or as a freelancer. I have some idea where Machine Learning (and Natural Language Processing) are being used in in actual businesses, for example Chatbots, Product Recommendation, etc., however i would like to know: What kind of Machine Learning …
Topic: career
Category: Data Science

Hook into all password resets in Wordpress and get password before hashing?

I'm syncing my Wordpress authentication system with an secondary/external authentication system and my site has at least two ways of resetting the password, including: Password reset email User account screen password reset There may be some third way I'm not recalling, as I've disallowed password resets thus far due to my inability to sync the systems. The crux of my question: How can I hook into the password reset prior to hashing so that I can simultaneously set the new …
Category: Web

Is it possible to make a label automatically in supervised learning(Machine Learning)?

My background knowledge: Basically, supervised learning is based on labeled data. Using the labeled data, the machine can study and determine results for unlabeled data. To do that, for example, if we handle picture issue, manpower is essentially needed to cut raw photo, label on the photos, and scan on the server for fundamental labeled data. I know it sounds weird, but i'm just curious if there are any algorithms/system to make a label automatically for supervised learning.
Category: Data Science

How to compute sentence embedding from word2vec model?

I am new to NLP and I'm trying to perform embedding for a clustering problem. I have created the word2vec model using Python's gensim library, but I am wondering the following: The word2vec model embeds the words to vectors of size vector_size. However, in further steps of the clustering approach, I realised I was clustering based on single words instead of the sentences I had in my dataset at the beginning. Let's say my vocabulary is composed of the two …
Category: Data Science

Changing labels of status filters for post grid

Is there a way to change filter labels for custom post type? For example, change Drafts (2) to Disabled (2) without localization plugins like Loco Translate? I've tried apply_filters( "views_{$this->screen->id}", $views ); filter, but array already contains links with html. Regex doesn't looks "the right way". Array ( [all] => <a href="edit.php?post_type=sha-wlc" class="current" aria-current="page">All <span class="count">(13)</span></a> [publish] => <a href="edit.php?post_status=publish&post_type=sha-wlc">Published <span class="count">(11)</span></a> [draft] => <a href="edit.php?post_status=draft&post_type=sha-wlc">Drafts <span class="count">(2)</span></a> [trash] => <a href="edit.php?post_status=trash&post_type=sha-wlc">Trash <span class="count">(1)</span></a> )
Category: Web

Can't find out why dbDelta dosen't create my table

I have a function which needs to create a new table an d i can't see for the life of me why it dosen't create the table: function afdv_create_delivery_table ( $id ){ global $wpdb; $charset_collate = $wpdb->get_charset_collate(); //table name composed of db prefix + delivery + company ID $table_name = $wpdb->prefix . "delivery_" . $id; $sql = "CREATE TABLE $table_name ( id int(10) unsigned NOT NULL AUTO_INCREMENT, userId int(10) NOT NULL, plati DECIMAL(10,2) NOT NULL, incasariCash DECIMAL(10,2) NOT NULL, incasariPvo …
Category: Web

How to get the parameters on page and avoid 404?

I have a page like http://example.com/mypage and I want to set some $_GET parameter like that: http://example.com/mypage/firstparameter/firstvalue I need firstparameter value but I always end in the 404 page. I've spent some hours with get_query_var(), add_query_vars_filter() and add_rewrite_rule() but no way... Thank you
Category: Web

Downsampling audio files for use in Machine Learning

I'm trying to use the work (Neural Networks) done in this repo: https://github.com/jtkim-kaist/VAD It says this: Note: To apply this toolkit to other speech data, the speech data should be sampled with 16kHz sampling frequency. I've got speech data at 48khz. I've read in places that reducing sampling rate is a complicated process, you can't just remove every nth datapoint, you have to filter things... Is this necessary if I only intend to use the data in the Neural Network …
Category: Data Science

Training data in sentiment analysis

I'm doing sentiment analysis of tweets related to recent acquisition of Twitter by Elon Musk. I have a corpus of 10 000 tweets and I'd like to use machine learning methods using models like SVM and Linear Regression. My question is, when I want to train the models, do I have to manually tag big portion of those 10 000 collected tweets with either positive or negative class to train the model correctly or can I use some other dataset …
Category: Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.