How to deal with one output for multiple inputs?

Hei! I want to train a model, that predicts the sentiment of news headlines. I've got multiple unordered news headlines per day, but one sentiment score. What is a convenient solution to overcome the not 1:1 issue? I could: Concatenate all headlines to one string, but that feels a bit wrong, as an LSTM or CNN will use cross-sentence word relations, that don't exist. Predict one score per headline (1:1), and take the average in the application. But that might …
Category: Data Science

Predicting t+1 from a set of sequences

Say I have have an experiment where I release a single rat into a maze and wait for it to reach the end. Say I also track this rat's position in the maze at various times. Let's do this $n$ times. Now, I have a dataset of $n$ variable-length movement profiles, since some of the animals finish faster, some take longer, etc. Is there a way I can analyze this data to then predict the next move $(x_{t+1}, y_{t+1})$ given …
Category: Data Science

Woocommerce Product page add on checkbox and price

There is a website where we use WooCommerce infrastructure. I have products for which I use variations, and I want to make variations like the sample site below. When the customer selects the x option from the product with the x y z option, I want the number of names and the price of the checkbox field that I have determined on the product page. Can I do this with a ready-made plugin? Or do you have any suggestions? Thank …
Category: Web

wp_query ignoring custom post_status

I have a custom post status called 'dead.' I am trying to create a wp_query to show all posts for a custom taxonomy. If I specify 'any' for the post_status I do get published posts and my 'dead' post_status posts. Likewise, if I set the post_status parameter to only 'dead' I do get just those posts. But, if I try to set the post_status to show both published and dead post_status posts via an array I can only get the …
Category: Web

Sort posts according to a numeric value entered with ACF

I've tried a little bit of everything, but I still can't find the right solution. I need to sort my posts according to a numeric value that is entered in each post. I'm using the following PHP code, but it's not working: $args['meta_query'] = array( array( 'key' => 'key', 'type' => 'numeric', ) ); I also tried this code: $args['meta_key'] = 'costo_attrazioni_ridotti_18_25'; Then of course I have these other values in the args as well: $paged = ( get_query_var('paged') ) …
Topic: loop Wordpress
Category: Web

WordPress plugin Write User/staff ID as the same as the WordPress User ID

I have a question in regards to a WordPress plugin (Bookly) that creates a Staff ID for an already created WordPress user, and hopefully, somebody may be able to help me with. Currently Bookly adds the Staff ID incremental so each new staff ID would say Staff ID:4 then the next 5 then 6 etc, I'm looking for some code that would take the current WordPress user's ID and add that ID as the Staff ID for that user when …
Category: Web

Encoder-Decoder performance time

I have two encoder-decoder models. *First model: *Second model: When I check the performance of the models I get approximately the same performance time (First model ~ 42 sec, Second model ~ 40 sec). I train my model on GPU and check performance on CPU. I test it only on one large image where the size is 12348x12348. I was expecting the larger model that has more parameters to train (second model) to give me longer run time. Anyone can …
Category: Data Science

Effect of size of data on the confidence on the coefficients in Linear regression?

What is the impact of size data on the confidence (p-value) of model coefficients?. Does increasing the size of data always improve the confidence in the model coefficients? Suppose I have 100 data points. I created another data from the same data by duplicating the original data 100 times. i.e. I have 100,000 data points now. If I run the model on two data sets, what would impact the model coefficients and why? I appreciate any help you can provide.
Category: Data Science

Dynamically add Js

I have a basic bunch of CSS/Js files defined in my functions.php file. There I register and enqueue those scripts and stylesheets. But in specific situations I want to load additional scripts based on the site template which is used. I tried to register and enqueue those additional scripts in the specific Template file, but it didnt work. It does only work when included in the functions.php. What is the correct way to do this?
Category: Web

Custom loss for low false positive rate (higher precision)

I am working with a scenario where I need to minimize the false positive rate for the minority class. Additionally my dataset is imbalanced. (10% minority class, 90% majority class). I am using the class_weight in the fit function of keras. Additionally, I would also like to try a custom loss function to see if this makes a difference. A number of solutions online Keras custom loss function as True Negatives by (True Negatives plus False Positives) discuss a specificity/precision …
Category: Data Science

Wrong post ID in meta box callback

I trying to get the ID of the post on edit page but its displaying the wrong ID Custom Post: register_post_type( 'projetos', array( 'description' => 'Projetos do Scan' ,'exclude_from_search' => false ,'public' => true ,'publicly_queryable' => true ,'show_ui' => true ,'show_in_menu' => true ,'query_var' => true ,'rewrite' => array( 'slug' => 'projeto' ) ,'capability_type' => 'post' ,'has_archive' => true ,'menu_position' => 20 ,'supports' => array( 'title', 'editor' ) ,'hierarchical' => true ,'labels' => array( 'name' => _x( 'Projetos', 'post type …
Category: Web

Generate a balanced batch with ImageDataGenerator() and flow_from_directory()

Hi I am new to python and deep learning. I am doing a multiclass classification. My 3-classes dataset is imbalanced, the classes take about 50%, 40%, and 20%. I am trying to generate mini batches with balanced classes. I am using class_weight to generate a balanced batch in fit_generator() but I am doubting if it actually works because the batches generated by train_datagen.flow_from_directory() is not balanced. the generated batches have weights around [0.43, 0.38, 0.19]. My code are as follow: …
Category: Data Science

Is it possible use cluster analysis on word co-occurrences?

Problem: I am unsure if there is an appropriate clustering method to do the following: I wish to group a list of word co-occurrences into their possible clusters. Context: I have a dataset containing (1) frequencies for the number of times the list of terms appeared in the context of the main term (i.e., conditional probabilities). These were extracted from corpus data. I think I might need another metric to start clustering other than frequency of times the term appeared, …
Topic: nlp clustering
Category: Data Science

Remove generated category and tag class names from woocommerce product & blog listings markup

I noticed in my wordpress/woocommerce setup that every time i add a tag to a product or a blog post. It adds that tag as a class into the listed item (Product/blog) I also noticed it adds a class in the same place for every category i put these post items into. How can i prevent wordpress and woocommerce from addings these tag and category names into my html markup as classes? As i do not need them and its …
Category: Web

Deep Q-learning, how to set q-value of non-selected actions?

I am learning Deep Q-learning by applying it to a real world problem. I have been through some tutorials and papers available online but I counldn't figure out the solution for the following problem statement. Let's say we have $N$ possible actions in each state to select from. When in state $s$ we make a move by selecting an action $a_i, i=1\dots N$, as the result we get a reward $r$ and end up in a new state $s^\prime$. In …
Category: Data Science

Contunious model update

Hello I have a trained model on credit card fraud detection, however I want to find a solution so I can update the model parameters with new input records to simulate the pattern changes, is there any repository or ideas to help me.
Category: Data Science

Compressing profiles with a large number of dimensions

I 'think' this is a related question, but not sure how to apply it. I'm trying to build out a very crude recommendation system using Amazon ML, Facebook likes, and historical actions. So lets say we have a number of users within a system that promotes products within several categories. To better predict which categories of items to present to the user, we will consider their past interactions with specific items, and the past interactions of other users who share …
Category: Data Science

Website scroll not working on SAFARI

I have a site here missnationglobal.com. Scrolling works fine on Chrome and other browsers except safari. I checked the css markup for the site and don't seem to be able to figure out what is causing it, here's some code: html { height: 100% !important; width:100%; overflow-x: hidden !important; overflow:scroll; -webkit-overflow-scrolling: touch; -webkit-overflow-y: auto; /* added css prefix for safari */ } body { height: auto; min-height: 100%; overflow: hidden; position: relative; margin:0; } Any help is appreciated!
Topic: css Wordpress
Category: Web

Check authentication credentials using WP REST API

I'm using the WP REST API in combination with the Application Passwords plugin. What I would like to do is simply check to make sure a username and password combination (encoded as a base64 string) is valid, but I don't see an endpoint that would correspond to this functionality. Any ideas?
Category: Web

Accessing and Multiplying Individual Elements of a Layer's Output in Keras

Problem Description: I am trying to access the individual elements (i.e., scalar) from a softmax layer's output (with dimension (,2)) and multiply this with a tensor from another model, which has a dimension of (,10). A mock-up digram describing my problem is shown in the attached Figure. I am using Keras with Tensorflow as the back-end. So far, my approach has been the following: Lets say the output dimension of the softmax layer is (,2) (i.e., a vector of size …
Category: Data Science

Get ACF taxonomy term and sub-term lists ACF blocks

I want to get list of parents and child terms from ACF field type Taxonomy. This things need to display as ACF blocks. i have tried many things to done this stuffs but but it's not working for me. Screenshots: Frontend: https://shorturl.at/sHK02 Backend: https://shorturl.at/ESV06 ACF Field: https://shorturl.at/lntI7 <div class="filter"> <small class="filter-title">Categories</small> <div class="filter--select"> <div class="filter--select-active"><span class="filter--select-active-text">All</span></div> <div class="filter--select-options"> <div class="filter--accordion"> <div class="filter--accordion-title"> <h5>Blog</h5> <div class="checkbox"> <input id="blog" type="checkbox" value="filter0"> <label for="blog"></label> </div> </div> <ul class="filter--accordion-body"> <li> <p>Career advancement</p> <div class="checkbox"> …
Category: Web

How to Add Extra Settings to Appearance/Customizer Sections homepage

I want to exactly add settings to the static_front_page section in the customizer Sections homepage, I wrote code in functions.php for that but it doesn't work. my code in functions.php file: function mytheme_customize_register($wp_customize) { $wp_customize->add_setting( 'homepage_heading', array( 'capability' => 'edit_theme_options', 'default' => '' )); $wp_customize->add_control( new WP_Customize_Control($wp_customize, 'homepage_heading_control', array( 'label' => 'Homepage Heading', 'section' => 'static_front_page ', 'settings' => 'homepage_heading' ) )); } add_action('customize_register', 'mytheme_customize_register');
Category: Web

How to update post status to draft if user role is "pending'

I'm creating a website where user pays to publish posts. If this user membership expires, the role changes from "Subscriber" to "Pending". I need a code that allows to update all posts to draft if certain user's role is "Pending" and then back to publish if is "Subscriber". Any suggestions on this problem? I only found this plugin but it's not working.
Category: Web

Which metric should I use for classifying an imbalace data with fewer labels for the negative class?

From reading, I understand that when we have fewer positive class labels, it is better to use precision or recall as the evaluation metric. Which metric should I use when we have fewer negative samples? I'm looking for an approach other than switching the labels. Problem setting: I'm developing parametrized fragility functions for predicting damage to a structure (for example trees). An example of fragiltiy function is here The fragility function will estimate the probability of exceeding a damage state …
Category: Data Science

How do I select the "best" unsupervised machine learning algorithm to cluster my specific dataset?

I want to cluster a dataset without prior knowledge on the correct amount of clusters. For different algorithms (i.e. k-means, gmm...) I can iterate through different values and try to find the best solution for any given algorithm (i.e. ellbow-curve, silhouette-coefficient etc.). But I get very different results - as expected with different algorithms. K-Means is good for spherical clusters, density-based approaches for totally different cluster shapes. Now the actual question: How do I select the "best" unsupervised machine learning …
Category: Data Science

How to add author role as a custom field to custom post type in wordpress?

I want to add a custom field in the wordpress custom post type, such that this field dynamically fetches the value of the author role. Purpose - I want to add this custom field so that I can filter custom post types based on the user role of the author of the posts, that is editor, subscriber, etc. What have I tried? Well, I looked up the solution on Internet but couldn't find one and I am not that great …
Category: Web

It is possible to add extra button under the 'publish' button in the post of wordpress? and how?

Actually i need such a function , when we click on the "publish" button of the post in word press, after publish automatically go this page on the desired link().. 2nd :if we add a button "return link " just bellow the "publish" button ,then also i can get this function.. my question is how how to solve this problem and how we add button on the wordpress post under the publish button?
Category: Web

Online vs minibatch training for speed

If I do online learning in a setting where I have a HUGE amount of data, is that faster than doing minibatch learning (even if I optimize my batch size for GPU use, that is, use a multiple of 32 examples per minibatch)? Details: I have 12600 time series examples, each with 24 time steps, and each time step has 972196 binary labels. This is a multilabel problem. Assuming float32 numbers: loading the entire dataset should take about 1095 GB …
Category: Data Science

Changing block quote size in gutenberg

Hello I have tried to change the size of the blockquote in Gutenberg editor by switching to HTML and changing the text font. But it doesn't work. I still have gigantic size block quotes that take up too much space. See screenshots. Can somebody help? thanks a lot
Category: Web

Normalize data with uneven groups?

I have a dataset with 3 independent variables [city, industry, amount] and wish to normalize the amount. But I wish to do it with respect to industry and city. Simply grouping by the city and industry gives me a lot of very sparse groups on which normalizing (min-max, etc.) wouldn't be very meaningful. Is there any better way to normalize it?
Category: Data Science

Wordpress footer always at the bottom of the screen-page

I'm having a problem in fixing the footer always to the bottom of the page, also when there is not enough content in the page to fill it. I found a lot of similar questions online and all of them suggested as solution to add code similar to the following: footer { position: fixed; bottom: 0; left: 0; right: 0; } Here you can see the initial situation (footer in the middle of the page for empty content page): And …
Category: Web

Error using corpus widget in Orange v 3.25.0 text mining and no import document option?

I am experimenting with Orange data mining tool. When I use the 'Corpus' widget from the text mining section it gives me the error: [![Corpus widget error][1]][1] I have tried many things, but am still unable to resolve this issue. [1]: https://i.stack.imgur.com/X4tKu.png Besides that, in text mining, it does not show import document option in orange v 3.25. I just want to know the options to import text files into the Orange.
Category: Data Science

wordpress responsive image srcset not working

I'm trying use wordpress core responsive image feature but it's not adding srcset to image. Here is th my codes I have a div w=370px h=280px now I added image sizes if(function_exists('add_image_size')){ add_image_size( 'imagebox', 370, 280, true ); add_image_size( 'imagebox-2x', 840, 560, true ); add_image_size( 'imagebox-3x', 1110, 840, true );} And calling it inside the loop like this the_post_thumbnail('imagebox-2x'); it's adding only image like this 2x version without srcset <img width="840" height="560" src="http://localhost/starter/wp-content/uploads/2018/10/04004_theblackandwhiterocky_2560x1600-840x560.jpg" class="attachment-imagebox-2x size-imagebox-2x wp-post-image" alt=""> If I remove …
Category: Web

Using sensor data and a know reference point infer the position of a moving robot

Say, the robot is starting at a known position and I've data coming off of the robot as it traverses the grid layout. Exploiting the nuances captured in the data - like the implication of unequal rpm in the wheels indicating the robot is turning off to the side of slower wheels- I would like to dynamically infer the location of the robot relative to its starting position. The ideal solution would be as the data is streaming in my …
Category: Data Science

About

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