I have Wordpress menus that is seems are put together in the backend somehow. I used wp_nav_menu() to customize the wrap of the menu items slightly. My issue is I have found no direct access to access the menu items, and add a custom field to them. They are all categories, and I want a specific icon for each category. This is my code in the functions.php to customize the menu: function custom_novice_menu($args) { $args['container'] = false; $args['container_id'] = 'my_primary_menu'; …
I am looking for a way to test the performance of an object removal program I am looking for a dataset (images or videos) that is made up of realistic 3D objects added to real footage. There must be a version before the object was added as well as after the object was added, so I can compare the results. Also, I would need the true mask of the object that has been added.
I have 2 dataframes, df1,and df2 as below. df1 and df2 I would like to lookup "result" from df1 and fill into df2 by "Mode" as below format. Note "Mode" has become my column names and the results have been filled into corresponding columns. also note that "ID" from df2 may not necessary equal to "ID" from df1.For example, I am only interested in 4 IDs (A01,A03,A04 and A05, no A02) while df1 may contain more IDs I tried to …
let immagine that I have 3 points and they are all on a sloped straigh line such as (-4, -2) (0,0) (2,1) this is straight line passing from the origin. Intuitevely pca2 would be 0 as I have not up spread in the data. And PCA1 would be the max variance of the data on the line. Is my intuition correct for pca2 = 0? is there any intuitive way to calculate PCA1 for this case scenario?
I'm following this article about Unsupervised Anomaly Detection Algorithms. In this article, a threshold value is calculated using the scipy score percentile method to determine whether the point is an outlier or not. What is the connection between percentile value and threshold and how can we decide if a point is an outlier or not using a threshold value?
I can't access the dashboard of the second site. When I go to the second site, I only see the HTML page without the style (css). When I try to access the dashboard (from Safari), I get this message from the browser: "too many redirects occurred trying to open". Subsite set-up example.com (works) example.com/secondary (doesn't work) I tried disabling all plugins and change to the default theme. It still doesn't work. Here's what in my .htaccess file: # BEGIN WordPress …
I have created a custom post type. There is no issue with post and it's working. I am getting issue in the catgory links. When i click on the Category name it's redirecting on 404 page I am getting category link like https://example.co/blog/categoryname/ I have tried to reset the peramlink but still getting issues. function create_blog_cpt() { $labels = array( 'name' => _x( 'blogs', 'Post Type General Name', 'blogsdomain' ), 'singular_name' => _x( 'blog', 'Post Type Singular Name', 'blogsdomain' ), …
Trying to use this code in function.php, but not working.. Any idea whats wrong? // To change the amount of days just change '-7 days' to your liking function get_unpaid_submitted() { global $wpdb; $unpaid_submitted = $wpdb->get_col( $wpdb->prepare( " SELECT posts.ID FROM {$wpdb->posts} AS posts WHERE posts.post_status = 'wc-processing' AND posts.post_date < %s ", date( 'Y-m-d H:i:s', strtotime('-14 days') ) ) ); return $unpaid_submitted; } // This excludes check payment type. function wc_cancel_unpaid_submitted() { $unpaid_submit = get_unpaid_submitted(); if ( $unpaid_submit ) …
I have a multi-class problem that I am building a classifier for. I have N total data points I would like to predict on. If I instead predict on n < N data points and get an accuracy score, is there a way I can say (with some degree of confidence) what I think the same model's accuracy score would be on the remaining data points? Can somebody point me to an article discussing this, or suggest a formula to …
This Keras article / tutorial here does perform text standardization i.e removing HTML elements, punctuation, etc. from the text dataset, however, there is a distinct lack of any stemming or lemmatization before the vectorization step. I have a bit of experience in deep learning but I am very new to NLP, and I just got to know (from a different tutorial on Udemy, which BTW was using Bag of Words) that using either a Stemmer or a Lemmatizer helps in …
Specifically what I am looking for are tools with some functionality, which is specific to feature engineering. I would like to be able to easily smooth, visualize, fill gaps, etc. Something similar to MS Excel, but that has R as the underlying language instead of VB.
I'm trying to remove product image (one at a time) using WooCommerce API but I'm facing a strange problem. I can remove all associated image at once by sending an empty array in images: { images:[] } But I can't find a way to remove one image at a time.
I've heard about time-series classification being done with TCN's and CNN's combined with LSTM's very often, citing that CNN's would provide insight both forward and in the past since you already have all the information for that time period. For my application, there is a distinct shape and I'd like to classify whether it exists or not. For example, I want to detect whether the data looks like this or this Of course, there would be noise involved and the …
I want to classify the sentences in my dataset as declarative, interrogative, imperative and exclamative. Although It can be classified with respect to punctuation marks such as ?, ! and . but there are many cases and situations that these rules can fail. In NLP area, is there any model or solution that can be applied to reach the mentioned goal?
My training accuracy was better than my test accuracy, hence I thought my model was over-fitted and tried Cross-validation. The model further degraded. Is that my input data need to be sanitised further and of better quality? Please share your thoughts what could be getting wrong here. My data distribution: Code snippets... My function get_score: def get_score(model, X_train, X_test, y_train, y_test): model.fit(X_train, y_train.values.ravel()) pred0 = model.predict(X_test) return accuracy_score(y_test, pred0) Logic: print('*TRAIN* Accuracy Score => '+str(accuracy_score(y_train, m.predict(X_train)))) # LinearSVC() used print('*TEST* …
I'm creating a WordPress website, today I have tried to add some new features but I'm not able to add because customizer live preview is not loading I have done some steps Update all theme and plugin uninstall all the plugin after some time again install all plugin one by one. 3)Take a back up of whole site and reset the website by "WP reset plugin" upload again after sometime. Check the hosting space but not the space problem. check …
It's very straightforward for binary semantic segmentation: black color (0s) is responsible for background, whereas white color (1s) is responsible for objects of interest. But what about multiclass semantic segmentation? As far as I understand, these masks must be RGB images since we use more than two colors. Is it correct? Or should I have a separate binary mask for every class? If I can use RGB images with multiple colors as masks, should I use some specific colors for …
I have created a user dashboard using the Divi theme where I need to add a chart like the attached screenshot. The data are specific for every different user. I have tried many premium plugins but none of them fits my requirement. This is how I added the user meta - <?php function hfa_custom_user_fields( $user ) { $services_subscribed_options = array( 'Airbnb' => 'Airbnb', 'Vrbo' => 'Vrbo', 'Trucking' => 'Trucking' ); $services_subscribed = get_user_meta($user->ID, 'services_subscribed', true); $services_subscribed = (array)unserialize($services_subscribed); $total_invest = …
I'm finding some strange query strings on my homepage are indexed in Google and causing duplicate content. A couple of examples: https://sciencetrends.com/page/103/?cat=-1 https://sciencetrends.com/?cat=-3 I'm not sure how or why these pages are being created in Wordpress but it seems common for even large Wordpress sites: https://techcrunch.com/page/10/?cat=-1 https://blogs.wsj.com/law/page/10/?cat=-1 https://www.nytco.com/page/10/?cat=-1 http://www.bbcamerica.com/page/10/?cat=-1 Ideally, I'd like to remove all ?cat=* pages from the site and have then resolve to 404. Any thoughts on the best method to do so, .htaccess, Wordpress modification, etc.?
I know that how to generate next word in keras with lstm but how to predict previous word for example If you have two words like "car" and "running" then It should generate "The car is running". How can we do this in keras ? I want to also make sure that generator should stop after completing the sentence. Thank you.
Earlier this year I built a client a large website for their organization. After that site was finished and live on the web (not on our development server anymore) they wanted the company I work for to build them another site for their online magazine. I built the site using a copy of the old development site we used for their org since they wanted everything to look the same. Now that the site is finished, we need to integrate …
I have clear images of cards vs blurry images of card. My task is to capture photo when the image is not blurry, as you can see from the description I need this code to run in real time on android device. I have done some background reserarch on this topic 'Identify blurry image'. And found out few interesting solutions. Apply opencv transforms such as laplace or sobel filter. The blurry image will have less edges. And then using techniques …
I vaguely remember adding this text somehow ("Thank you for trying our product. We hope it brings you joy.") during some late night coding session. However, I've since forgot and want to remove it very much. I've looked all through the settings and can't find where it was added. Please advise!
I am working on a data entry task with approximately 6000 entries to go over. The source comes in the form of a string and can look something like this: Air Canada B737 FFS From this I can extract the following information: Company: Air Canada Model: B737 Technology: FFS For my initial plan of attack I iterated over the source strings using Regular Expression to extract as many keywords as possible, the problem is there are so many different Companies, …
I use WooCommerce REST API for updating/creating/deleting products. When I try to delete a product using $woocommerce->post('products/batch'), an image connected with a product is not deleting from the DB and filesystem. It takes up unnecessary space on the server. What is the best way to resolve this problem?
I have a little complex to explain the problem which I hope someone can understand and help me with. I have set custom fields on WooCommerce which I use to enter a specific code for each product (something like SKU called "asin"), Then i use that code on my backend using Amazon API to get the price from the product page on Amazon (don't worry my question is general and not related to API). Here is a sample of my …
There are multiple parameters that need to be specified in the XGBClassifier. Certainly gridsearchcv could give some insight into optimal hyperparameters, but I would imagine there are some rules of thumb for some reasonable hyperparameter selection. For example, for a training set of ~200,000 examples with ~1000 features is it possible to specify reasonable values for n_estimators, learning_rate, and max_depth with just this information alone?
I am trying to duplicate this papers feature engineering for user activity. They take 14 days of accumulated user activity and keep the parameters (2 parameters) that fit a sigmoid to it. I would like to do the same except with 7 days of activity. http://hanj.cs.illinois.edu/pdf/kdd18_cyang.pdf They use the formula below and keep the parameters x0 and k as features. from scipy.optimize import curve_fit import numpy as np def sigmoid(x, x0, k): y = 1 / (1 + np.exp(-k*(x-x0))) return …
So my url/slug structure looks like this /toolkit-category/downloads/gui-kits. Within /downloads is other child categories/terms. I am trying to fetch the other siblings of gui-kits when on /gui-kits. "toolkit_category" is the name of my taxonomy that is acting as categories, built using PODS. $queried_object = get_queried_object('term'); $tax = $queried_object->taxonomy; $term = $queried_object->term_id; $parent = $queried_object->parent; $next_items = get_term_children( $term, $tax ); The above code doesnt work, returns nothing? Any help is appreciated :)
Let's say I'm building an app like Uber and I want to predict the user's most likely destination based on the user's past history, current latitude/longitude, and time/date. Here is the proposed architecture - Let's say I have a pre-trained model hosted as a service. The part I'm struggling with is, how do I get the user features from the database in realtime from the RiderID to be used by the prediction service (XGBoost Model)? I'm guessing a lookup in …
I have a category called "Featured", but I don't want this category tag to be shown at the bottom of single post pages. I do want to display the other category tags. How do I hide the tag for this one category?
I have some legacy meta fields in my post that I would like to display in my block. I found a documentation for settings meta fields but not how to display them. So I tried this: export default function save( { attributes } ) { const blockProps = useBlockProps.save(); const postType = useSelect( ( select ) => select( 'core/editor' ).getCurrentPostType(), [] ); const [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' ); const game_meta = meta[ '_shortscore_game' ]; return …
I know there are many questions related to my question, but sincerely i was unable to get solution. My question is simple, how can i allow html in textarea in custom metabox on post. So far i have created this code of adding meta boxes. add_action( 'add_meta_boxes_post', function ( $post ) { if ( $post->_wp_page_template === 'page-templates/skyscraper-post.php' ) { add_meta_box( 'sky_post_excerpt', 'SkyScraper Post Excerpt and Links', 'sky_post_excerpts', 'post', 'advanced', 'high' ); } }); add_action( 'save_post', 'post_meta_box_save' ); function sky_post_excerpts() { …
I am working on a project where I have twitter user profiles and their tweets. The users are divided based on their number of followers in two groups (g1 and g2). Then with each user in g1, one user from g2 were matched based on their profile and activity using nearest neighbor (not propensity score). Now I want to do some statistical tests, for example, how differently the sentiment of the tweets changes for these two groups before and after …
I would like to add the media description as a data-attribute to each image of the gallery. All the other answers favour the solution to copy the whole code from media.php to functions.php and change it there. But isn't there a more intelligent way? It's way to much code duplication in order to change one single line of code!
I'm playing with regression models in scikit-learn. The goal is to predict how much inventory we should purchase for the next 90 days. My data set has hundred of product categories. Each category has many unique features that do not apply to every category. For Example: Shirt category could have "size" and "color" features where as the category Razors could have a "number of blades" feature. Should I split my data up by category and make a different model for …