Time series classification but with a sequence in output

I'm using Python and I have a training set of sequences of this shape: (None, 9, 25), where: 9 are rows representing years from 2012 to 2020 25 are features. So each of this 25 features has a value for each year going from 2012 to 2020. As target (labels) I have, for each sequence of (9,25), a list of 9 elements representing a number (either 0 or 1) associated to each year, so a possible label for a certain …
Category: Data Science

Data Science Podcasts?

What are some podcasts which are related to data science? This is a similar question to the reference request question on CrossValidated. Details/rules: The podcasts (the theme and the episodes) should be related to data science. (For example: A podcast which is about some other domain, with an episode which speaks about data science in that domain, is not a good reference/answer.) Personal opinions/reviews (if any) would be very helpful too.
Category: Data Science

New wordpress keep redirecting to localhost/wp-admin/install.php

IN my fresh wordpress install via docker. Everytime i hit localhost it gets redirected to http://localhost/wp-admin/install.php Now its missing the wp , the url should be http://localhost/wp/wp-admin/install.php My Env variable is like this WP_ENV=development WP_HOME=http://localhost/wp WP_SITEURL=${WP_HOME}/wp my apache vhost file is <VirtualHost *:80> ServerName http://localhost DocumentRoot ${APACHE_DOCUMENT_ROOT} <Directory ${APACHE_DOCUMENT_ROOT}> AllowOverride all </Directory> CustomLog /var/log/apache2/local-access.log "combined" ErrorLog /var/log/apache2/local-error.log </VirtualHost>
Category: Web

Create 3 buttons for new post for a different category

I am customizing the admin panel of WordPress. I have users with roles to only write to 3 categories. I would like to design 3 buttons or divs to create a new post but each one for a different category. That in the dashboard. I will have a different dashboard for role user Any idea?
Category: Web

Discriminator of a Conditional GAN with continuous labels

OK, let's say we have well-labeled images with non-discrete labels such as brightness or size or something and we want to generate images based on it. If it were done with a discrete label it could be done like: def forward(self, inputs, label): self.batch = inputs.size(0) h = self.res1(inputs) h = self.attn(h) ... h = self.res5(h) h = torch.sum((F.leaky_relu(h,0.2)).view(self.batch,-1,4*4), dim=2) outputs = self.fc(h) if label is not None: embed = self.embedding(label) outputs += torch.sum(embed*h,dim=1,keepdim=True) The embedding can be made to …
Category: Data Science

How would I check the validity of covariates in my linear model on several hundred datasets?

I have this linear model with predictors that I need to prove are statistically significant and pass the necessary lm assumptions. I know for a single dataset, I can use various LM tests, but the problem is I have several hundred datasets which cannot be combined. Coefficients may be different for each dataset, but I just need to prove(or disprove) that the covariates can be used for lm across all models. I'm assuming I shouldn't run tests on each LM …
Category: Data Science

Dynamically added custom fields not displayed on WooCommerce email notifications

I have a different kind of scenario then the typical custom fields (I suppose). I am not getting custom values (fields) from user in the form rather I have an implementation which adds: ColorName Size City These are from a custom product flow which adds custom attributes to the cart, here is how I am doing that: add_action('wp_ajax_wdm_add_user_custom_data_options', 'wdm_add_user_custom_data_options_callback'); add_action('wp_ajax_nopriv_wdm_add_user_custom_data_options', 'wdm_add_user_custom_data_options_callback'); function wdm_add_user_custom_data_options_callback() { // print_r($_POST); $productIDM = $_POST['product_id']; // case swith switch ($productIDM) { case "Ace Dura Silk": $productID …
Category: Web

How do you remove header sitewide from mobile only?

I'm having trouble hiding my header on mobile devices. My wordpress theme does not have an option to hide it, so I was looking at the theme's header.php file if there was anything I could add to it. Haven't been able to figure out a solution, any ideas?? Thanks <?php /** * The header for our theme * * This is the template that displays all of the <head> section and everything up until <div id="content"> * * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials …
Category: Web

How to query images from a post to use in a slider

I am trying to pull images as attachments from a particular post (custom post), ...and I'm using the example within WordPress codex codex example to display all images as a list ...except the images in that post keep repeating about 3 or 4 times (I have a total of 7 images attached to that post). no matter what I set the numberposts to or the post_per_page, I keep getting repeated images, about 28 when I should only have the seven. …
Category: Web

Unable to Update Post when Changing Site URL

I have a wordpress subdomain on my site: https://cdn.example.com, however I am proxying this site to be displayed on my root domain for SEO purposes. Whenever I navigate to https://example.com/blog I am shown content from the CDN subdomain. However, I updated the wordpress site URL to be https://example.com/blog so that the hyperlinks are directed to the blog subpath. This works fine, but breaks the functionality for updating posts. It is attempting to send the update requests to the wp API …
Category: Web

Fix first two levels of decision tree?

I am trying to build a regression tree with 70 attributes where the business team wants to fix the first two levels namely country and product type. To achieve this, I have two proposals: Build a separate tree for each combination of country and product type and use subsets of the data accordingly and pass on to respective tree for prediction. Seen here in comments. I have 88 levels in country and 3 levels in product type so it will …
Category: Data Science

List all images from a single post meta value

I have created a custom post type with an image gallery upload. Now I am trying to display the gallery on the front end. This is what I have so far that works to display 1 image, but if multiple images are uploaded all the URLs get stuck in the src tag. So I'm guessing I should loop through that array and spit out each one separately? Would that be the route to go and if so how can I …
Category: Web

Custom field and category query

I have created custom .php file that should show list of all posts that correspond to user's choice. I have 3 custom fields and 1 category condition. I've tried all the queries i could possibly find in wordpress codex database but nothing seems to work. I've created 3 custom fields: a_field,a_fieldd,a_fielddd (and ofcourse i have posts with those fields already posted for the test) now I just want to show all of the posts with custom fields with specified values …
Category: Web

What's the right input for gpt-2 in NLP

I'm fine-tuning pre-trained gpt-2 for text summarization. The dataset contains 'text' and 'reference summary'. So my question is how to add special tokens to get the right input format. Currently I'm thinking doing like this: example1 <BOS> text <SEP> reference summary <EOS> , example2 <BOS> text <SEP> reference summary <EOS> , ..... Is this correct? If so, a follow-up question would be whether the max-token-length(i.e. 1024 for gpt-2) means also the concatenate length of text and reference summary? Any comment …
Category: Data Science

How to Implement Search Functionality?

<div class="col-lg-8"> <div class="row"> <?php $search_term = get_search_query(); $term = get_term_by('slug', $search_term, 'blog_taxonomy'); $term_name = $term->name; $args = array( 'post_type' => 'blog', // 'title' => $search_term, 'tax_query' => array( array( 'taxonomy' => 'blog_taxonomy', 'field' => 'slug', 'terms' => $search_term, 'orderby' => array( 'date' => 'DESC', ), ), ), ); $loop = new WP_Query($args); if ($loop->have_posts()) { while ($loop->have_posts()) { $loop->the_post(); ?> <div class="col-lg-6 col-md-6"> <div class="blog-content radius30 cB-shadow cBorder mw-100"> <div class="blog-img text-center position-relative"> <div class="date-time position-absolute"> <div class="date"> <h6><?php …
Category: Web

Incremental learning on Autoencoder for anomaly detection

I want to incrementally train my pre-trained autoencoder model on data being received every minute. Based on this thread, successive calls to model.fit will incrementally train the model. However, the reconstruction error and overall accuracy of my model seems to be getting worse than what it initially was. The code looks something like this: autoencoder = load_pretrained_model() try: while True: data = collect_new_data() autoencoder = train_model(data) # Invokes autoencoder.fit() time.sleep(60) except KeyboardInterrupt: download_model(autoencoder) sys.exit(0) The mean reconstruction error when my …
Category: Data Science

Calculate features on stationary time-series data

I am trying to create a deep learning model that predicts the future price of crypto currencies based on past data. I downloaded the Open, High, Low, Close and Volume (OHLCV) data from yahoo finance and made it stationary by differencing it. Now I also want to calculate some technical indicators from the OHLCV data. For example the simple or exponential moving average. I'm guessing that the calculated features also need to be stationary. Is that correct? So do I …
Category: Data Science

Deep learning based Resume Parser and Scoring

I want to know if Deep learning can be used for Resume Parsing and scoring of the resume. Currently what I am doing is extracting the text from pdf or image using OCR/tesseract and finding the features like Email, Mobile No, Skills, Tenure, No of Companies, Awards etc from the text. So I have close to 100 features which are important for scoring the resume. Can we do similar thing using Deep learning and will the accuracy be better ? …
Category: Data Science

How can we upload file to root directory of wordpress

I'm working on wordpress project, Theme have some demos i've added add_menu_page where all of the demos stored e.g pictures and names, I know the REST-API where i've added condition if theme license is correct then give file, But i don't know how to add that file in theme directory of wordpress when user will click and remove previous one or overwrite previous file.
Category: Web

Assigning a category to a custom post type in Wordpress

I am working with custom posts to create a 'document' custom post type and then trying to assign the category during wp_insert_post, have tried using both post_category and tax_input to no success. I am registering the custom post as below, keeping in the relevant bits below so it does have $labels defined and a few more $args that I have stripped out. My research has indicated that permissions need to be created in the custom post type before assigning them …
Category: Web

Homepage has Paged Pages that should not exist, like /page/2/ and on to /page/99999/

The backstory is I noticed the homepage was generating infinite paginated pages. This is a custom built theme. I was using index.php and WP_Query to create 2 small 5 post loops. I figured WP_Query was pulling all of the qualifying posts and then limiting to the most recent 5, so I switched to get_posts with a foreach loop, since my understanding is that doesn't fetch all the posts, only the ones you ask for (and therefore no need for pagination). …
Category: Web

How to add custom meta to 'pre_get_terms'?

I have a custom taxonomy with custom meta. I have added the custom meta values to columns in the admin list page just fine. But if I search for values that are in these columns nothing is found. I'm assuming I need to use pre_get_terms, but am having trouble figuring out how to include the meta in the query. Here is what I am trying to do to test one of the fields, but results are still negative. add_action( 'pre_get_terms', …
Category: Web

How solved "ValueError: y should be a 1d array, got an array of shape () instead."?

from tkinter import * from tkinter import ttk from tkmacosx import Button top = Tk() top.title("Jobs") top.geometry("1000x800") line1 = LabelFrame(top, text='') line1.pack(expand = 'yes', fill = 'both') n = StringVar() categorychoosen = ttk.Combobox(line1, width = 27, textvariable = n) # Adding combobox drop down list categorychoosen['values'] = ('Advocate','Arts','Automation Testing','Blockchain','Business Analyst', 'Web Designing') categorychoosen.place(x=50, y=150) categorychoosen.current() name=Label(line3,text="Welcom to ... company",font =("Arial", 10)) name.place(x=0, y=0) n1 = StringVar() sectionchoosen = ttk.Combobox(line3, width = 27, textvariable = n1) # Adding combobox drop down …
Category: Data Science

Problem when cherry picking actions - Proximal Policy Optimization

I am using the implementation of PPO2 in stable-baselines (a fork of OpenAI's baselines) for a Reinforcement Learning problem. My observation space is $9x9x191$ and my action space is $144$. Given a state, only some actions are "legal". If an "illegal" action is taken, the environment will return the same state. Think of it as the game of Go, where you try to place a stone on an intersection that is already occupied. When a legal action is taken, it …
Category: Data Science

Use Parent Pages for URL Structure without Landing Page

So this is more a philosophical question than anything, and if I'm asking this in the wrong place, I'm happy to remove the post: What's the best way to use a parent page for structure while keeping that page inaccessible to users? I'm running into two issues: First, I want to use the parent page in the main menu so that I can take advantage of WordPress's current-menu-parent and like classes for styling purposes. I know that normally you can …
Category: Web

How do I disable the built-in editor and automatically configure the properties of new pages?

I use a Builder plugin on the site. Members are editors and can create their own page. I want to disable Gutenberg so that they can only edit pages with Buldir. I would also disable the properties of the page for them and I would enter it automatically. When I create a new page, I disable comments, the template is Blank Page, do not access the Custom fields. You can practically just add a featured image and title to your …
Category: Web

Accuracy drops when adding a fully connected layer for dimensionality reduction to a ResNet50

I'm training a ResNet50 for image classification and I'm interested in decreasing the dimensionality of the embedded layer, in order to apply some clustering techniques. The suggested dimension is something in the range 64-256, so I thought I'd start from 128. I'm using PyTorch. After loading the pretrained ResNet50 from the official release I would usually do this: model = t.load(cfg.resnet_path) model.fc = nn.Sequential(nn.Linear(in_features = 2048, out_features = num_classes, bias = True)) Everything worked and I reached an accuracy of …
Category: Data Science

Why can I not view image attachment pages?

I have a problem with images. I can see my uploaded images, as previously, through the media library. I can access each image by clicking on "edit". But if I then click on "View Attachment Page", I am taken to the "404! We couldn't find the page!" message. This applies to all images in the library. At the same, images in some posts (but not all) are behaving differently from before. It used to be possible for readers to click …
Category: Web

website redirects to homepage for all 404 pages, wp-cron and admin-ajax.php

My multisite WP website is redirecting all the 404, wp-cron.php, and admin-ajax.php to the homepage when the user is not logged in. .htaccess rules: RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ - [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] RewriteRule . index.php [L] Please help me fix it. Thank you.
Category: Web

Unable to generate useful insights on a highly cardinal data

I'm working on CRM data, did some cleaning, encoding and ran a decision tree classifier from which i plotted a feature_importance graph From that I found that Sales person column is one of the important feature which is highly cardinal column(around 1300+ categories/sales person). Now i'm trying to generate some insights on this column with respect to target column(binary values). Would like to know in general how to create insights from such a large categorical column? P.S: Other columns are …
Category: Data Science

LSTM model bad forecasts

I tried to implement LSTM model for time-series prediction. Below is my trial code. This code runs without error. metrics = ['mean_squared_error', 'mean_absolute_error', 'mean_absolute_percentage_error'] # define model model = Sequential() model.add(LSTM(100, activation='relu', input_shape=(n_past, 6), return_sequences=True)) model.add(LSTM(100, activation='relu', return_sequences=True)) model.add(LSTM(50, activation='relu')) model.add(Dense(2, activation='relu')) model.compile(optimizer='adam', loss='mse', metrics=metrics) model.summary() ) The forecast correctly predicts the peaks, but the constant values ​​should be 0 and you cannot predict it. However, prediction is extremely poor. How to improve the predictin? Do you have any ideas …
Category: Data Science

About

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