I have not been able to find a reliable solution for how to lookup the id for attachments in the media library from a filename as Wordpress does not appear to provide such a function. Most solutions rely on searching the GUID field in various tables, however there are issues with attachments uploaded with greater than 2560px resolution. Wordpress appends '-scaled' to the filename returned by functions like get_attached_file(), but this is not reflected in the guid database column. I'd …
I'm quite newbie in PHP and plugin development, and I think I'm missing something obvious but I dont know how to do it. When I activate my plugin (it adds some menu items), everything it's ok except I have to refresh the page to see those items, I that that items appers automatically when the plugin is activated. I have this to run on activation hook (do I have to add something inside that hook): Thanks //////// Run on activation …
I have a little more general question. My dataset consists of N sequences of events. Example of one sequence could be [A,B,C,D,X,Y] and another [A,B,Z], where letters represent different events. The sequences are at most 80 steps long. The idea is to predict next letter or next step from known previous events. For very simple example maybe after A will always come B. Next step would be measuring time of each event and the ultimate goal is to predict how …
I'm recently reading a paper about Scoring Mechanisms for Bayesian Networks. For the BDeu score, it appears that the maximum possible score of BDeu for Bayesian Network structure learning is zero. Does it mean that the best network is always the empty network?
I have a Custom Post Type of 'ITEM' that allows the admin to add an 'Item Number' using an ACF text field. In another Custom Post Type of 'GROUP' the admin can use an ACF Repeater to enter multiple 'Item Numbers' for 'ITEMS' to associate with this GROUP. I need the loop to show all posts that have an 'Item Number' that matches a number entered into the Repeater on the Group Page. I'm using get_posts() to query on a …
How to select a parent category and show the children to choose in another select? this is the code (parent taxonomy) <select> <option value=""><?php esc_html_e('Selecciona País', 'eltd-tours'); ?></option> <?php //Listado de taxonomias por país $tax_terms = get_terms(array( 'taxonomy' => 'tipo_pais', 'hide_empty' => false, 'hierarchical' => true, 'orderby' => 'parent', 'fields' => 'all', 'parent' => '0', ) ); foreach ($tax_terms as $tax_term) {?> <option value=""><?php echo $tax_term->name;?></option> <?php }?> </select> i need taxonomy child code, help please!
I'm working on an image segmentation algorithm with FCN (Long et al., 2015) as the backbone network. One idea I have is to use the argmax binary mask obtained from the final score layer (250x250x1) to generate some data (e.g. number of blobs in the mask) to modify the ground truth (e.g. set some pixels in the gt mask to 'ignore' labels) or in some way (partly) extract from the features (similar to RPN layer in FasterRCNN). Does this violate …
What is sentence embedding? How would you do sentence embedding for a sentence like: "How old are you?" How do you use word embedding to create a sentence embedding?
I followed many tutorial about leveraging browser caching nevertheless I couldn't configure it succesfully, in fact GTmetric (PageSpeed and YSlow) notified me many static file that don't have a cache expire header. That's my GTmetrix result (pagespeed): I tried to find the problem looking at compatibility test on W3TC and it notified me many Apache modules missed which are required for browser caching: I followed some tutorial to enable these modules but it seems they are alread enabled, in fact …
I'm puzzling to understand why the method of averaging word embeddings works in order to obtain sentence embedding, in particular considering the exercize of this post How to obtain vector representation of phrases using the embedding layer and do PCA with it. My current question actually is to understand the theory behind that more practical post. The answer to the question linked uses a method for sentence embedding that is averaging the word embeddings (in the most naive and simplest …
The company I work for has 300+ products on their website. I was able to grab all the published product post URLs on the site, because the permalink shared a common format: https://domain.com/product/[product-name] but I was hoping that I can also get the URLs for the post editor for each item. URL is https://domain.com/wp=admin/post.php?post=####&action=edit Is this possible? If so, how? When I tried searching this is the only thing I know that relates to what I'm trying to do but …
I have some data about maximum likelihood estimates. We have fields of estimate, standard error, pr>chiSq and Walk Square. I have no idea what the Walk Square is referring to - it feels like some measure of the distance, but it is not a term I have encountered before. any ideas?
I was searching for the best ways for feature selection in a regression problem & came across a post suggesting mutual info for regression, I tried the same on boston data set. The results were as follows: # feature selection f_selector = SelectKBest(score_func=mutual_info_regression, k='all') # learning relationship from training data f_selector.fit(X_train, y_train) # transform train input data X_train_fs = f_selector.transform(X_train) # transform test input data X_test_fs = f_selector.transform(X_test) The scores were as follows: Features Scores 12 LSTAT 0.651934 5 RM …
I am trying to figure out the delay between changing the speed of a pump that pumps a modifier into a process and the change in Amps drawn by an extruder at the end of the process. The amps drawn are changing constantly and are effected by other variables but the amps are held within a range by changing the speed of the modifier pump. Because the amps drawn are constantly changing you can't just look at the trend line …
I have a dataset with over 100 possible variable occurrences across 20 columns. At first glance this problem seemed to fit into hierarchical clustering. I started testing with Agglomerative Clustering, as described in scikit-learn documentation. It also mentions using a connectivity matrix, which is not available for this problem. However, in working with the stakeholder to increase my business understanding, I found that there is no "pathing" that occurs during the process, and that a hierarchical clustering is not appropriate. …
I'm working on 3d meshes dataset, i have to label it to train my deep learning model for a segmentation task like the picture shows. I spent days looking for a tool to label my 3d data but unfortunately i found nothing.. What tool i can use to label my data (3d mesh, .obj files) for segmentation task?
During backward pass, which gradients are kept and which gradients are discarded? Why are some gradients discarded? I know that forward pass is computing the output of the network given the inputs and computing the loss. Backward pass is computing the gradients for each weight loss.
I am trying to use a LSTM model to predict d+2 and d+3 closing prices. I am not sure whether I should normalize the data with a MixMax scaler (-1,+1) using the log return (P(n)-P(0))/P(0) for each sample I have tried quite a lot of source code from Github and they don't seem to converge on any technique.
How do I use a custom filed value in an external javascript? I'd like to use a custom field already stored for a post that is an url in an external javascript <script type='text/javascript' src='http://www.my-website.com/wp-content/themes/mytheme/js/scripts.js'></script> in order to open a new window onclick="window.open('MY_CUSTOM_FIELD_VALUE');" I tried to add global $post; $cf = get_post_meta( $post->ID, 'my_custom_field', true ); but it doesn't work. Thanks for your help.
I'm trying to create a neural network that finds the most effective treatment for each patient. I have a medical database for training. The inputs are histological and pathological data (mostly 0/1 data of having some diseases, conditions) and the outputs are the treatments. And there is an accuracy score, which is the patient's reaction to the treatment (this shows how good was the treatment for the symptoms, so how accurate was the input-output pair). How can I create a …
I am doing a tweet clustering using DBSCAN algorithm. I use all the preprocessing steps and convert sentences to vector format before applying the algorithm. However, It always puts a lot of tweets in to the '0' class. The following is the plot showing eps with number of clusters. The following are the parameters that I pass. dbscan = DBSCAN(eps=0.15, min_samples=2, metric='cosine').fit(x) The following are the resulting clusters. label -1 1221 0 1349 1 2 2 2 3 4 ... …
Please note I'm not posting this question without doing google search, but the problem is every single result I found is either about BuddyPress or WP Multisite, but I have a WP Single installation where I use Easy Digital Download and in terms to purchase anything user must have to register first. But the problem is their account doesn't get activated after registering if they visit customer dashboard it will show up that "Your account is not verified yet so …
I am using matplotlib to generate a filled contour plot, please consider the below example as a sample contour plot. I want to read off the contour values from such a filled contour plot using opencv's mouse interaction modules. For example, if the uses hovers the mouse over this contour image, it should dynamically display the contour values as the mouse moves over the image. I have the opencv part figured out, but I am struggling to link the RGB …
I am training a regression model for crypto prediction and the model is not learning. When I train my model over say the period of 01-01-2021 till 01-01-2022 and I split the dataset into a train and validation dataset (with shuffle enabled) the learning goes very well. Yet this approach performs bad when evaluating other time periods. So now I use different periods for the training and validation data. Since this different approach the model does not learn anymore. The …
I have a site with a page where there's one form in the sidebar, and one in the main body of the page. The sidebar comes first in the HTML. Both forms have their own nonces (generated with wp_nonce_field) with different $action and $name parameters. The $referrer fields are on. When I submit the second form, I get the usual "Are you sure you want to do this?" message. If I remove the first form, things work correctly. I added …
I have a dataset composed of few features : customerId, actionDay1, SalesDay1, actionDay20, SalesDay20, actionDay30, SalesDay30 action can be : call email face 2 face nothing sales : amount of sales in $ my goal here is to predict the best action we have to take in any day (1, 20 or 30) to sale more. some customer prefers email, some prefer to be called every time, some others prefer to not be contacted to buy. the pattern is different …
I'm using Flatesome theme and I have a use case that I need to refresh the page after closing the popup, I'm wondering if I can change the behavior of the close button in Lightbox Popup so instead of closing the popup only I want it also to reload the page, This will be the best solution for my need and if it's not possible to do it this way, Can I change the whole function of the close button …
I'm working on a client's website and they are not getting messages from the site anymore. I've found that no mail will go to an email address ending in @gmail.com, I can send mail just fine to anyone within my company that has an email with a custom domain. But a Gmail inbox the messages never even seem to make get close. They're not in spam, not in promotions, nowhere. I've installed WP mail log, and see no errors on …
This may be a dumb question but I can't figure out how to actually get the values imputed using StatsModels MICE back into my data. I have a dataframe (dfLocal) with hourly temperature records for five neighboring stations (LOC1:LOC5) over many years and I'd like to impute the missing data for any given site. Following the examples I have: imp = mice.MICEData(dfLocal) fml = 'LOC1 ~ LOC2 + LOC3 + LOC4 + LOC5' mice = mice.MICE(fml, sm.OLS, imp) results = …
I have a custom post type 'books' which I store different custom fields of information about books. I want to use posts and link the posts I write (in categories such as news, or offers) to the books. For example, when the user is viewing the book information page, I want to be able to display all the posts in news category related to that book. I was able to do this using a custom field and assigning the book …
I am hooking into comment_form_default_fields doing some heavy string replacements. There are translated strings like __( 'Name' ) in there. I need the text. I have two or three different ways to solve this. I could just use my own text domain, but that would mean I have to provide my own translation for my code, do not like that. Especially because I just reuse already translated strings. Extract the text (with regex). Better but not a huge fan either. …
struggling as well with custom url rewriting for custom post type taxonomies. Here is my requirement: domain/mycpt_category/postname/ It's well documented here and in several SE threads removing the CPT basename so that the resulting permalink is: domain/postname/ And I am able to construct the permalink such as: domain/cpt-basename/cpt_category/postname (following this solution ) What I am really trying to achieve is removing the custom post type slug but keep its related taxonomy category so my link would be: domain/mycpt_category/postname/ Thanks for …
UMAP is both faster and captures the global structure better than t-SNE when visualizing high-dimensional data. Is there ever a situation where you would pick t-SNE over UMAP?
I have a plugin with several CPTs (we'll call them CPT-A, CPT-B, CPT-C, and CPT-D). All CPTs have custom fields. In CPT-D, the user is able to make a selection and assign a post in CPT-A, CPT-B, and CPT-C to the current post in CPT-D. Basically linking relevant records to each other. If the post in CPT-A, CPT-B, and/or CPT-C does not yet exist, the user can "quickly" create the post by entering the post's title using a standard text …
I am using LSTM (Long Short Term Memory) to predict the Apple Stock Closing prices using the 3 previous days. My problem is that the model underestimate closing prices. The photo of the final result is given at the end of this passage. First of all, I have a very highly left skewed data set of Apple stocks as can be seen from the photo below. I used a LSTM model to predict the closing prices using 3 previous days …
I am working on a plugin and on the settings page I have 2 settings and I want to show Only one setting "backgroundColor" so how should i do that? This is the code: <form action="options.php" method="post"> <?php settings_errors(); settings_fields( 'bg_color' ); **<<< I want only background settings to show how i can do it correclty?** do_settings_sections( 'plugin-style' ); submit_button( __('Save settings', 'trans') ); ?> </form> /* Add Settings Field for Background Color */ add_settings_field( 'background-color', __('Background Color', 'trans'), 'plugin_background_color_ca', …