Using survival analysis models with uncensored data for time-to-event prediction

Are there any advantages of using survival analysis models like Cox’s proportional hazard model with uncensored data over simple linear regression or other classic ML models? I have data with recurrent events and I try to predict the time of the next event. Data contains about 2000 different subjects and about 60 events per subject. The percentage of censored data (the last event of each subject) is small, and I don't think it plays a big role in the prediction.
Category: Data Science

Fix wp_term_relationships slow query in get_posts

I used the Query Monitor plugin to find slow query on my WordPress site. The below-mentioned WP_Query->get_posts() takes about 0.3446 query time out of the total Database Query time of 0.3976. SELECT wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND wp_posts.ID NOT IN (203598) AND ( wp_term_relationships.term_taxonomy_id IN (17) OR wp_term_relationships.term_taxonomy_id IN (11652,20693,21952,23971,24907,24908,25928) ) AND wp_posts.post_type = 'post' AND ((wp_posts.post_status = 'publish')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 6 I'm guessing it …
Category: Web

Which supervised ML model to use for exam/grade prediction?

So I plan on making a mobile app that will let students predict their final grades based on their mock exam results. I can train my model with previous years results. X: 5 mock results Y: Final grade obtained However, I have the issue that sometimes, or most the times, the user may be using the app whilst not having taken ALL the mock exams yet, they may want to see if they are on track and use it once …
Category: Data Science

Search one 2D distribution for point cluster most similar to another 2D distribution

Given a hand drawn constellation (2d distribution of points) and a map of all stars, how would you find the actual star distribution most similar to the drawn distribution? If it's helpful, suppose we can define some maximum allowable threshold of distortion (e.g. a maximum Kolmogorov-Smirnov distance) and we want to find one or more distributions of stars that match the hand-drawn distribution. I keep getting hung up on the fact that the hand-drawn constellation has no notion of scale …
Category: Data Science

Should I rinse my grapes before crushing?

I picked about 20 5 gal buckets of grapes and will see little white spiders, earwigs, dust, crushed dry grape leaves, little stems, etc in with the clusters. Is it recommended to hose these down gently before putting them through the crusher? Is it important to let them dry off before putting them through the crusher? The hose water is potable.
Category: Mac

How to Rewrite the URL

Here I mentioned the url http://localhost/wp/2016/?category_name=cricket now i need to rearrange the url like http://localhost/wp/cricket/2016. here cricket is category name and 2016 is year. Remove the ?Query String Variable not a value of the querystring in the wordpress URl. I tried RewriteRule ^([0-9]{4})/?$/(.+)/([^/]+)/?$ /index.php/$1/?category_name=$2[QSA,L] But Not Working
Category: Web

How to interpret a specific feature importance?

Apologies for a very case specific question. I have a dataset of genes, with which I am using machine learning to predict if a gene causes a disease. One of the features I have is a beta value (which is the effect size of the gene's impact on the disease), and I'm not sure how best to interpret and use this feature. I condense the beta values from the variant level to the gene level, so a gene is left …
Category: Data Science

How to fetch Data in WordPress using MySQLi or $wpdb

I have custom table like this: useraw 1. id (Primary*) 2. user_ip 3. post_id 4. time I am inserting data in the table using $wpdb->insert($table_name , array('user_ip' => $user_ip, 'post_id' => $postID, 'time' => $visittime),array('%s','%d', '%d') ); There are four rows I inserted using this code: id : 245 user_ip : 245.346.234.22 post_id : 24434 time : 255464 id : 345 user_ip : 245.346.234.22 post_id : 23456 time : 23467 id : 567 user_ip : 245.346.234.22 post_id : 57436 time …
Category: Web

How Add Code in Page Index Custom Template?

I want to display a code in a Custom Page (Index-sitemap) created in the theme folder. But when I use the following code it just shows up on the Homepage. if(is_home() && ! is_front_page()) { echo 'code'; } Show in Home and also in index-sitemap if(! is_home() && ! is_front_page()) { echo 'code'; } Not Showing in Home but also not showing in index-sitemap if(is_page(index-sitemap) && ! is_front_page()) { echo 'code'; } not Showing too. if(is_page(index-sitemap) && is_front_page()) { echo …
Category: Web

installing wordpress with docker on centos7

I am installing wordpress with docker on centos7 linux OS.I have installed mysql container successfully and got an error when i wanted to install wordpress container showing "docker:Error response from daemon:driver failed programming external connectivity on endpoint :Error starting userland proxy:bind address already in use.Please find attached the snapshot of my error page and the snapshot showing my http ports(80 & 443)
Category: Web

How do I remove images from all posts?

I have many posts on my news site, I have a space issue, I would like for posts older than three months, to remove the images that are in the post, but keep the featured images and the post itself. Please help, I have no idea how to do this.
Category: Web

Search using specific meta fields only (excluding post title and content)

I have a custom post type my_cpt with 9 custom meta fields like first_name, last_name, location, phone, email etc along with post title and post content. Now what I want is to search using first_name and last_name fields only. See this sample post- Post Title: New Player (post title field of WP editor) Description: Lorem ipsum dolor sit (post content field of WP editor) first_name: John (custom meta) last_name: Doe (custom meta) phone: 123466789 (custom meta) email: [email protected] (custom meta) …
Category: Web

Customer Segmentation: Should I use a variable, representing a product, that is unpopular in the dataset for K-Means Clustering?

I am working with a data set that, besides customer age and income, tells the balance a customer has in different type of bank accounts: Checking, Shares, Investment, Savings, Deposit, Mortgage, Loan, and Certificates. For accounts other than Checking, 0 represents that the account does not exist for the customers. There are 9800 customer observations with roughly 6000 checking accounts and 4000 savings accounts. For the others, the observations are less than 300. I have to use K-Means Clustering analysis …
Category: Data Science

current-menu-item class in CSS

I have created one main Page(Home Page) and many custom links in wp-admin. All custom links are linked to sections of Home Page. Example: Custom link About Us has a URL = #section1 and in my code I have linked it to: <div id="section1"> Text </div> In my CSS I have used .current-menu-item to highlight clicked link in menu: .site-header div.nav-wrap nav ul li.current-menu-item a:link, .site-header div.nav-wrap nav ul li.current-menu-item a:visited { color: #fff; text-shadow: -1px 1px 8px #ffc, 1px …
Category: Web

Merging two datasets with different features for machine learning prediction

I'm trying to create a model which predicts Real estate prices with xgboost in machine learning, my question is : Can i combine two datasets to do it ? First dataset : 13 features Second dataset : 100 features Thé différence between the two datasets is that the first dataset is Real estate transaction from 2018 to 2021 with features like area , région And the second is also transaction but from 2011 to 2016 but with more features like …
Category: Data Science

macro average and weighted average meaning in classification_report

I use the "classification_report" from from sklearn.metrics import classification_report in order to evaluate the imbalanced binary classification Classification Report : precision recall f1-score support 0 1.00 1.00 1.00 28432 1 0.02 0.02 0.02 49 accuracy 1.00 28481 macro avg 0.51 0.51 0.51 28481 weighted avg 1.00 1.00 1.00 28481 I do not understand clearly what is the meaning of macro avg and weighted average? and how we can clarify the best solution based on how close their amount to one! …
Category: Data Science

Why does Light GBM model produce different results while testing?

Using the Light GBM regressor, I have trained my data and, using Grid Search, I got the best parameters, but while testing with the best parameters I am getting different results each time, which means the model produces different results for each test iteration. I ran the lightgbm twice with the same parameters, but got different results in validation. I found the only random seed parameter to be baggingSeed. After fixing baggingSeed, the problem also occurred. Should I fix any …
Category: Data Science

pre_get_posts with WP_Query to prevent posts from specific tags

I found this post about how to change a specific query but can't find a way to do the following: I have several queries on homepage retrieving posts from categories, posts from "New"s, posts from "Recipes", posts from "Promo" etc I have a slider area at the top that display posts from all categories that uses the tag "featured" How can I prevent all other queries on home from retrieving posts using "featured" tag so posts using the tag do …
Category: Web

Facebook picture labeling

I want to train a neural network and use open CV for facial recognition. Nicholas Martin, whose a user here on SE told me that this is a supervised learning class (clearly). So I need pictures and corresponding labels. So I thought hey! Maybe Facebook could be of help. So how can I label potentially millions of facebook pictures? Would it be by the user's profile name or is there a way to find out the name of the person …
Category: Data Science

What is the difference between Pachyderm and Git?

I learned that tools like Pachyderm version-control data, but I cannot see any difference between that tool with Git. I learned from this post that: It holds all your data in a central accessible location It updates all depending data sets when data is added to or changed in a data set It can run any transformation, as long as it runs in a Docker, and accepts a file as input and outputs a file as result It versions all …
Category: Data Science

the_post() within switch_to_blog() altering my excerpt

I have a strange problem I'm facing when using WP_Query with multisite in a plugin I'm writing which hooks into add_meta_boxes. I'm wanting to display all post titles in a dropdown in a meta box. While adding or editing a post in blog no. 2 (it could be any blog no.), I am looping through blog no. 1 and getting post titles from a custom post type to populate in a select dropdown. This works as it should, but in …
Category: Web

What is the appropriate machine learning algorithm for this problem?

I have a dataset in which each sample contains a user id, a date, and the status associated with that particular user (active, expired & deactivated). The dataset contains records for a full year, but there are several days missing, and the goal of the project is to predict the status of a user on these missing days. Below is an example of one record: { "date": "20190101", "user": "301727881", "status": "active" }, Because the value of the variable I …
Category: Data Science

Subsampling the “right” amout of data to train an ML model

I am training a machine learning model (i.e., a classifier) on a large dataset. I know that I can get the same results using less data (about 30%) but I would like to avoid the trial and error process to find the 'right' amount of data to retain from the dataset. Of course I can create a script which automatically tried different thresholds but I was wondering if there is any principled way of doing this. It seems strange that …
Category: Data Science

Which machine learning models allow online training and which don't?

I am working on a project where I have to update my model every time I get feedback x times. For example, showing an Advertisement on an App and then, when the person doesn't click on in it after seeing it multiple times in a day generates negative example. When they do that's positive. My initial dateset is not very big (<20,000) but it's going to significantly increase in future. I am starting with models like logistic Regression, SVM, XGBoost …
Category: Data Science

In a multisite, how can I get posts from one site and display their permalinks in another site?

I have a WordPress multisite with one main site and four sub-sites. In a PHP template on my main site, I would like to get the posts from one of the sub-sites and print the permalinks to the page. How is this done? My code is below--when this code is executed, permalinks are indeed printed to the screen, but they are incorrect--the post name is correct, but the path is incorrect. $tp_blog_id = 4; switch_to_blog( $tp_blog_id ); $posts = get_posts( …
Category: Web

I have a folder with 25000 images with cats and dogs picture - how to use tf.keras.utils.image_dataset_from_directory?

I am using vats-vs-dogs data set where the subdirectories are not precreated. Only 1 folder with 25000 images. (cat.001.jpg.... etc then dog.342.jpg.... etc) all in one folder. There are no separate folders called /cats or /dogs. How to use tf.keras.utils.image_dataset_from_directory function in such case ? Do I need to explicitly compartmentalize all dogs in /dog and all cats into /cats and then do it ? img_height = 300 img_width = 300 training_dir = 'drive/MyDrive/training1/dog-cat-train/train' train_ds = tf.keras.utils.image_dataset_from_directory( training_dir, labels='inferred', label_mode='categorical', …
Category: Data Science

Sentiment Analysis Label Distribution

I am working on Sentiment Analysis model. The dataset I have has three labels: positive, negative and neutral. But the problem is the data is not equal for labels. Say out of 100K : 75 K are neutral, 15K positive and 10K negative. I wanted to know whether it is necessary to choose equal distribution of labels while training or I can go ahead with unequal data and if so till what extent? Are there any ways to deal with …
Category: Data Science

Show or hide custom menu widget in side bar conditionally

I have been trying and searching to accomplish this. I have the "custom menu" widgets "Members Area", "Admin Area" in side bar, assigned menus to them. Fine, they display. I want to show "Admin Area" widget only when the current user is admin. I believe it has something to do with adding a filter to "sidebars_widgets". Honestly, i do not have a clue to target the "Admin Area" widget. How do I handle this ?
Category: Web

Is there CSS to expand the gallery limit on Index Pages?

On a wordpress index page, I am only allowed to add 12 galleries. I would like to add many more. Is there a way that I can expand the gallery limit allowed on index pages? If this is not possible, is there a way that I can add multiple index pages to a folder page? Thank you for any help
Topic: php css Wordpress
Category: Web

Fill the exclude array() in get_posts()

I'm using this code to populate the dropdown menu in a meta box. $parents = get_posts( array( 'post_type' => 'jhk_story', 'orderby' => 'ID', 'order' => 'ASC', 'numberposts' => -1, 'exclude' => array(121, 131, 138), ) ); This post_type contains the parents of a post_type 'jhk_frames', which are the only child. So, the children contain in their post_parent field the post_ID of their parent. The parent contains in their post_parent field still the default zero. My question is: how do I …
Category: Web

Is a dense layer required for implementing Bahdanau attention?

I saw that everyone adds Dense( ) layer in their custom Bahdanau attention layer, which I think isn't needed. This is an image from a tutorial here. Here, we are just multiplying 2 vectors and then doing several operations on these vectors only. So what is the need of Dense( ) layer. Is the tutorial on 'how does attention work' wrong?
Category: Data Science

Front end post delete error confirmation and success message

I am allowing Authors to delete their posts on the front end as they cant access the admin. I have this working, but what bothers me is the standard javascript onclick alert message - is there are way to style a js alert? From my understanding, no. Or to use jQuery for the message and use a modal window that I can style? Also, after deletion the user is returned to the same page which is good, but there is …
Category: Web

Why convolutional layer learns only biases?

I`m training a siamese CNN to distinguish between pairs of images and though my train/val binary cross-entropy loss values show negative trend, implying some of the model parameters are being updated, I noticed that convolution kernels barely change while their biases change significantly tensorboard weights histogram image. Also, while loss value decreases, accuracy appears to be frozen for some epochs and then instantly shoots up accuracy and loss plots. Q1: If this is caused by vanishing gradient, why would it …
Category: Data Science

Co-joining multi-peak histograms

I am analysing a bunch of data files which represent responsiveness of cells to addition of a drug. If a drug is not added, cell responds normally, if it is added, it shows abnormal patterns: , . We decided to analyse this using an amplitude histogram, in order to distinguish between a change in amplitude and in change of a probability of elliciting the binary response. What we get with file 1 is : So we fit a pdf on …
Category: Data Science

About

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