Paginate Links in Wp Query Shortcode

so been looking around for this answer, but no go -- basically i have a WP Query that is incased in a shortcode.. I have set up the paginate links function which outputs it on the page. However, the page url does not change when clicked (href does show the correct url -- /page/2) I know it is something with the main Query when executed in a shortcode. Any help would be greatly appreciated. $paged = ( get_query_var( 'paged' ) …
Category: Web

How many video streams can single GPU handle for object detection

I need to detect objects from multiple video streams at realtime (or close to it, like 10 FPS). How many GPUs do I need to detect objects using YOLOv3 or MobileNet for, say, 10 video streams? Is it possible to use CPU or something else? I don't need an exact number. I just need to understand scalability perspective and costs per single stream.
Category: Data Science

How to build regression model on residuals

Let's say you have a good-performing regression model, but the end result is not just yet there. One of the ideas, I came across to improve model performance is to build a second model using the first model's residuals (y-y_pred) on top. This model would suppose to learn for which observations the first model is overpredicting or underpredicting. The results from the second model would then be used together with the first's to improve the prediction. Has anyone tried to …
Category: Data Science

LGBM model predicting only single class on unseen data!

I have built a LightGBM based machine learning model on data of molecules of two classes. The distribution is as follows. Class 0 has 5933 data points and class 1 has 4696. The train test accuracy I get on this data is around 87% and 82% respectively. The roc_auc_score is around 81.5%. But when I try to evaluate model performance on an entirely new dataset which model has never seen before with class label 0 and 1 both having 94 …
Category: Data Science

Remove Trailing Slash from Category Base and Tag Base

I'm working on a custom static site generator using WordPress. I can't figure out how to remove the slash that comes after the category base and the tag base. I want to replace each with a dash. I'm currently using a post-processing PHP script and str_replace, but that means I'm stuck with whatever I hard code there (which is "category" and "tag" right now). Any suggestions?
Category: Web

Query regarding (.output_shape) parameters used in CNN model

I am applying CNN model on my dataset for predictions. After reshaping the dimensions, the input_shape of my model1 becomes: model1.input_shape: (None, 1, 3, 4) then i apply CNN ist input layer defined below: model1.add(Convolution2D(128, (2,2), border_mode= 'valid' , input_shape=(1, 3, 4), activation= 'relu')) here above 1 is number of channel, 3,4 represents my nodes means 12 input nodes or features, now wehn i check the output_shape of model1, it is: model1.output_shape: (None, 128, 2, 3) here 128 are number …
Category: Data Science

How to have multiple search result pages in wordpress with taxonomy terms listed

I am using a custom theme which has custom post types. First one is Doctors another is Hospital. Both doctors and hospitals have a common taxonomy named specialities. Each speciality has some services assigned to them(Services here is a child taxonomy). What i want to achieve is once i select speciality as a filter The first search results appear which has 4 sections as follows :- The Services of the speciality listed(Services here is the child taxonomy). When i click …
Category: Web

When to split Test and Training data from the full Dataset

I'm about to put my implementation into a pipeline and I'm now faced with the dilemma on when to actually split the test and training set? I have the following steps that I currently do (the names are self explanatory) DistinctValuesCleanser OutlierCleanser FeatureCoRelationAnalyzer FeatureVarianceThresholdAnalyzer DataEncoder SimpleImputer And perhaps some more EDA (Exploratory Data Analysis) steps will follow! So, now the question, do I run all these on my entire dataset and then split or split first and then run through …
Topic: dataset
Category: Data Science

Disable "auto embed" feature when pasting text and links

I want to disable the auto embed feature of Wordpress, when pasting arbitrary text that includes links in Gutenberg. I tried this with something like: add_filter('allowed_block_types', 'remove_default_blocks'); function remove_default_blocks($allowed_blocks){ // Get all registered blocks $registered_blocks = WP_Block_Type_Registry::get_instance()->get_all_registered(); // unset embed block unset($registered_blocks['core/embed']); // Get keys from array $registered_blocks = array_keys($registered_blocks); // Merge allowed core blocks with plugins blocks return $registered_blocks; } This works - but unfortunately this disables all embed blogs and I want the user to manually embed e.g. …
Category: Web

NLP based age calculation

I am working on a chatbot with open domain questions using google API & Wikipedia API. Its working few cases like who, what, when kind of questions. when I ask for Age of someone, its collecting only content about that person. As a chatbot, it should respond with the number(age). is there any model or I need to go with rule based approach.? Give your valuable suggestions.
Category: Data Science

How to make network learn about shape and color of the object separately?

I saw the paper and code of a Person Reidentification library by NVIDIA - GitHub - NVlabs/DG-Net: Joint Discriminative and Generative Learning for Person Re-identification. CVPR'19 (Oral) It says there are two different network to focus on Person body shape and clothing separately. Sorry if the question is noobish. Intuitively I would run the image through an edge detector, and then train on that image to make the network learn the structure of the pedestrian. - To make it focus …
Category: Data Science

How should I process the output from this neural network?

I have a neural network that takes an np.array of a mel spectrogram of a 3 second audio clip from a song as input, and outputs vector of individual predictions that it is from 494 given (individual) artists. At first, I was getting whole songs, splitting them into 3 second clips, inputting each clip into the nn, and averaging the outputs. But this proved to be wonky. I got advice that I should only need one 3 second clip, but …
Category: Data Science

A/B testing with non-Gaussian distributions

I have two sets of samples (A, B) with a relatively high number (~10,000) and I want to see if a factor has affected sample B or not. Naturally, I should use A/B testing. The problem is, the distributions are not normal and I'm interested in the maximum change, not the mean values! So if all you know is how CLT is gonna make everything Gaussian, this is a good point to stop and move on to the next question. …
Category: Data Science

Exclude post_meta from Rest API Endpoint

So I know that I can call: $response = wp_remote_get( 'https://www.example.com/wp-json/wp/v2/posts' ); To get all the posts from a specific website using the Rest API Endpoint. I also know that we can pass in the parameters to exclude tags and categories, such as: https://www.example.com/wp-json/native/v1/posts?exclude_categories=42 Based on this: https://developer.wordpress.org/rest-api/reference/posts/#list-posts Is there a way that I can exclude specific post_meta posts from showing in the Rest API? So let that I want to do: https://www.example.com/wp-json/native/v1/posts?exclude_postmeta_key=global and grab all posts that don't have …
Category: Web

Same validation accuracy, different train accuracy for two neural networks models

I'm performing emotion classification over FER2013 dataset. I'm trying to measure different models performance, and when I checked ImageDataGenerator with a model I had already used I came up with the following situation: Model without data augmentation got: train_accuracy = 0.76 val_accuracy = 0.70 Model with data augmentation got: train_accuracy = 0.86 val_accuracy = 0.70 As you can see, validation accuracy is the same in both models, but train accuracy is significantly different. In this case: Should I go with …
Category: Data Science

Automatically create a Google Calendar event when I publish a blog post

I would like to configure my site so that, whenever I create a new blog post in a certain category, an event is automatically created in one of my Google calendars. I would also like to set a parameter on the post that controls when the calendar event is scheduled for. Most of the plugins I've found let me display a Google calendar in my site. Instead of that, I want to create Google Calendar events in response to my …
Category: Web

Standardization in combination with scaling

Would it be ok to standardize all the features that exhibit normal distribution (with StandardScaler) and then re-scale all the features in the range 0-1 (with MinMaxScaler). So far I've only seen people doing one OR the other, but not in combination. Why is that? Also, is the Shapiro Wilk Test a good way to test if standardization is advisable? Should all features exhibit a normal distribution or are you allowed to transform only the ones that do have it?
Category: Data Science

Categorical data preprocessing for training a algorithm

I have a training dataset where values of "Output" col is dependent on three columns (which are categorical [No ordering]). Inp1 Inp2 Inp3 Output A,B,C AI,UI,JI Apple,Bat,Dog Animals L,M,N LI,DO,LI Lawn, Moon, Noon Noun X,Y,Z LI,AI,UI Xmas,Yemen,Zombie Extras So, based on this training data, I need a ML Algorithm to predict any incoming data row such that if it is Similar to training rows highest similar output aassigned. The rows can go on increasing (hence get_dummies is creating a lot …
Category: Data Science

Deploy final model from train dataset or train + test dataset

So I'm a newbie into Data Science field. I've created a model using Gradient Boosting to predict a house price. To evaluate my model, I've splitted my dataset into train and test (0.8 Train / 0.2 Test) and got 0.94 R^2 for train and 0.89 for test. If I want to deploy this model, for business purpose, do I have to make a new model with train and test data together? If I do that, couldn't my model have a …
Category: Data Science

Custom Post Types not queried in Custom Taxonomy archives or Native archives

I have declared a selection of custom post types as an array, allowing post_tags but not categories: // Add Multiple Custom Post Types add_action('init', 'all_custom_post_types'); function all_custom_post_types() { $types = array( array('the_type' => 'mama', 'single' => 'Mama', 'plural' => 'Mamas'), array('the_type' => 'webinar', 'single' => 'Webinar', 'plural' => 'Webinars'), array('the_type' => 'video', 'single' => 'Video', 'plural' => 'Videos'), array('the_type' => 'discount', 'single' => 'Discount', 'plural' => 'Discounts'), array('the_type' => 'faq', 'single' => 'FAQ', 'plural' => 'FAQs'), ); foreach ($types as …
Category: Web

What kind of neural network am I using? How can I build a specific kind of network?

I'm going through a tutorial for tensorflow with keras and at one stage you build the neural network model using the code below. model = tf.keras.Sequential([ layers.Embedding(max_features + 1, embedding_dim), layers.Dropout(0.2), layers.GlobalAveragePooling1D(), layers.Dropout(0.2), layers.Dense(1)]) I'm aware that there are different kinds of neural networks such as CNNs and RNNs which are better suited for different tasks. However, how do I relate the architecture built here to what kind of model it is? Also if possible, if I know what type …
Category: Data Science

could not convert string to float: 'YELLOW'

import numpy as np import pandas as pd from sklearn.neural_network import MLPClassifier from sklearn.metrics import accuracy_score from sklearn.model_selection import train_test_split from sklearn.metrics import confusion_matrix #read data data=pd.read_csv('adult-stretch.data', header=None) #convert to arrays x=data.iloc[:, :4].to_numpy() t=data[4].replace(['ADULT','STRETCH'],[0,1]) t=t.to_numpy() #split the dataset xTrain, xTest, tTrain, tTest = train_test_split(x, t, test_size=0.2, random_state=3) #split - #create the model/net net=MLPClassifier(hidden_layer_sizes=(2,), max_iter=4000, random_state=0) #model training net=net.fit(xTrain,tTrain) #model run/testing for TRAIN yTrain=net.predict(xTrain) accuracyTrain=accuracy_score(tTrain,yTrain) #accuracy!! print('Train accuracy is ',accuracyTrain) #model run/testing for TEST yTest=net.predict(xTest) accuracyTest=accuracy_score(tTest,yTest) #accuracy for test print('Train accuracy …
Category: Data Science

Data preprocessing methods

Data Cleaning Data Imbalance solving (Classification) Data Smoothing (decreasing noise) Creating-deleting features from original data Data Transformation (Box-cox,Log Transform) Making Dataset stationery (time series) And other specific data preprocessing methods in NLP-Computer Vision (very specific ones) I am trying to research data preparation methods and so far those are the things i could find. Do you think is anything missing? Thanks.
Category: Data Science

How to deal with highly skewed (on counts) dependent variables?

I am working on a binary classification problem and the dataset consists of several variables which are count variables. For example, how many times a customer defaulted on a broadband bill payment in the last 3 months. The problem is, these features are highly skewed. This is how the distribution for the above variable looks like: 0.0 98.175855 1.0 1.275902 2.0 0.348707 3.0 0.199535 This is due to the nature of the event being evaluated during the construction of the …
Category: Data Science

How many HP35s with The Bug are still extant?

I bought my HP35 in 1972, one of the first HP35s made. It has The Bug, that is, it says that antilog of 1/2 [log of (1.01) squared] = 1. My husband's HP35, bought a month or so later does not have The Bug. I still routinely use my HP35. Ergonomically, it is superb and unlike newer models, it is not cluttered with (what I consider to be) marginally useful functions. My question is: How rare is a working HP35 …
Topic: history
Category: Data Science

Any alternative to Google Colab?

I have to train vgg16 from scratch on a digit dataset as my college project. I require more computational power. Can anyone suggest to me how can I do that other than Google Colab? Currently, it is taking approx 17 hours to run one epoch? Like on cloud or anything? and it should be cost-efficient too as I'm just a student.
Category: Data Science

PHP header() not available to use in my plugin

I have a client website with a custom-developed plugin that when data is updated (this is all in Wordpress admin backend) uses a PHP header('Location: ') function to switch to a different URL. I had originally developed in an environment with an old theme that I eventually scrapped for a newer better one, but now PHP throws an error saying: PHP Warning: Cannot modify header information - headers already sent by (output started at /wp-admin/includes/template.php:2018) in /wp-content/plugins/*my-plugin-name*/save-data.php on line 47 …
Category: Web

Should I Impute target values?

I am new to data science and I am currently playing around a bit. Data exploration and preparation is really annoying. Eventhough I use pandas. I achieved imputing missing values in independant variables. For numerical data by using the Imputer with the means strategy and for one categorical variable I used the Labelencoder and afterwards imputed with the mode strategy. But now I face the issue that the dependant variable $y$ also contains missing values. Should I delete those lines …
Category: Data Science

Set term on an attachment using wp_set_object_terms and want to display the full term text but it's showing a slug instead

I have a form that visitors use to upload files and fill out information about them and a function that adds those files to the media library and set various fields (including some custom taxonomies) on the media library items based on fields that the visitor filled out in the form. The problem is, I have an email address field. When a visitor fills out the email address field with "[email protected]", what is displayed on the Attachment details screen (as …
Category: Web

Standard datasets for Classical Machine Learning tasks

I'm aware of and have worked with many datasets in Classical ML as well as DL. I am also aware of some of the standard datasets in DL (for example ImageNet for Image Classification, etc.) However, I was wondering if there are any standard datasets (or benchmarks for accuracy) for the Classical methods such as Regression, GBM, SVM, etc. More specifically, are there any standard datasets that can be used to measure the accuracy of a new method? Given that …
Category: Data Science

query posts with selected post ids first

Is there a way I can get most recent posts with a couple of posts I specify by post ID listed first? According the docs, the order and orderby parameters may be passed as an array, so in theory I'm wondering if this could be possible. In MySQL query terms, it would essentially produce a result like SELECT * FROM wp_posts ORDER BY ID=12345 desc, ID=12543 desc, post_date desc where it returns post 12345, then 12543, then the rest ordered …
Category: Web

Alt attribute is not showing while the value is given in Media

Here is my website http://www.taramesh.ae/ I'm trying to perform SEO on it and for this I need to set alt attribute for each image. Even I have given it in media but instead, it is not showing when I look it in inspect element or view source. I have found an article related to this alt, title tags not showing but it did not help me as its answer was specific to the theme. I'm using Food & Cook theme …
Category: Web

How to enable error logs and debug mode in WordPress using Azure Cloud?

I am using Azure Cloud, multisite WordPress and have enabled these codes in wp-config.php file. // Enable WP_DEBUG mode define( 'WP_DEBUG', true ); // Enable Debug logging to the /wp-content/debug.log file define( 'WP_DEBUG_LOG', true ); // Disable display of errors and warnings define( 'WP_DEBUG_DISPLAY', true ); @ini_set( 'display_errors', 0 ); // Use dev versions of core JS and CSS files (only needed if you are modifying these core files) define( 'SCRIPT_DEBUG', true ); But there is no change. It shows …
Category: Web

About

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