I tried different codes to be able to use the PageNavi Plugin in category.php, but all were not working. I don't know what was the problem? here is my working category.php code: <?php $cat = get_the_category(); $cat = $cat[0]; $catname = get_cat_name($cat->term_id); $catid = get_cat_ID($catname); ?> <?php $paged = get_query_var('paged', 1); $args = array( 'paged' => $paged, 'post_type' => 'post', 'cat' => $catid, ); $query = new WP_Query($args); global $query_string; query_posts( $query_string . "&posts_per_page=1&paged=".$paged ); while ( have_posts() ) : …
The gist is me wanting to separate system faults from sensor faults given some dataset from a wireless sensor network using a machine learning algorithm. For instance, if I have some temperature sensors in a given area and their corresponding readings from every sort of time interval, I would like to know whether an abnormal value is due to an actual fault, or due to a faulty sensor. Of course, it would be a given that the training set would …
I notice when visiting my blog https://www.datanumen.com/blogs/ via iPhone. Sometimes the first click to the blog title, such as "11 methods to fix...", will not open the blog article. I need to click for the 2nd time, to be able to bring out the blog article. I have used Lamdatest real devices to make the tests, and below are the results: In Canada, Australia. The click will always bring out the article body. In US. The problem will occur, but …
In the skip-gram model, the probability that a word $w$ is part of the set of context words $\{w_o^{(i)}\}$ $(i= 1:m)$ where $m$ is the context window around the central word, is given by: $$p(w_o | w_c) = \frac{\exp{(\vec{u_o}\cdot \vec{v_c)}}}{\sum_{i\in V}\exp{(\vec{u_i}\cdot \vec{v_c)}}} $$ where $V$ is the number of words in the training set, $\vec{u_i}$ is the word embedding for the context word and $\vec{v_i}$ is the word embedding for the central word. But this type of model is defining …
Here is my current code on a plugin. /** * Field Validation. */ public function payment_process() { if ( 'woo_bkash' !== $_POST['payment_method'] ) { return; } $number = sanitize_text_field( $_POST['bKash_acc_no'] ); $trans_id = sanitize_text_field( $_POST['bKash_trans_id'] ); if ( '' === $number ) { wc_add_notice( __( 'Please enter your bKash number.', 'bangladeshi-payment-gateways' ), 'error' ); } if ( '' === $trans_id ) { wc_add_notice( __( 'Please enter your bKash transaction ID.', 'bangladeshi-payment-gateways' ), 'error' ); } } I want to make …
I'm working on a project where two of the features are entryHeading and exitHeading. Both state the direction (N, NE, E, SE, S, SW, W) of a vehicle at multiple points. My question is how would i go about pre-processing this? My first thought would be to circularize it like I would a 24 hour period but I'm not sure I should go about it in the same way. The data will eventually be used to train a Random forest …
I am running into exactly the problem described by this Trac: https://core.trac.wordpress.org/ticket/14365 I see that one of the devs added a Diff here: https://core.trac.wordpress.org/attachment/ticket/14365/14365.api.diff, which looks like it would add the ability to register the exact capability the user should have, to save the options -- without needing the user to have broad "manage_options" capability which I do not want them to have since it exposes too many other things in Admin. OK, so that Diff looks good to me. …
Does current_time('timestamp') have an issue? I am trying to get the current_time('timestamp'), and instead of giving me my current time: Jun 26 2013 14:30 It gives me: Jun 26 2013 21:30 I tried to check the seconds, and it gives me: 1372282238 Which is correct for the time given, but not for the real current time. What's happening?
I have this problem, I've completely deleted all plugins, themes and changed php to 7.1. Nothing is helping. I have the same message: "The site is experiencing technical difficulties. Please check your site admin email inbox for instructions." Are there other areas I can check and see if it works?
I am trying to train a classifier (let's say to classify an object X or not X). But I don't have too much real images of object X which I want to classify. So I made some synthetic images of my own using some photo editing tools, but the problem is after feeding synthetic data my classifier doesn't recognise the real object. And since I had like 2-3 images of real object so I can't feed it more real data. …
I'm in charge of setting up a patient register (100K+ patients) for a non-profit project with little money. This register should provide the basis for later datascience. I'm not sure how a good database solution can work the long run. It must be possible for various clinics to enter the data manually into the system. Since I have experience with Django I have developed a webapp prototype with Django and an SQLite DB (it is not expected that many users …
I want to include backend buttons css on frontend in a plugin? This is how its inluded in backend: http://localhost/wp-admin/load-styles.php?c=1&dir=ltr&load=admin-bar,wp-admin,buttons,wp-auth-check&ver=3.6.1 How to include it in the frontend?
Is there a simple way in orange3 (not writing a Python script) to summarize data and group similar data values? For example, instead of plotting a scatter with lots of data points, I would like to plot just the average y value at every x value. In pandas, this is easily done with groupby().mean(). Is there a similar widget/feature I'm overlooking in orange?
I have some custom user roles for proofreaders which do not have the capability to create posts of my custom post types. Unfortunately I am unable to find out how to remove that capability for the bulit-in post post type. The Members plugin does not show the create_post argument, so I can't set it do deny (false). Thanks for your help.
I understand this falls under the decision making aspect, rather than the probabilistic, but for the purposes of some work I am doing, I need the classifier to have very high precision, as I can't afford a false positive. I do not care about false negatives, and consequently, do not care about recall. Since it is currently a binary classifier, some might say to play with the decision probability threshold from its current 0.5 value, but I will eventually need …
Edit: I have fixed my original issue, please skip to the body for my last remaining issue. I need to make a plugin. That displays an input field to the user, takes that input field data and passess it to a php function, and then reloads that page and displays what ever the user has typed in. What I have in my plugin file function testytest($val1,$val2) { return $val1; } function awepop_add_view() { $idPageToTest = 55; if ( isset($GLOBALS["post"]) && …
I'm having a hard time wrapping my head around the idea that Linear Models can use polynomial terms to fit curve with Linear Regression. As seen here. Assuming I haven't miss-understood the above statement, are you able to achieve good performance with a linear model, trying to fit, say a parabola in a 3d space?
My data has two columns and both are highly correlated e.g. if column1 has value ABC, column2 should be XYZ i.e. ABC-->XYZ. If column2 has anything else it's Anomaly. Likewise, there are thousands of combinations. I already tried KModes clustering where a number of clusters = unique values in column1. However, each cluster does not have equal density hence some bad data with high density is classified as normal and good data with low density is marked anomalous. I want …
I am trying to modify the number of posts per page for archive pages that contain category sticky posts (added by the Category Sticky post plugin) to do so I am using the pre_get_postshook and have tried the following : add_action( 'pre_get_posts', 'my_set_category_posts_per_page' ); function my_set_category_posts_per_page( $query ) { global $wp_the_query; if ( 'category_sticky_post' === $query->get( 'meta_key' ) && ! is_paged ) { $query->set( 'posts_per_page', 8 ); } return $query; } I var_dump($query) I do get [meta_key] => category_sticky_post in …
From my limited understanding, it's quite annoying trying to deploy models like PyTorch. So one would need something like ONNX. But another approach like Golang with a single binary is VERY attractive. I have used Golang before and it's reasonably fast and compiles to one binary easily. For Rust, compiling to a single binary is a nightmare. So I wonder if anyone has seen work that translates XGBoost trees to Golang and uses arrow as the data exchange format? That …
I would like to change archives.php post listing as follows. Whenever clicked on certain link in archives select drop down box, archive page should list posts from May - Dec of that year, plus Jan - April of next year. Eg. If i clicked on archives drop down, 2015...Archives page http://domainname.xyz/2015/ will list all posts from the database starting from May 2015 to December 2015, also January 2016 to April 2016. This is to display posts in an annual year …
I want to show a div notifying online users that there are new posts since they have accessed the page, in the index and also if new posts have been added in the category or tag they are browsing. I have been trying for hours to find a script that does exactly what I need, but I have not found anything exact, and my programming level is very low. Can anybody help me please?
I am trying to use PCA with scikitlearn for feature selection and there is something about PCA that I am not understanding. Can someone please fill in the blanks for me? I have a normalised dataset with 11 components. The output of PCA is: ================================================== Explained Variance: [0.29673715 0.15425831 0.10136684 0.09121094 0.09012841 0.08089791 0.07294822 0.04842635 0.0290573 0.0249145 0.01005407] ================================================== Cumulative Explained Variance: [ 29.67371513 45.09954607 55.23623054 64.35732446 73.37016542 81.45995668 88.75477905 93.5974138 96.50314332 98.9945929 100. ] ================================================== The graph of the …
I am developing a plugin for wordpress. I have created table in SQL for export ID. I need to call back this ID by adding 1. The code I use is as below This is how I query the ID in SQL table. global $wpdb; $last_id = $wpdb->get_var( 'SELECT id FROM ' . $wpdb->prefix . '_bek_exports' . ' ORDER BY id DESC LIMIT 1'); This is how I use it in the code below if ( $export_id == (++$last_id) ) …
I want to pass the 'post title' of current post as parameter into a link For example in this way: <a href='http://example.com/send-cv/?job_position=seller'>apply to job</a> Where the post title would be 'seller' How can I achieve this?
I implemented a self-critical policy gradient (as described here), for text summarization. However, after training, the results are not as high as expected (actually lower than without RL...). I'm looking for general guidelines on how to debug RL-based algorithms. I tried : Overfitting on small datasets (~6 samples) : I could increase the average reward , but it does not converge. Sometimes the average reward would go down again. Changing the learning rate : I changed the learning rate and …
I make some variants of ResNet, originally found in TorchVision, modify them, train them and so on. What I have found is that even in .eval() mode, even if I load state right before evaluation, I receive different results. The code looks like ... imageData = imageDataset.getImage(imageNum) imageData = np.expand_dims(imageData, 0) pytImageData = torch.from_numpy(imageData).cuda() ... self.loadState(self.curEpochNum) model.eval() self.pytOptimizer.zero_grad() with torch.set_grad_enabled(False): activations = model.forward(pytImageData).cpu().numpy() self.loadState(self.curEpochNum) activations2 = model.forward(pytImageData).cpu().numpy() diff = activations2 - activations print('diff', diff.min(), diff.max()) Difference is quite high. I …
Our multisite WordPress installation has a URL of https://xx.com for the main domain, and - for example, https://yy.xx.com as a subsite. We're using WP's in-built domain mapping feature. Media library links are still showing up as http://xx though, so any images used on the subdomains are flagged up as insecure. Only one subdomain - our most recent one - has media library links with a structure https://zz.xx.com. It's possible that the SSL certificate was installed after the other subdomains were …
I want to write a dataframe with a column of the number of week and make it as a row that contains 53 columns (I mean weeks). I really need your help. NOTE THAT: each year has 53 week, and the column week number its like a cycle The data that I have: Date PS Week_Number 0 1980-12-29 43.81 1 1 1981-01-05 81.56 2 2 1981-01-12 69.58 3 3 1981-01-19 92.26 4 4 1981-01-26 108.64 5 ... ... ... ... …
Does torch have the same functionality as tf.image.resize_with_pad? I need to resize a picture and pad it with zeros to a wanted size. E.g: image.shape = [147, 228, 3] -> [224, 224, 3]
I am working on my multi-class classification project and I have a question: I have three classes in proportion: 50%, 47% and 3%. I decided to use class_weight="balanced" parameter in random forest classifier. Now I want to calculate accuracy. Should I use balanced accuracy or can I use common accuracy?
There is this notebook solving housing prices. https://www.kaggle.com/code/jesucristo/1-house-prices-solution-top-1/notebook?scriptVersionId=12846740 and it had this bit of code, can anyone explain the how addition and multiplication and weighs work? features['YrBltAndRemod']=features['YearBuilt']+features['YearRemodAdd'] features['TotalSF']=features['TotalBsmtSF'] + features['1stFlrSF'] + features['2ndFlrSF'] features['Total_sqr_footage'] = (features['BsmtFinSF1'] + features['BsmtFinSF2'] + features['1stFlrSF'] + features['2ndFlrSF']) features['Total_Bathrooms'] = (features['FullBath'] + (0.5 * features['HalfBath']) + features['BsmtFullBath'] + (0.5 * features['BsmtHalfBath'])) features['Total_porch_sf'] = (features['OpenPorchSF'] + features['3SsnPorch'] + features['EnclosedPorch'] + features['ScreenPorch'] + features['WoodDeckSF'])
What I try to achieve is to have the portfolio slug as a page slug also, and when I will assign the page as a parent to another, then that page must look for a specific page's parent ID and return the correct results. If I have the same slug in portfolio and in a page and try to create a child page, then I will get an error. Example: Portfolio slug: test/rent-a-car. Page slug: test/rent-a-car. If I create a …
I'm trying to forecast timeseries with ARIMA. As you can see from the plot, the forecast is one step ahead of the expected values. I read in some other threads that this behavior is expected but how? How can I synchronize? The code I used: history = [x for x in train] predictions = list() for t in range(len(test)): model = ARIMA(history,order=(2, 2, 1)) model_fit = model.fit(disp=0) output = model_fit.forecast(alpha=0.05) yhat = output[0] predictions.append(yhat) obs = test[t] history.append(obs) print('predicted=%f, expected=%f' …
I have to use Fasttext model to return word embeddings. In test I was calling it through API. Since there are too many words to compute embeddings, API call seems to be expensive. I would like to use fasttext without API. For that I need to load the model once and keep it in memory for further calls. How can this be done without using API. Any help is highly appreciated.