I have a custom contact form page that I am trying to add an upload field that validates filesize and filetype. Before adding the validation everything worked. <?php /* Template Name: Contact-Page-with-upload * * A Custom PHP Contact us page. Add or change form fields on line 28 and in the form itself. * Jquery is used to add/remove Bootstrap has-error class to invalid fields. */ /** * Get Error Class * * @return string; */ function getErrorClass($failedKeys, $key) { …
I am building a model to recommend logistic providers to merchants on an e-commerce platform. There are approx. 100k merchants and 20 logistic providers, so scaling is not very important here. Currently, everytime a customer makes a purchase from a merchant, the merchant will need to select a merchant from the list of 20 to ship the goods to the user. Some merchants always choose the cheapest shipping options, while some have their own personal preferences. The location of the …
I am attempting to learn PHP by creating a relatively simple application built on wordpress, it is a basic CRM and I've made decent progress but have been stuck on some of the finer points. I've been having some serious 'headers already sent' problems with getting wp_redirect() working after a user creates a new customer. Here is an example of what I want to do: /new-customer.php : Create a new Custom Post Type via the front end and then redirect …
Are entropy and cross-entropy the same thing as per basic definition? If there is a difference: Decision tree splits take on entropy or Gini index, can we use cross-entropy to split decision trees? OR should I use it as an evaluation metric after running the decision tree algorithm? Also, does the decision tree algorithm assumes any distribution? If yes, then how can we use the KL Divergence metric? I am just trying to link a few concepts in a broader …
I am currently trying to do a directory style site, and I currently have parent categories and child categories. Right now, I have the parent categories showing and when a parent category link is clicked I'm using category.php to show the list of child categories. Now I want to that when a child category link is clicked WordPress shows all the posts in this child category. Is there a conditional statement or a way that I can have the child …
I'm running a test on MapReduce algorithm in different environments, like Hadoop and MongoDB, and using different types of data. What are the different methods or techniques to find out the execution time of a query. If I'm inserting a huge amount of data, consider it to be 2-3GB, what are the methods to find out the time for the process to be completed.
I am looking to design a custom loss function for Keras model. The model itself is neural network that accepts a set of images and is supposed to run a regression to get an output, which is a value. Due to the physical conditions of the problem, I need to add a regularization term which would calculate the $cos(y_{pred})*f(X_i)$, where $y_{pred}$ is the output of the neural network, $X_i$ is the training example used to calculate $y_{pred}$, $f$ is some …
I have this script that cuts down my menu and adds a "+" dropdown if there are too many menu items in an attempt to prettify long menus, as such: Without the script running: Which I call in functions.php with: function _s_scripts() { wp_enqueue_script( 'main', get_template_directory_uri() . '/js/main_res.js', array( 'jquery' ), '', false ); } add_action( 'wp_enqueue_scripts', '_s_scripts' ); Unfortunately, this results in late-execution and jagginess. Is there any way I can hook this script into "as soon as you're …
I'm still a bit new to deep learning. What I'm still struggling, is what is the best practice in re-training a good model over time? I've trained a deep model for my binary classification problem (fire vs non-fire) in Keras. I have 4K fire images and 8K non-fire images (they are video frames). I train with 0.2/0.8 validation/training split. Now I test it on some videos, and I found some false positives. I add those to my negative (non-fire) set, …
i have a lab to find a cause-effect relationship between 2 columns of a data. First i want to ask: causation is correlation, i mean that causation is subset of correlation. I ask this cause i saw first we need to find what's columns have correlation with the other to find will these have cause-effect relationship. Will 2 columns have no correlation have Causation? Second, go into real data. i use covid data from link and crawl it day by …
There are already few questions on this topic but they are not helping my problem. So what I want to achieve is dynamic CPT permalink structure based on the ACF (radio) value. // _cb stands for checkbox radio_acf_cb = foo radio_acf_cb = bar Depending on what's the user's choice the permalink would look like this // fixed_word is the first part of the permalink which will be static // foo/bar are the values based on the choice from the ACF …
I am a newbie here, but I am trying to work with a dataset which gives the attempt at the goal by a footballer,which will predict one of 2 possible outputs - whether or not they could score the goal or not. I have done some basic cleaning but I am still getting only 60% accuracy on whatever classifier I use from sklearn. I have removed a few features which I thought would not contribute to the 'y' value, and …
A classifieds list site have only 3 criterias when searching products: the common search, category and region (for ZIP, city or full address) It's not enough and I really need to include a basic price system, so users can set a price range before searching. Looking at the theme files, I found the function for different queries, based in one or more of those criterias. The smaller is the query for only category, so I'll take it as example: elseif …
This is the starter challenge, Titanic. The original question I posted on Kaggle is here. However, nobody really gives any insightful advice so I am turning to the powerful Stackoverflow community. Based on this Notebook, we can download the ground truth for this challenge and get a perfect score. I tested it and it does give me 100% on LB for the purpose of confirming it is the ground truth as it claims. (side question here: how do I remove …
Which HTML is better, pre-Gutenberg or post-Gutenberg? I imported post content from an old and large WP site into a fresh install and new database. Almost 1200 posts along with their meta and related media. The xml file is 15mb. I used the standard wordpress import/export along with a media export [plugin][1] for featured images. The origin site uses tinymce advanced to maintain the classic editor look for the client. Most everything carried over, but in the new setup, the …
Can anyone recommend an alternative to the big 3 cloud computing alternatives? I know they're the best but I found them overly complicated because they cater to massive enterprises. The amount of set up required just to get an instance running is too much. I am looking for a multi GPU cloud offering which offers RAPIDS pre-installed. I see that Blazing SQL will have an offering soon, does anyone know of anything else that I could use in the mean …
I have posts that have video content and these videos stored in database like this (serialized) a:1:{s:9:"video_url";s:0:"";} This serialized data have post video urls but can not get this data. I used <?php echo get_post_meta(get_the_ID(), '_custom_field', TRUE); ?> But this get_post_meta display output "array" instead of video urls
Okay, I have this strange issue with my WordPress blog since two days. The website works perfectly fine on my office network (Wi-Fi), I'm able to login to the dashboard either via laptop or mobile and post the content. But, when I come back home and try to login, the wp-admin page shows ERR_CONNECTION_TIMED_OUT error, or sometimes redirects to login.php page and shows 404 Not Found error. I contacted my host and they say there's no problem with the servers. …
So basically my question is hypothetically lets say: I have a column containing 2000 rows of texts, and when I apply tf-idf, I get 27 features like shown below. Now once I do that, I could consider my Neural Network's Input layer's number of neurons to be 27, like shown below, and i train the model with the tf-idf features. Now, hypothetically speaking, if I'm trying to test this model with one string (a short string), and when we apply …
Maybe a weird question but: Currently, I'm writing a seminar paper about Self Supervised Learning for time series data. For this paper, I have to find methods to prepare unlabelled time series data with SSL techniques to perform a classification task. In a scientific paper, I was able to find time series representation learning methods. Another SSL paper used one of those methods to do the classification on a specific dataset. Now I have to admit that I'm kind of …
Is it possible to do hard-coded decision tree on some variables and random forest / something on the remaining ones? The situation seems that for some variables it's possible to draw strong empirical assumptions, but for others their "relative importance" seems more random. So e.g. Researcher is certain that splitting X1 > 5 and X2 < 3 gives best information, since they are empirically sound splits e.g. based on stakeholder views. And X1, X2 are more important than X3, X4, …
I have some custom attributes for each product in woocommerce, I can edit them at the Attributes tab. I can also read them using this code $product = new WC_Product($product_id); $v = $product->get_attribute('myattr_name'); But I don't understand how to set this attribute value. Googling not helps. Do you know? I am looking for something like this $product->set_attribute('myattr_name', $new_value); But as I can see, there is no such method.
I have a dataset with the ID, name, joining date, leaving date as features. I was asked to measure employee retention and health of it. What can I derive from these? What are some latest trends and examples which I can find relating these? Thanks. I know this is a discussion, but given that I couldn't find this on google search, it would be helpful for someone.
I have a custom post type "people". For each person, I can enter the following custom fields: "address", "occupation" and "pictures". In the single-people.php I display the address and the occupation. In addition, this single template contains a gallery button - when the website user clicks on it I want to takes the user to a separate page where only the pictures of the person he just looked at are displayed. How do I achieve that? I cannot just create …
WordPress 5.9 Users trying to access the homepage when the session expires, are sent to re-authenticate. The behavior seems weird since it only applies to the homepage. Users with expired sessions can access all other pages without being asked to re-authenticate. Why is the behavior inconsistent, and how can users with expired sessions not be redirected to re-authenticate?
Asking question in datascience forum, as this forum seems well suited for data science related questions: https://stackoverflow.com/questions/55158554/how-transformer-is-bidirectional-machine-learning/55158766?noredirect=1#comment97066160_55158766 I am coming from Google BERT context (Bidirectional Encoder representations from Transformers). I have gone through architecture and codes. People say this is bidirectional by nature. To make it unidirectional attention some mask is to be applied. Basically a transformer takes key, values and queries as input; uses encoder decoder architecture; and applies attention to these keys, queries and values. What I understood …
Whenever I lemmatize a compound word in English or German, I obtain a result that ignores the compound structure, e.g. for 'sidekicks' the NLTK WordNet lemmatizer returns 'sidekick', for 'Eisenbahnfahrer' the result of the NLTK German Snowball lemmatizer is 'eisenbahnfahr'. What I need, however, is something that would extract the primary components out of compound words: ['side', 'kick'] and, especially, ['eisen', 'bahn', 'fahr'] (or 'fahren' or in whatever form for the last item). I am especially interested in segmentizing compound …
I am getting a new laptop, the best laptop (or at least on paper) that I saw is using amd cpu and gpu. I heard that amd doesn't work well with tensorflow, curious if this is true, if is true is there any other important libraries in python that it doesn't work well with?
I wish to add a class to a specific item of my primary menu. I'm using this: function hideMenuItem ( $atts, $item, $args ) { $commerce = get_field('ecommerce', 'option'); if (!$commerce){ $menu_items = array(566,567, 363, 364 ); if (in_array($item->ID, $menu_items)) { $atts['class'] = 'hidden'; } return $atts; }else{ $menu_items = array(566,567); if (in_array($item->ID, $menu_items)) { $atts['class'] = 'visible'; } return $atts; } } add_filter( 'nav_menu_link_attributes', 'hideMenuItem', 10, 3 ); It's working only on the li link but I wish to …
I am making my classification project and I have this situation after using seaborn heatmap. Column 0 is my target, where I have data with 3 classes. To my knowledge I should remove column highly correlated with target value. My questions are: Should I remove also features highly correlated with features different than target? For example I can see very high correlation between column 27 and 46. Should I remove one of them? This is correlation heat map from my …
I am using several pre-trained models to solve my problem. These models are VGG-16, Resnet-101, Inception-ResNet-v2, Densenet-201, and Xception. Xception has outperformed all of these models; is it possible to justify why this model has outperformed the rest? Or the reason is the hyper-parameter configuration of Xception is the best for my problem? Note I have used the same optimizer, batch size, etc. for all the models.
I am working on a dataset of ATP (Association of Tennis Professionals - men only) tennis games over several years. I want to predict the outcome of tennis so one way to do that is using a Bradley-Terry model which is a probability model I am asking about how to do feature selection or feature engineering( I am not talking about domain knowledge FE) or preprocessing that must be applied before training the model
I want to add Segment to my WordPress site. I read the best way to do this is to edit functions.php and use wp_enqueue_scripts I've replaced my tracking code with "test" This is the segment code: <script> !function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="4.0.0"; analytics.load("TEST"); analytics.page(); }}(); </script>
I have a question regarding BATCH_SIZE on multi-class classification task with imbalanced data. I have 5 classes and a small dataset of around 5000 examples. I have watched G. Hinton's lectures on Deep Learning and he states that each mini batch should ideally be balanced (meaning each batch should contain approximately same number of data points for each class). This can be approximated by shuffling data and then drawing random batch from it. But, in my mind this will only …