How to find possible subjects for given verb in everyday object domain

I am asking for tools (possibly in NLTK) or papers that talk about the following: e.g. Input: Vase(Subject1) put(verb) Ans I am looking for: flower, water Is there a tool that can output subjects (objects) that can be associated to this verb? (I was going through VerbNet but didn't find anything)
Topic: nltk nlp
Category: Data Science

How to add a wrapper element on image for products page

I need to add a wrapper element for the images on the product listing page using WooCommerce. I'm trying to use via functions.php a hook to change, but I don't get how to work it out remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10); add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10); if ( ! function_exists( 'woocommerce_template_loop_product_thumbnail' ) ) { function woocommerce_template_loop_product_thumbnail() { echo wc_placeholder_img(); } } function wc_placeholder_img( $size = 'woocommerce_thumbnail', $attr = '' ) { $dimensions = wc_get_image_size( $size ); $placeholder_image = get_option( 'woocommerce_placeholder_image', 0 ); …
Category: Web

What is mean accuracy and why is it a harsh metric for multi-label validation?

The score method docs for scikit-learn's SGDClassifier have the following description: Return the mean accuracy on the given test data and labels. In multi-label classification, this is the subset accuracy which is a harsh metric since you require for each sample that each label set be correctly predicted. What is meant by the terms mean accuracy and subset accuracy? Could you please elaborate on why this is a harsh metric, perhaps with an example?
Topic: accuracy
Category: Data Science

What should I do to test the confidence of my deep learning model?

I've recently fine-tuned a deep learning framework/model BERT for a sentiment classification task. I had a 80/10/10 train/validation and test set. After running several experiments, I've gotten a decent model that I'd like to eventually productionize. However, I'm looking to create an experiment to test the robustness/reliability/confidence of the model before putting it into production. What are some ways/experiments that can be conducted to test the robustness/reliability/confidence of this model or its predictions? For example, are there statistically sound principles …
Category: Data Science

Displaying Meta Box Image

I have some problems displaying info from my custom meta box in my custom post type single. I'm using Reusable Custom Wordpress Meta Boxes by Tammy Hart. I'm able to display the textfields using this: <?php echo get_post_meta($post->ID, $prefix.'hjemmeside', true); ?> But I can't get the image to display, instead DEBUG is telling me that it is an "Undefined variable: post_meta_data in". Currently I'm using this script: <?php $custom_image = $post_meta_data['image'][0]; echo wp_get_attachment_image($custom_image, 'thumbnail'); ?> Is this wrong? ID for …
Category: Web

How to get comment images stored as serialized comment meta

I want to display images under for each comment but images store in database as serialized a:3:{i:0;i:775;i:1;i:776;i:2;i:777;} I wrote this code print_r (get_comment_meta( $comment->comment_ID , 'reviews-images', true )); but it outputs this * Array ( [0] => 778 [1] => 779 [2] => 780 [3] => 781 [4] => 782 ) 10 then I tried this echo get_comment_meta( $comment->comment_ID, 'reviews-images', true ); not worked . Please help how can I get image urls instead of this output
Category: Web

Single image feature reduction at inference time : SVM

I am trying to train a SVM classifier using scikit-learn.. At training time I want to reduce the feature vector dimension. I have used PCA to reduce the dimension. pp = PCA(n_components=400).fit(features) features = pp.transform(features) PCA requires m x n dataset to determine the variance. but at the time of inference I have only single image and corresponding 1d feature vector.. I am wondering how to reduce feature vector at inference time in order to match the training dimension. Or …
Category: Data Science

model serialization - what is ".pk" format?

I encountered a piece of pytorch code where the trained model is saved with .pk. I often see pytorch models being saved as .pth or .pt. What is .pk format and how is it different from .pth or .pt? Btw, the following parameters and weights are saved under the .pk file: save_dict = { "encoderOpts": encoderOpts, "classifierOpts": classifierOpts, "dataOpts": dataOpts, "encoderState": encoder_state_dict, "classifierState": classifier_state_dict, } Many thanks in advance!
Category: Data Science

Feature importance for particular classes

Suppose I have a dataset labeled with two classes such as healthy and unhealthy and I applied feature selection (feature importance) on the dataset. How can I know if the features are important to a particular class (to healthy or unhealthy)?
Topic: dataset
Category: Data Science

Wordpress address URL keeps dropping the www

My Wordpress Address (URL) in general settings keeps losing the www from the URL - I type in http://www.domain.com and it saves and works fine. Next time I go in the address has changed to http://domain.com. So again I change it, I get logged out and I log back in and it looks fine until next time and it has changed again. This is the only setting which changes (site address keeps the www) and I have checked my htaccess …
Category: Web

Disable emails for new user registration

I want to disable the default email that is send when user is registered. I am using this plugin for email verification User Verification By PickPlugins, which sends an email with confirmation link, but the problem is that by default and WordPress send an email via pluggable.php: function wp_new_user_notification( $user_id, $deprecated = null, $notify = '' ){...} I am using a theme (which I am extending with a child theme), which calls wp_create_user. I have replaced that parent theme function …
Category: Web

Fitting an arimax model on out of sample dataset

I have built an arimax model where we have sales data across time as the response variable and price is one of the external variables. I used the below code to build a simple arimax model. I had data points from 1 to 24, I have kept only 1 to 20 data points in the training dataset library(stats) fit=arima(window(tssales, end=20), order = c(0,1,1), xreg = window(tsprice, end=20)) summary(fit) fcast=forecast(fit, h=5, xreg = window(tsprice, end=20)) plot(fcast) Now when I try to …
Category: Data Science

Performing EDA on a dataset with missing features

I'm new to DS. I want to perform EDA on such dataset, where these are the missing features stats of my train and test sets: train: Test_0 0 Test_1 31 Test_2 0 Test_3 141 Test_4 0 Test_5 0 Test_6 0 Test_7 0 Test_8 1045 Test_9 0 Test_10 0 Test_11 0 Test_12 0 Test_13 0 Test_14 0 Test_15 2967 Class 0 dtype: int64 test: Test_0 0 Test_1 7 Test_2 0 Test_3 46 Test_4 0 Test_5 0 Test_6 0 Test_7 0 Test_8 …
Category: Data Science

How to solve MemoryError problem

I've created and normalized my colored image dataset of 3716 sample and size 493*491 as x_train, its type is list I'm tring to convert it into numpy array as follows from matplotlib import image import numpy as np import cv2 def prepro_resize(input_img): oimg=image.imread(input_img) return cv2.resize(oimg, (IMG_HEIGHT, IMG_WIDTH),interpolation = cv2.INTER_AREA) x_train_ = [(prepro_resize(x_train[i])).astype('float32')/255.0 for i in range(len(x_train))] x_train_ = np.array(x_train_) #L1 #print(x_train_.shape) but i get the following error when L1 runs MemoryError: Unable to allocate 10.1 GiB for an array with …
Category: Data Science

How to get sentiment score for a word in a given dataset

I have a sentiment analysis dataset that is labeled in three categories: positive, negative, and neutral. I also have a list of words (mostly nouns), for which I want to calculate the sentiment value, to understand "how" (positively or negatively) these entities were talked about in the dataset. I have read some online resources like blogs and thought about a couple of approaches for calculating the sentiment score for a particular word X. Calculate how many data instances (sentences) which …
Category: Data Science

how to find holiday effect on revenue?

I have 2 datasets from 2013-2017 for each day. a) Revenue generated by Locations and date. b) Holiday name and date I would like to know how each holiday is impacting the revenue by location. I am confused about what method to use! Should 3-Sigma rule or Bollinger plot be enough or should I try spline regression or something else? FYI I am using python for this analysis.
Category: Data Science

How can i style "echo apply_filters"

With WordPress I have years of experience but with PHP I do not have much experience. I want the available product colors on the shop page and that's working! :) But i want a text before the available colors and i want to style it. I tried a lot of things but my knowledge is limited. Can someone help me? Thanks! This is the code right now: function custom_display_post_meta() { global $product; $attr = array('pa_kleur'); foreach($attr as $attribute) { $values …
Category: Web

Add a string to file .pot using Poedit

I want to add a string to a pot document for language, but it says there’s an error. I have opened file .pot with a text editor and I have add this code #:D:\Programe\InstantWP\InstantWP_4.3.1\iwpserver\htdocs\wordpress\wp- content\themes\sydney-child/category-38.php:56 msgid “” “Read more” msgstr “” while in my file I have add this one <?php _e( ‘Read more’, ‘sydney-child’ ); ?> Then I have downloaded file .pot and I have opened it with Poedit, I have add the translation “Read more”, but when I …
Category: Web

Read-Only custom post type

For the contact form of my own theme I have created a Custom Post Type in which the messages of the users are automatically stored. In the administration area the messages can be read similar to comments. By doing this, you can create, change and delete messages in the administration area. All these functionalities should be prevented, so that only the reading of the messages remains possible. I tried to achieve this by giving the custom post type its own …
Category: Web

What is the most appropriate machine learning approach for this scenario?

The scenario is pretty simple, and I'm sure it's been done a million times. The problem is I don't know the terminology to find the correct resources on the web. Scenario: I have an environment that can be described in terms of 5 parameters, including and input value A and an output variable B. There is a dataset containing 100 rows and values for each parameter. The output B depends on A as well as the remaining environmental variables. The …
Category: Data Science

Getting no Error Log File saved to my local directory, and no debug info displayed in the web browser

I have installed WordPress on my Ubuntu Server 20.04 VM (host machine runs Linux Mint 19). I've able to view wp-admin and the sample website without issue. I'm using Firefox to access wp-admin, the browser is up to date, and the browser clears the cache/history each time I close it. When I click Themes in wp-admin, the page opens just fine. But when I click Add New, a progress bar keeps spinning, and then I get the following message: An …
Category: Web

How can I calculate total days past due between billing events?

I am dealing with a dataframe with subscription events partitioned by username, subscription status, and relative timestamps. For each of the dates, there are changes in time when the subscription becomes past due and renews as such: username subscription_events_name subscription_events_timestamp A subscription_charged_unsuccess 2021-01-08 A subscription_past_due 2021-01-08 A subscription_past_due 2021-01-15 A subscription_charged_successfully 2021-01-16 A subscription_renew 2021-01-16 Say a customer enters past due status, and 15 days later their subscription is billed in full and they enter an active status. I want …
Category: Data Science

Post + form + action + results on the same page

I'm trying to put on a post a custom form and, on the same page I'd like to visualize the results of an action on the form. But I'm missing the basics. Essentially I'd like to do something like this. Is it possible? <?php if(isset($_REQUEST['submit_btn'])) { echo "<div>"; $name = $_POST["names"]; echo "</div>"; } ?> <form action="" method="POST"> <input type="text" name="names" id="names"> <input type="submit" value="submit" name="submit_btn"> </form> ADDITION (after the answer from Tejas gajjar): Thank for the answer. Actually I …
Category: Web

How to do multivariate time series classification using C# and either Accord.NET, Encog or ML.NET?

I have a time series based on financial security prices with additional features. I wish to feed this series into some ML construct in order to perform multi-class classification. Most of the solutions that I found in my search offer predictions. I am not interested in predicting future prices. I merely wish to train the ML construct to offer the most likely class for the given time-series input frame. I am looking for C# solutions or links to tutorials that …
Category: Data Science

Why do we only care about convex functions when doing Gradient Descent/SGD?

I mean I know why we specifically care about convex functions: it's because their local minimum are also global, and so you just have to "follow a path which goes down" to find the minima of the function. However, there are also functions which are not convex, but for which local minima are also global minima, for example, a function which looks like this: Isn't there a way to characterize every function which "works well" with gradient descent? Something like …
Category: Data Science

Labeling a dataset for sentiment analysis

I was reading articles on sentiment analysis and NLP and there is something I cant quite understand. One of the methods to label a dataset is to use something like textblob with a polarity dictionary that would count words in a positive and negative dictionary and give a score based on it. Then the dataset is used to train a classification algorithm. My question is, why do we bother with ML at all while we have a rule-based labeling method …
Category: Data Science

DQN fails to find optimal policy

Based on DeepMind publication, I've recreated the environment and I am trying to make the DQN find and converge to an optimal policy. The task of an agent is to learn how to sustainably collect apples (objects), with the regrowth of the apples depending on its spatial configuration (the more apples around, the higher the regrowth). So in short: the agent has to find how to collect as many apples as he can (for collecting an apple he gets a …
Category: Data Science

Pagination stopped working after assigning custom page template to new page (different slug)

I am having a problem with pagination on one of my CPT after assigning the custom page template to a different page with a different slug. It all worked perfectly on the test page I developed it with. Only after the new assignment did I run into this issue for subsequent pages (2,3,etc.). Page 1 still works fine. I did resave the Permalinks in WP after the assignment of the custom page template and cleared and rebuild all caches (WP …
Category: Web

Create Meta boxes dynamically

I followed and created a meta box using all code from this question here: Create more Meta Boxes as needed Basically only two fields are created when you click on Add track button: Song title field - Track number field But I need something like that: Add album name button - add a field for a album name; Add track number button - add a field for track number; This is my code right now: add_action( 'add_meta_boxes', array( $this, 'dynamic_add_custom_box' …
Category: Web

Evaluation method for multi-class classification problem modeled as binary classification problem

I should mention that even though I have some basic knowledge regarding ML, it is the first big ML project I am working on and for the proposal of my research project I need to suggest an evaluation metric. The problem is a multiclass(16 classes) classification problem where one data point can be classified in multiple classes (not ranking based though). I plan to model it as a binary classification problem for each class but for the related evaluation metrics …
Category: Data Science

Can a recommendation system be used as a binary classifier?

I have a computer-generated music project, and I'd like to classify short passages of music as "good" or "bad" via machine learning. I won't have a large training set. I'll start by generating 500 examples each of good and bad music, manually. These examples can be transposed and mirror-imaged to produce 12,000 examples of each good and bad. I have a way of extracting features from the music in an intelligent way that mimics the way a perceptive listener would …
Category: Data Science

Customize the reset password page?

How can I style the reset password page, where I put in my new password? I tried going like this: function my_login_stylesheet() { wp_enqueue_style( 'custom-login', get_template_directory_uri() . '/dist/styles/main.css' ); } add_action( 'login_enqueue_scripts', 'my_login_stylesheet' ); but it added the CSS only to the login and forgot password page (forgot password as in the page where you put in your email). However, I want to style the reset password page (where you put in your passwords).
Category: Web

Binary classification from local and global feature selection

I want to train a deep leaning model, consisting of images. My question is which scenariowas chosen to train the model? scenario 1 : I train images local context on Output 1, and I train images clobal contet on Output 2, Finally, combine these two outputs to get a binary classification. scenario 2 : Train global and local context directly on the binary classification. This is what I mean by local and global context (This is just an example):
Category: Data Science

About

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