Initialize a recommender system with no dataset

Consider a platform for content recommendation based on the user history. The contents are books and articles and by history I mean what the user has read, what he has shared and so on. I know that there are many studies on how to train a recommendation system, however I don't know what to do to "start" (the platform has not been launched yet and the dataset is empty). Are there techniques that consider an initialization phase where no data …
Category: Data Science

Post Template Query with WP_Query?

I've seen this solution for querying pages based off of template type: Page template query with WP_Query I'm having trouble getting it to work with posts, that are using a "Single Post Template:" rather than a "Template Name:" definition. Here is my code: // query $the_query = new WP_Query( array( 'post_type' => 'post', 'posts_per_page' => -1, 'meta_query' => array( array( 'key' => '_wp_page_template', 'value' => 'single-current.php' ) ) )); Is there a different 'key' I should be using? Something like …
Category: Web

How to retrain a model if a subset of predictions needs improvement

In my work, sometimes my client complain about a subset of predictions not being accurate. Despite I know it's nearly impossible to just change the model for fitting that subgroup, while other predictions going well. But is it the case? Other than building another model specifically for that subset, I wonder is there anything I can do to improve the predictions within that subgroup? What kind of adjustments possible?
Category: Data Science

Going from voting per district + census data, to voting per age?

I have some voting or polling data that is listed by voting district. I also have detailed demographics of each voting district. How can I combine this to get an estimation of how the different demographics voted? I want to be able to make a chart of "percent yes" over age, or income bracket. (In the end, I want to use these relations to try and predict the outcome in a place with different demographics). One approach I've seen is …
Topic: inference
Category: Data Science

Disable user profile editing for one user

I have being looking in internet how can I disable the option of edit profile in Wordpress for a user and I didn't find a good way. The problem is that I want that the 95% of users can edit their profiles (address, telephone,...) but there is another 5% that I don't want them to have access to the profile section. The best solution for me is to select manually the users that I want to disable but I also …
Category: Web

How to clone homepage for multi region site?

How would i clone the homepage of my website ? I understand and have used to plugins that duplicate your page, the difficulty I am having is that I need to create a multi-site from 1 domain. For example, I have mywebsite.com - this targets my usa audience mywebsite.com/es - this would target spanish audience I would really like to know how I would duplicate mywebsite.com and then edit that page and content so that it is in spanis If …
Category: Web

How can I classify multiple images "simultaneously"?

I am dealing with a multiclass image classification problem with N classes. Particularly interesting is now that a single instance is NOT a single image as you would expect normally, but rather a set of multiple images that belong to each other. I could theoretically built a model that looks at each image of an instance one after another and classifies them separately (and I actually already did), but I want to create a model that benefits from the interdependence …
Category: Data Science

Learning parameters when loss is a piecewise function

I have a network to generate a single number $T$. I know in advance: a property of the loss function is that, when $T \in [a_1, a_2]$, the loss has the same value $L_1$; when $T \in [a_2, a_3]$, the loss has another value $L_2$; etc. The loss function resembles a piecewise function. A concrete, simplified example of this problem is perhaps something like object classification. I have a set of objects, and their distances to a category $C$ that …
Category: Data Science

show image gallery in archives or category page

i want to show image gallery in archives.php or category.php. The featured image and text content is showing but not image gallery. Below is the code inside category.php. I have tested to show one post from category 'blog'. $args = array( 'post_type' => 'post', 'post_status' => 'any', 'cat'=>3, 'meta_query'=> array('relation'=>'AND', array( 'key'=>'intro_post','value'=>'intro','type'=>'CHAR','compare'=>'LIKE' ) ) ); $arr_posts = new WP_Query( $args );?> <?php if ( $arr_posts->have_posts() ) : ?> <?php while ( $arr_posts->have_posts() ) : $arr_posts->the_post(); ?> <div class="entry-content"> <?php if …
Category: Web

How to perform Style Transfer in 2021

I would like to perform the task described in A Neural Algorithm of Artistic Style which applies the style of an image to a different image. This paper dates back to 2015 and there has been a lot of progress in the field of computer vision since then. What is the most up-to-date paper/github repository for this task? I have searched on paperswithcode, but there are no benchmarks or ranking of papers related to the task of style transfer.
Category: Data Science

How to add multiple footer widgets?

I am new to WordPress. I would am currently using the Twenty Seventeen Theme. I would like to add multiple Footer Widgets, however WordPress is limiting me to only two. Is it possible to add a few more footer widgets? If so how to do I do that? I have spent two days searching the internet for an answer to avail. I would prefer PHP or CSS file modification answers. Thank you in advance...
Category: Web

Many regression lines in a plot

How do you plot many regression lines in a plot? This concerns the textbook question from "Forecasting: Principles and Practice". A dataset concerns winning times of Olympic running events. Categories include year, length (distance), sex (gender). The question askes to make a regression line for each plot to see the average rate of change for each event. I could brute force this question but I want to find an efficient way to make multiple regression lines in a single plot. …
Category: Data Science

HTTP Error 406 always on site?

Hello WordPress community, I am getting http 406 error in my website when ever I tried to change something in my site. it looks similar like this below line This page isn’t working If the problem continues, contact the site owner. HTTP ERROR 406 I tried this in htaccess but the result is same . <IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule> # BEGIN WordPress # The directives (lines) between "BEGIN WordPress" and "END WordPress" are # dynamically generated, and …
Category: Web

Excluding pages in WP_query using ACF

I have a custom loop for showing child pages of the current page, but I'd like to allow the WP user to enter page IDs to be excluded from the loop, using Advanced Custom Fields. My current loop is as follows. It almost works, except it only excludes the first page ID in the list: <?php $exclude_ids = get_field('exclude_pages'); $args = array ( 'post_type' => 'page', // custom post type 'post_parent' => $post->ID, 'orderby' => 'menu_order title', 'order' => 'ASC', …
Category: Web

Append and replacing data in r

I am writing a few lines of codes to create a data table full of NAs but don't know how to append the data of results into the data table I created while replacing the position of NAs. Here is my data table games<-10 game_results<-as.data.frame(matrix(NA,games,3)) install.packages("data.table") library(data.table) setnames(game_results,c("V1","V2","V3"),c("winner","round","winnerscore")) game_results
Topic: data r
Category: Data Science

WP Asking for FTP Credentials with XAMPP Localhost

Total newbie here. I'm a pretty good user of applications, but have never written a single line of code. Installed XAMPP and WP, purchased a template from Envato and plan on working on it over the weekend. Followed instructions for both WP and XAMPP, and all seems to be fine. Running solely on local machine, MAC running Mojave. Go to install the .zip file on WP, and it asks for credentials for FTP. Not sure what I need to put …
Category: Web

How to provide Intentional Bias towards recent examples in Text Classification?

I have trained an XGBClassifier to classify text issues to a rightful assignee (simple 50-way classification). The source from where I am fetching the data also provides a datetime object which gives us the timestamp at which the issue was created. Logically, the person who has recently worked on an issue (say 2 weeks ago) should be a better suggestion instead of (another) person who has worked on similar issue 2 years ago. That is, if there two examples from …
Category: Data Science

Splitting Subject Data in train, validation and test set for 3D Human Pose Estimation

This is a 3D Human Pose Estimation problem. There are totally 15 normal subjects in train set, 7 normal subjects in validation set and 7 normal subjects in test set. There are 7 impaired subjects totally. How can the splitting of these impaired subjects be done to get a higher accuracy by adding these in train, validation and test set respectively?
Category: Data Science

Colab variable inspector stops working after importing from fastbook

As best as I could find, this question was not asked before. I'm using colab, and I use its variable inspector. I'm trying to do the FastAI exercices, and I noticed that when doing them, the variable inspector stops showing variables. For instance - I open a new notebook and I start creating variables in cells. x=5, a=6 and so forth. These variables are shown in the inspector. But, once I run the line: from fastbook import * the variable …
Topic: fastai colab
Category: Data Science

No templates for condition page.php Elementor

I am building a WordPress theme and I want it to support the Elementor theme. But I get this error in Elementor Debugging mode. No Template for condition > theme name -page.php What could be the cause? This my page.php <?php get_header(); ?> <?php if ( have_posts() ) { while ( have_posts() ) { the_post(); the_title( ); the_content(); } // end while } // end if ?> <?php get_footer();
Category: Web

How to detect that sequence of points belong to some model of first order theory?

Assume that every neural network can be recast to the sequence of layers (https://arxiv.org/abs/2106.14587 has chapter how to do this). Assume that layer U has N neurons. The set of possible activities of layer U forms the N-dimensional vector space. Each concrete state of layer U (in the sense of activities) can be described by N-dimensional vector (point) in this space. Assume, that NN functions or learns and assume that some First Order Theory (set of variables and functions and …
Category: Data Science

How to update wp-config file in Docker

I am trying to change our blogs from Wordpress to inside a docker container, so that we can move around it easily. I wrote a docker-compose file for the purpose and it ran smoothly the first time. But I made some mistakes on configs and missed to write the HOME and SITEURL on the docker-compose file in the beginning. Now, I can't seem to change the wp-config.php. according to Wordpress, it can't be updated from the entrypoint script once it's …
Category: Web

Semantic network using word2vec

I have thousands of headlines and I would like to build a semantic network using word2vec, specifically google news files. My sentences look like Titles Dogs are humans’ best friends A dog died because of an accident You can clean dogs’ paws using natural products. A cat was found in the kitchen And so on. What I would like to do is finding some specific pattern within this data, e.g. similarity in topics on dogs and cats, using semantic networks. …
Category: Data Science

predictive effect in the classification made according to the comments in different fields

I want to do a classification through comments categorized in 4 areas(X,Y,Z,M). Categorizing the product as good or bad based on the comments in the fields X, Y, Z, M. How can I follow a path to see the effects of these 4 areas on the result. For example; Id X Y Z M Result 1 The prod.. I fell.. Very bad.. lost of time.. 0(bad) Using this data, the model will be given comments in the x, y, z, …
Category: Data Science

Disclaimer that will show every refresh of the page

Hello I have here a code that is based on a "where you first access the page you will see the Disclaimer template" but I want it to show every time I refresh the page <?php // DISCLAIMER CHECK $ip = TCG_RETURN_IP(); $disclaimer_option = 'tcg_disclaimer_'.$ip; $get_disclaimer = get_option($disclaimer_option); $date_now = new DateTime(); $date_now = $date_now->setTimezone( new DateTimeZone('GMT+1') ); if( (TCG_CHECK_DISCLAIMER() != false) || (TCG_CHECK_DISCLAIMER() != '') ){ // if($date_now>$get_disclaimer){ if($date_now>$get_disclaimer){ delete_option($disclaimer_option); get_template_part('topcitygirls/templates/topcity','disclaimer'); //get_template_part('topcitygirls/templates/topcity','header'); echo 'true'; }else{ get_template_part('topcitygirls/templates/topcity','header'); } }else{ if( …
Category: Web

WPMU site in subdirectory: When I clone a site with NS Cloner Pro plugin, how do I remove the subdirectory from the URL?

I have a WPMU site in a subdirectory /new/. So my main URL is example.com/new. I have been able to use .htaccess and copy the index.php file into the domain to achieve just example.com for my main site. However... I have the 'NS Cloner Pro' plugin which clones WPMU sites in one click (great plugin!) but every clone still has the /new/ subdirectory. So what I want is example.com/clone-site-1/ but what I'm getting is example.com/new/clone-site-1. I've tried using www.interconnectit.com "search-and-replace" …
Category: Web

Merge two or more ML models with different size of output togetger

I have several models that classify the input (word embedding) into several classes. My problem is that I need to train these models separately and need to merge the output of these models together to get a label. For simplicity assume only two models: Model 1: predicts A, B or C Model 2: predicts D or E Then, I need to classify the input X so that I get the joint probability over A, B, C, D and E. I …
Category: Data Science

How to update a meta field of type array in Gutenberg

In a plugin I'm building for Gutenberg, I register a meta field named _related_posts, which stores an array of post ids: PHP: function register_meta_fields() { register_post_meta( '', '_related_posts', array( 'show_in_rest' => true, 'single' => true, 'type' => 'array', 'show_in_rest' => array( 'schema' => array( 'type' => 'array', 'items' => array( 'type' => 'integer', ), ), ), 'auth_callback' => function() { return current_user_can( 'edit_posts' ); } ) ); } I'm using the useEntityProp hook to get and set this meta field …
Category: Web

excluding posts by an ACF field in pagination

So I have this $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'post_type' => 'post', 'posts_per_page' => 12, 'category' => 1165, 'meta_query' => array( 'meta_key' => 'price_special', 'value' => array('New Boat', 'Under Offer', 'Reduced', 'Just Added', 'Coming soon', 'New Build'), 'compare' => 'IN', ), 'suppress_filters' => false, 'meta_key' => 'price', 'orderby' => 'meta_value_num', 'order' => 'DESC', 'paged' => $paged, ); $query = new WP_Query($args); but the meta_query is having no effect on the number of results and therefore …
Category: Web

Some custom taxonomy child terms not showing in admin. Caching problem?

I have a problem with some custom taxonomy terms. I am using "Types" plugin for creating custom post types and custom taxonomies. I successfully created my postype and hierarchical taxonomy and strated to add content. Everything worked great until I migrated the site from the dev server(Linux) into the live server (Microsoft IIS). Right now when I add a term as a child to another term in the taxonomy, it gets hidden from the custom taxonomy terms admin panel and …
Category: Web

How interpret keras training loss without compare with validation loss?

I have several implementation of the same neural network, but each one with different starting parameter. This is one of my plot comparing the training loss of the base experiment with the training loss of another experiment. I have also other exaples: May anyone point me to some instruction on how understand these output from the keras fit()? Note that I don't have any validation set. Thanks
Category: Data Science

About

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