text stringlengths 81 47k | source stringlengths 59 147 |
|---|---|
Question: <p>I implemented regression model with interactions using Julia <code>GLM</code> package:</p>
<p><code>Reg = lm(@formula(dep_var ~ var1&var2&var3), data, true)</code>.</p>
<p>Fitting this formula requires a lot of RAM (> 80 GB), but I noticed that the calculations are performed on one core, althoug... | https://stackoverflow.com/questions/64470373/parallel-multithreading-version-of-linear-regression-in-julia |
Question: <p>Matlab has built in logistic regression using mnrfit, however I need to implement a logistic regression with L2 regularization. I'm completely at a loss at how to proceed. I've found some good papers and website references with a bunch of equations, but not sure how to implement the gradient descent algor... | https://stackoverflow.com/questions/9369379/implementing-logistic-regression-with-l2-regularization-in-matlab |
Question: <p>I'm trying to implement a linear regression with gradient descent as explained in this article (<a href="https://towardsdatascience.com/linear-regression-using-gradient-descent-97a6c8700931" rel="nofollow noreferrer">https://towardsdatascience.com/linear-regression-using-gradient-descent-97a6c8700931</a>).... | https://stackoverflow.com/questions/58996556/implementing-a-linear-regression-using-gradient-descent |
Question: <p>How can I implement stratified sampling in a randomForest <strong>regression</strong> in R? I know that the strata and sampsize parameters are used in randomForest classification problems, but I get
Error in { : task 1 failed - "sampsize should be of length one."</p>
<p>My data:</p>
<pre><code>x <- s... | https://stackoverflow.com/questions/49197422/how-to-implement-stratified-sampling-in-randomforest-regression-in-r |
Question: <p>I'm trying to Implement linear regression in python using the following gradient decent formulas (Notice that these formulas are after partial derive)
<a href="https://i.sstatic.net/EQcjo.png" rel="nofollow noreferrer">slope</a>
<a href="https://i.sstatic.net/bhJsz.png" rel="nofollow noreferrer">y_intercep... | https://stackoverflow.com/questions/74825378/implementing-linear-regression-from-scratch-in-python |
Question: <p>I was trying to implement Linear Regression in Octave 5.1.0 on a data set relating the GRE score to the probability of Admission.
The data set is of the sort,</p>
<blockquote>
<p>337 0.92 <br>
324 0.76 <br>
316 0.72 <br>
322 0.8 <br>
. <br> . <br> . <br></p>
</blockquote>
<p>My main Program.m f... | https://stackoverflow.com/questions/56364169/linear-regression-implementing-feature-scaling |
Question: <p>Proposed in RetinaNet, Focal Loss is a efficient solution to class imbalance for classification problem. But data imbalance can also occur in regression problem. Is there any implementation of focal loss in regression problem?</p>
Answer: | https://stackoverflow.com/questions/70449172/is-there-an-implement-of-focal-loss-for-regression-problem |
Question: <p>I am having some difficulties in implementing logistic regression, in terms of how should I should proceed stepwise. According to what I have done so far I am implementing it in the following way:</p>
<ul>
<li><p>First taking <code>theta</code> equal to the number of features and making it a <code>n*1</co... | https://stackoverflow.com/questions/45705490/logistic-regression-implementation |
Question: <p>I'm trying to create a non-linear logistic regression, i.e. polynomial logistic regression using scikit-learn. But I couldn't find how I can define a degree of polynomial. Did anybody try it?
Thanks a lot!</p>
Answer: <p>For this you will need to proceed in two steps. Let us assume you are using the iris... | https://stackoverflow.com/questions/55937244/how-to-implement-polynomial-logistic-regression-in-scikit-learn |
Question: <p>I'am trying to implement logistic regression with sgd. My dataset is splited like <code>train_features.npy</code>, <code>train_labels.npy</code>, <code>test_features.npy</code>, <code>test_labels.npy</code>. My sgd function is here:</p>
<pre><code>def stoch_grd_dcnt(train, batch_size, n0, n1, max_epoch, de... | https://stackoverflow.com/questions/65860488/trying-to-implement-logistic-regression-with-stochastic-gradient-descent-but-get |
Question: <p>I am working on a uni assignment where I need to implement <code>Softmax Regression</code> with <code>Pytorch</code>. The assignment says:</p>
<pre><code>Implement Softmax Regression as an nn.Module and pipe its output with its output with torch.nn.Softmax.
</code></pre>
<p>As I am new to pytorch, I am not... | https://stackoverflow.com/questions/64783744/how-to-implement-softmax-regression-with-pytorch |
Question: <p>I have to implement a logistic regression and regularise with lasso or ridge and then calculate the RSS choosing the model that will shrinks up to 10 features or less.
I tried, using the package glmnet</p>
<pre><code>x <- Train_set %>% dplyr::select(-Diag) %>% as.matrix()
y <- Train_set$Diag... | https://stackoverflow.com/questions/60479134/how-to-implement-logistic-regression-with-lasso-or-ridge |
Question: <p>Is there any function that does this? I keep searching and the closest match is <strong>regression</strong>, but it's for the simple linear regression. In Matlab R2015a they have implemented <strong>regress</strong>, but I don't have that version.</p>
<p>Thanks.</p>
Answer: <p>Both <code>fitlm</code> and... | https://stackoverflow.com/questions/30751080/multiple-linear-regression-in-matlab-r2014a |
Question: <p>I would love to use a linear LASSO regression within statsmodels, so to be able to use the 'formula' notation for writing the model, that would save me quite some coding time when working with many categorical variables, and their interactions. However, it seems like it is not implemented yet in stats mode... | https://stackoverflow.com/questions/43446919/is-lasso-regression-implemented-in-statsmodels |
Question: <p>I am trying to implement a Neural Network for predicting the h1_hemoglobin in PyTorch. After creating a model, I kept 1 in the output layer as this is Regression. But I got the error as below. I'm not able to understand the mistake. Keeping a large value like 100 in the output layer removes the error but r... | https://stackoverflow.com/questions/72874433/neural-network-for-regression-using-pytorch |
Question: <p>I’m trying to implement the Partial Least Squares Regression model in R using the <code>pls</code> package. The following data frame represents my data, where I have two response variables and three explanatory variables.</p>
<pre><code>library(pls)
df <- data.frame(x1 = rnorm(20),
x2 =... | https://stackoverflow.com/questions/73818502/problem-implementing-partial-least-squares-regression |
Question: <p>I want to run Lasso regression using TensorFlow. As the Lasso regression is simply adding L1-norm to the cost, I am going to define my cost term as</p>
<pre><code>cost = RSS + tf.nn.l1_norm(Weight) or
cost = RSS + tf.reduce_sum(tf.abs(Weight))
train = tf.train.GradientDescentOptimizer(cost)
</code></pre>
... | https://stackoverflow.com/questions/39815728/implementing-lasso-regression-using-tensorflow |
Question: <h3>Problem Context</h3>
<p>I am trying to learn Neural Networks in Python, & I've developed an implementation of a Logistic Regression based NN.</p>
<p>Here is the code - </p>
<pre><code>import numpy as np
# Input array
X = np.array([[1, 0, 1, 0], [1, 0, 1, 1], [0, 1, 0, 1]])
# Output
y = np.array([... | https://stackoverflow.com/questions/47626075/implement-a-regression-classification-neural-network-in-python |
Question: <p>I recently tried implementing linear regression in octave and couldn't get past the online judge. Here's the code</p>
<pre><code>function [theta, J_history] = gradientDescent(X, y, theta, alpha, num_iters)
m = length(y); % number of training examples
J_history = zeros(num_iters, 1);
for iter = 1:num_ite... | https://stackoverflow.com/questions/54104134/linear-regression-implementation-in-octave |
Question: <p>I'm trying to implement linear regression using the gradient descent method from scratch for learning purposes. One part of my code is really bugging me. For some reason the variable <code>x</code> is being altered after I run a line of code and I'm not sure why. </p>
<p>The variables are as follow. <code... | https://stackoverflow.com/questions/14993454/linear-regression-gradient-descent-python-implementation |
Question: <p>I have searched for different portals and even in h2o ensemble documentation and all I have got ensemble examples for only classification problem binary in nature but not a single example showing how to implement general stacking or h2o ensembling for a simple regression problem in r </p>
<p>I request an... | https://stackoverflow.com/questions/48490900/code-for-h2o-ensemble-implementation-in-r-for-regression-in-r |
Question: <p>Following this example implementation of Logistic Regression from scikit-learn :
<a href="https://analyticsdataexploration.com/logistic-regression-using-python/" rel="nofollow noreferrer">https://analyticsdataexploration.com/logistic-regression-using-python/</a></p>
<p>After running predict , the followi... | https://stackoverflow.com/questions/41959431/understanding-this-implementation-of-logistic-regression |
Question: <p>I am trying to make a neural network using softmax regression. I am using the following regression formula:</p>
<p><a href="https://i.sstatic.net/oaAL7.png" rel="nofollow"><img src="https://i.sstatic.net/oaAL7.png" alt="enter image description here"></a></p>
<p>Lets say I have an input of 1000x100. In ot... | https://stackoverflow.com/questions/39988084/implementing-softmax-regression |
Question: <p>I did some training using Random Forest Regression (or any kind of regressions) of Scikit-learn and got the predictor:</p>
<pre><code>predictor = RandomForestRegressor(n_estimators=n_estimators)
predictor.fit(X_train, Y_train)
</code></pre>
<p>How can I extract information in <code>predictor</code> to im... | https://stackoverflow.com/questions/37802891/how-to-extract-regression-predictor-of-scikit-learn-to-implement-into-c |
Question: <p>I want to directly implement the ridge polynomial regression in python without using related libraries such as sklearn. The direct calculation is given by:</p>
<p>w = (XTX + lambda * I)^-1*XTy.</p>
<p>The code is as follows:</p>
<pre><code>import numpy as np
import matplotlib.pyplot as plt
from openpyxl im... | https://stackoverflow.com/questions/66905960/ridge-polynomial-regression-direct-implementation-in-python |
Question: <p>I have built a simple linear regressor below...</p>
<pre><code>import numpy as np
x = np.array([[0.0], [0.33], [0.66], [1.0]])
y = np.array([[1.0, 2.0, 3.0, 4.0]]).T
w = np.random.random((1, 1))
for j in xrange(100000):
a2 = np.dot(x, w) + 1
w += x.T.dot((y - a2))
print(a2)
</code></pre>
<p>Now ... | https://stackoverflow.com/questions/47357431/how-can-i-implement-multivariate-linear-regression |
Question: <p>I am trying to implement a tensor flow LSTM regression model for a list of inputs number.
example: </p>
<pre><code> input_data = [1, 2, 3, 4, 5]
time_steps = 2
-> X == [[1, 2], [2, 3], [3, 4]]
-> y == [3, 4, 5]
</code></pre>
<p>The code is below:</p>
<pre><code>TIMESTEPS = 20
num_hidden... | https://stackoverflow.com/questions/47277171/implementing-lstm-regression-model-with-tensor-flow |
Question: <p>I am trying to implement the softmax regression model in tensorflow in order to make a benchmark with other mainstream deep-learning frameworks. The official documentation code is slow because of the <a href="https://github.com/tensorflow/tensorflow/issues/2919" rel="nofollow">feed_dict issue</a> in tensor... | https://stackoverflow.com/questions/39770254/fast-softmax-regression-implementation-in-tensorflow |
Question: <p>I'm looking for the R package or script which the least angle regression or lasso implemented in parallel fashion.
Does anyone knows some?</p>
Answer: <p>Yes. The <strong>Lars</strong> package in R will do this. Check out this package - <a href="http://cran.r-project.org/web/packages/lars/index.html" rel=... | https://stackoverflow.com/questions/23264997/parallel-implementation-of-least-angle-regression |
Question: <p>I've been trying to do my own implementation of a simple linear regression algorithm, but I'm having some trouble with the gradient descent.</p>
<p>Here's how I coded it:</p>
<pre><code>def gradientDescentVector(data, alpha, iterations):
a = 0.0
b = 0.0
X = data[:,0]
y = data[:,1]
m =... | https://stackoverflow.com/questions/39478437/python-linear-regression-implementation |
Question: <p>I am trying to implement Quantile loss for a regression problem based on the formula from this <a href="https://medium.com/@mlblogging.k/14-loss-functions-you-can-use-for-regression-b24db8dff987" rel="nofollow noreferrer">article</a> (number 14 at the end of the article):</p>
<p><a href="https://i.sstatic.... | https://stackoverflow.com/questions/77529336/implementing-keras-version-of-quantile-loss-for-regression |
Question: <p>I have the following pandas dataframe:</p>
<pre><code>df = pd.DataFrame({0: [11, 12, 31], 1: [6, 14, 27], 2: [11, 24, 21], 3: [1, 24, 20]})
0 1 2 3
0 11 6 11 1
1 12 14 24 24
2 31 27 21 20
</code></pre>
<p>For each row at the time, I want to implement a polynomial regression, where ... | https://stackoverflow.com/questions/76077118/fast-way-to-implement-a-polynomial-regression-on-each-pandas-dataframe-row |
Question: <p>1.2 RSS
As stated in chapter 8 of the textbook, we need a parameter to measure the efficiency of a specific split/tree. We choose here Residual Sum of Squares. Implement RSS calculation for the list of splits, knowing that the value to predict (Wage(k)) is contained in element[-1] for element in split.
You ca... | https://stackoverflow.com/questions/56337405/i-want-to-implement-a-tree-based-regression-model-using-rss |
Question: <p>I developed a designer to implement regression models in azure machine learning studio. I have taken the data set pill and then split the data set into train and test in prescribed manner. When I am trying to implement the evaluation metrics and run the pipeline, it was showing a warning and error in the m... | https://stackoverflow.com/questions/73833320/parameters-error-in-azure-ml-designer-in-evaluation-metrics-in-regression-model |
Question: <p>I am trying to implement a logistic regression model, but when I try to print the results I'm getting an error that I've looked up and tried to figure out how to solve, but haven't been able to.</p>
<p>Here's what that looks like:</p>
<pre><code>#Columns
columns = new_df[['DIABETES_NO','DIABETES_INSULIN', ... | https://stackoverflow.com/questions/64381015/linalgerror-singular-matrix-when-implementing-logistic-regression |
Question: <p>I was supposed to develop a web application that also includes predicting an expected arrival date of parcel value based on the origin location of the value, and I was thinking of using Linear Regression model. Though I'm not sure if this is feasible: implementing linear regression in web application. I ca... | https://stackoverflow.com/questions/67072491/implementing-linear-regression-in-asp-net-web-application |
Question: <p>I've been trying to implement Logistic Regression in TensorFlow following the MNIST example but with data from a CSV. Each row is one sample and has 12 dimensions. My code is the following:</p>
<pre><code>batch_size = 5
learning_rate = .001
x = tf.placeholder(tf.float32,[None,12])
y = tf.placeholder(tf.fl... | https://stackoverflow.com/questions/38538635/tensorflow-returning-nan-when-implementing-logistic-regression |
Question: <p>I want to implement logistic regression with minibatches on MNIST using Theano. I want to try out different optimisers, so I decided to use a library called <a href="https://github.com/BRML/climin" rel="nofollow">climin</a>. Climin offers several functions, which receive the parameters of the model, loss a... | https://stackoverflow.com/questions/36742032/implementing-logistic-regression-in-theano-with-climin |
Question: <p>I just started with machine learning, spent few hours learning Linear Regression. Based on my understanding I implemented it from scratch in python (code below) without regularisation. Is my logic correct or does it need any improvements?</p>
<pre><code>import numpy as np
import matplotlib.pyplot as plt
... | https://stackoverflow.com/questions/41312507/verifying-linear-regression-implementation-using-python |
Question: <p>Is there a MATLAB implementation for <a href="http://www2.econ.iastate.edu/tesfatsi/flshome.htm" rel="nofollow">Flexible Least Squares (FLS) regression</a><sup>1</sup>?</p>
<p>I am looking for a decent (well, the least painful) way to handle regression with time-varying coefficients. All ideas are welcome... | https://stackoverflow.com/questions/11474052/matlab-implementation-for-flexible-least-squares-fls-regression |
Question: <p>I am trying to implement logistic regression using equinox and optax libraries, with the support of JAX. While training the model, the loss is not decreasing over time,and model is not learning. Herewith attaching a reproducible code with toy dataset for reference:</p>
<pre><code>import jax
import jax.nn a... | https://stackoverflow.com/questions/76146548/failing-to-implement-logistic-regression-using-equinox-and-optax-library |
Question: <p>I am trying to implement Linear Regression with Multiple variables( actually , just 2 ) . I am using the data from the ML-Class Stanford. I got it working correctly for the single variable case. The same code <em>should</em> have worked for multiple, but , does not. </p>
<p>LINK to the data : </p>
<p><a ... | https://stackoverflow.com/questions/8971034/linear-regression-with-multiple-variables-python-implementation-issues |
Question: <p>I am trying to implement 1 variable Linear regression using PyTorch. However i get [NaN] as output of my prediction when i train my model using large integer inputs .</p>
<pre><code>import torch
from torch.autograd import Variable
import numpy as np
class linearRegression(torch.nn.Module):
... | https://stackoverflow.com/questions/75918642/error-while-implementing-multi-linear-regression-using-pytorch |
Question: <p>I am trying to implement linear regression from scratch in python.</p>
<p>For reference, here are the mathematical formulae I have used: <a href="https://i.sstatic.net/7zzc1.png" rel="nofollow noreferrer">Equations</a></p>
<p>This is what I tried:</p>
<pre class="lang-py prettyprint-override"><code>class L... | https://stackoverflow.com/questions/77569740/why-is-my-implementation-of-linear-regression-not-working |
Question: <p>I'm trying to predict the Adjusted Closing Price for the next day for a stock using Rolling Regression.</p>
<pre><code> Open High Low Close Adj Close
0 26.629999 27.000000 26.290001 26.600000 26.599386
1 26.670000 27.450001 26.540001 27.350000 27.349... | https://stackoverflow.com/questions/74322560/how-to-implement-rolling-regression-in-python |
Question: <p>Is it possible to do the multi branch regression trees(non binary split) using R?</p>
Answer: <p>A word on binary trees, contesting superiority of non-binary: <a href="http://bus.utk.edu/stat/datamining/Tree%20Structured%20Data%20Analysis%20%28SPSS%29.pdf" rel="nofollow">here</a></p>
<p>Tree models in R:... | https://stackoverflow.com/questions/17294632/how-to-implement-multi-branch-regression-trees-in-r |
Question: <p>Are there any libs implementing classification and regression trees in java? Something very close to Matlab's classregtree command required.</p>
Answer: <p>Try <a href="http://www.cs.waikato.ac.nz/ml/weka/" rel="nofollow">Weka</a></p>
| https://stackoverflow.com/questions/9708269/classification-and-regression-trees-implementation-in-java |
Question: <p>I have a scatter plot Vizframe chart in which I need to include a linear regression/trend line. Any idea how this can be done? It appears this is not something offered by vizframe 'out of box'? I can't find a solution for this! </p>
<p><strong>Question:</strong></p>
<p>Any suggestions on a feasible way t... | https://stackoverflow.com/questions/42939004/how-can-i-implement-a-linear-regression-line-in-a-vizframe-chart |
Question: <p>I am looking for an efficient implementation of local regression (LOESS) and local likelihood methods such as local logistic regression (local likelihood methods are discussed, for example, in section 6.5 of <a href="http://www-stat.stanford.edu/%7Etibs/ElemStatLearn/" rel="nofollow noreferrer">Elements of... | https://stackoverflow.com/questions/14411627/implementations-of-local-regression-and-local-likelihood-methods |
Question: <p>I am trying to predict the price of taxi fares using a neural network, I managed to run it for one optimizer and for a given number of epochs, but when implementing gridSearchCV() to try out different optimizers and different amounts of epochs it outputs an error: [ValueError: Unknown label type: continuou... | https://stackoverflow.com/questions/74815755/valueerror-unknown-label-type-continuous-when-implementing-regression |
Question: <p>I try to understand and implement these algorithms in a simple example of linear regression. It is clear to me that the full batch gradient descent uses all the data to calculate the gradient and that the stochastic gradient descent uses only one.</p>
<p>Full Batch Gradient Descent:</p>
<pre><code>import... | https://stackoverflow.com/questions/48843721/python-gd-and-sgd-implementation-on-linear-regression |
Question: <p>In the beginning, I am Japanese and not good at English, so my sentence may be incorrect. Sorry.
I made the code that is about logistic regression.
And I tested this code with dataset, but it is not appropriate rate.
That's why there is any mistakes in this code. If so, please let me know.
Moreover, I want... | https://stackoverflow.com/questions/49818519/implementation-of-logistic-regression |
Question: <h1>Hello world,</h1>
<h1>Problem</h1>
<p>Currently, trying to predict the margin (in percent) from a dataframe with 48098 rows and 70 features (all types). After that, the get dummies has been done in order to have only numerical values, which give the following shape (Shape Df is: (48098, 572)). </p>
<p>... | https://stackoverflow.com/questions/57076184/implementing-polynomial-regression-in-python-errorcould-not-convert |
Question: <p>I am implementing my own Neural Network model for regression using only <code>NumPy</code>, and I'm getting really weird results when I'm testing my model on m > 1 samples (for m=1 it works fine).. It seems like the model collapses and predicts only specific values for the whole batch:</p>
<pre><code>In... | https://stackoverflow.com/questions/63093127/numpy-implementation-for-regression-using-nn |
Question: <p>I've recently started learning machine learning algorithms. I've written a program in python from scratch to implement linear regression but I need some data pairs to use.</p>
Answer: <p>There are many dataset at internet to use, </p>
<p>have a look here, you can find many real datasets: <a href="https:/... | https://stackoverflow.com/questions/35397525/where-can-i-find-data-pairs-to-practice-implementing-linear-regression |
Question: <p>I am trying to write a multiple linear regression model from scratch to predict the key factors contributing to number of views of a song on Facebook. About each song we collect this information, i.e. variables I'm using:</p>
<pre><code>df.dtypes
clicked int64
listened_5s ... | https://stackoverflow.com/questions/48257144/how-do-i-implement-multiple-linear-regression-in-python |
Question: <p>I'm (a Python newbie) writing Python code to mimic outputs in SAS and want to run a multinomial logistic regression on the SAS Wallet data set. I've done normal logistic regression previously on other data using statsmodels.Logit, but now am using statsmodels.MNLogit. According to the API (<a href="https:/... | https://stackoverflow.com/questions/63272453/how-to-implement-statsmodels-multinomial-logistic-regression-mnlogit-wald-test |
Question: <p>After I get some processes to get x_train and y_train, I flatten them. The code snippets are shown below.</p>
<p><strong>The flatten code</strong></p>
<pre><code>x_train = x_train_flatten.T
x_test = x_test_flatten.T
y_test = Y_test.T
y_train = Y_train.T
print("x train: ",x_train.shape)
print(&quo... | https://stackoverflow.com/questions/62818741/how-to-fix-nan-values-coming-from-the-implementation-of-logistic-regression |
Question: <p>Does anyone know of any good implementation of group-lasso regularized linear regression in R (or even Matlab)?</p>
Answer: <p>Have you looked at <strong><a href="http://www.gnu.org/software/octave/" rel="nofollow">GNU Octave</a></strong>? It does its work on command line so you can use it with any langu... | https://stackoverflow.com/questions/10983629/r-implementation-of-group-lasso-regularized-linear-regression |
Question: <p>I'm working in R to estimate non-parametric regression. The complete project: <a href="https://systematicinvestor.wordpress.com/2012/05/22/classical-technical-patterns" rel="nofollow noreferrer">https://systematicinvestor.wordpress.com/2012/05/22/classical-technical-patterns</a></p>
<p>My <code>R</code> c... | https://stackoverflow.com/questions/60828059/select-smoothing-parameter-and-implement-non-parametric-regression-in-python |
Question: <p>I am trying to replicate the following equation in MATLAB to find the optimal output weight matrix of a neural network from training using ridge regression.</p>
<p><strong>Output Weight Matrix of a Neural Network after Training using Ridge Regression:</strong>
<a href="https://i.sstatic.net/O9byd971.png" r... | https://stackoverflow.com/questions/78597100/implement-ridge-regression-equation-for-a-neural-network |
Question: <p>I have just started in machine learning and currently taking the course by andrew Ng's Machine learning Course. I have implemented the linear regression algorithm in python but the result is not desirable. I code of python is as follows:</p>
<pre><code>import numpy as np
x = [[1,1,1,1,1,1,1,1,1,1],[10,20... | https://stackoverflow.com/questions/49081195/implementing-linear-regression-using-gradient-descent |
Question: <p>I have just learned about the statsmodels module by searching about quantile regression. I was wondering if there is a way to use statsmodels for quantile regressoin and take the errorbars of the data into account,
like in sklearn.linear_model.LinearRegression?</p>
<p><a href="http://scikit-learn.org/sta... | https://stackoverflow.com/questions/41991585/can-i-implement-sample-weights-in-statsmodels-quantile-regression |
Question: <p>I need to implement the confidence intervals of multiple regression coefficients in Octave/Matlab.</p>
<p>The task is defined in a common manner: data Y, design matrix X, coefficients β so that Y=βX. The code for β is then simply:</p>
<pre><code>beta = pinv(X)*Y
</code></pre>
<p>Now, as a stupid physici... | https://stackoverflow.com/questions/46752817/octave-matlab-implementation-of-confidence-intervals-in-multiple-regression |
Question: <p>I'm trying to implement a simple logistic regression model in Scala. That is there is only one independent variable to the dependent binary variable.
If we look as the example from Wikipedia: <a href="https://en.wikipedia.org/wiki/Logistic_regression" rel="nofollow noreferrer">https://en.wikipedia.org/wiki... | https://stackoverflow.com/questions/55664603/asking-review-and-help-for-implementing-logistic-regression-model |
Question: <p>I want to implement <strong>vector autoregression</strong> in python. My data is saved as a list of 3 lists. I found this -
<a href="http://statsmodels.sourceforge.net/stable/vector_ar.html#var" rel="nofollow noreferrer">http://statsmodels.sourceforge.net/stable/vector_ar.html#var</a>, but could not figur... | https://stackoverflow.com/questions/18348720/how-to-implement-vector-auto-regression-in-python |
Question: <p>Is it currently possible to utilize the classification endpoint alongside multi-tenancy in the latest version? I couldn't find any documentation regarding this feature. it's not implemented yet in v4.</p>
<p>As a workaround, I understand that using v3 is necessary. However, even with v3, there doesn't appe... | https://stackoverflow.com/questions/78382174/implementing-classification-with-multi-tenancy |
Question: <p>Are there any libs implementing classification and regression trees in java? Something very close to Matlab's classregtree command required.</p>
Answer: <p>Try <a href="http://www.cs.waikato.ac.nz/ml/weka/" rel="nofollow">Weka</a></p>
| https://stackoverflow.com/questions/9708269/classification-and-regression-trees-implementation-in-java |
Question: <p>Is there a way to implement multiple classification in Java? For instance, take this UML diagram -
<img src="https://i.sstatic.net/Izpgx.png" alt="enter image description here"></p>
<p>How should the <code>GrainCrop</code> class be implemented?</p>
Answer: <p>Java does not support multiple inheritance on... | https://stackoverflow.com/questions/25873645/implement-multiple-classification-in-java |
Question: <p>I want to implement simple classification tree (binary classification) using <em>Mathematica.</em></p>
<p>How can I implement a binary tree in <em>Mathematica</em>? Is there is a symbol for doing that?</p>
Answer: <p>Among the new objects in MMA 8 are <a href="http://reference.wolfram.com/mathematica/re... | https://stackoverflow.com/questions/6563407/classification-tree-implementation-in-mathematica |
Question: <p>So, I'm playing around with R in order to get the hang of Classification Trees. I'm primarily interested in making a abstract data type for the the Classification Tree so I can start building it. But unlike, C, Java, etc I can't have pointers to other nodes. I'm limited to lists and vectors. </p>
<p>How c... | https://stackoverflow.com/questions/46255195/implementing-classification-tree-with-lists-and-vectors |
Question: <p>I want to implement a binary classification model using Gaussian process. According to the <a href="https://gpflow.readthedocs.io/en/master/notebooks/basics/classification.html" rel="nofollow noreferrer">official documentation</a>, I had the code as below.</p>
<p>The X has 2048 features and Y is either 0 o... | https://stackoverflow.com/questions/68419128/gpflow-classification-implementation |
Question: <p>Hierarchical attention mechanism for document classification has been presented by Yang et al.
<a href="https://www.cs.cmu.edu/%7E./hovy/papers/16HLT-hierarchical-attention-networks.pdf" rel="nofollow noreferrer">https://www.cs.cmu.edu/~./hovy/papers/16HLT-hierarchical-attention-networks.pdf</a></p>
<p>Its... | https://stackoverflow.com/questions/70271797/how-to-implement-hierarchical-transformer-for-document-classification-in-keras |
Question: <p>I am trying to implement Multi class classification using SVM under e1071 package in R language. I read in a similar thread that SVM handles one vs one classifier by itself in the back end. Is it true.</p>
<p>Also, if I want to execute One vs Rest classifier, how to do it. And, while printing the summar... | https://stackoverflow.com/questions/27125381/implement-multi-class-classification-using-svm-in-r |
Question: <p>I am attempting to implement a neural network using Keras with a problem that involves multilabel classification. I understand that one way to tackle the problem is to transform it to several binary classification problems. I have implemented one of these, but am not sure how to proceed with the others, mo... | https://stackoverflow.com/questions/54726518/how-do-i-implement-multilabel-classification-neural-network-with-keras |
Question: <p>I'm working on implementation of LSTM Neural Network for sequence classification. I want to design a network with the following parameters:</p>
<ol>
<li><strong>Input :</strong> a sequence of <code>n</code> one-hot-vectors.</li>
<li><strong>Network topology :</strong> two-layer LSTM network.</li>
<li><str... | https://stackoverflow.com/questions/38614265/how-to-implement-a-sequence-classification-lstm-network-in-cntk |
Question: <p>I am working on a multi label classification problem and need some guidance on computing class weights using Scikit-Learn.</p>
<p><strong>Problem Context:</strong></p>
<p>I have a dataset with 9973 training samples.The labels are one-hot encoded, representing 13 different classes.The shape of my training l... | https://stackoverflow.com/questions/78559061/how-to-implement-class-weight-sampling-in-multi-label-classification |
Question: <p>I am recently taking CS231n online class. Trying to implement simple image classification code using CIFAR-10 dataset, in <a href="http://cs231n.github.io/classification/" rel="nofollow">http://cs231n.github.io/classification/</a></p>
<p>While running this code, on predict function, time takes too long, a... | https://stackoverflow.com/questions/35691805/confusion-on-cs231n-image-classification-implementation |
Question: <p>I am trying to implement Naive Bayes Gaussian classifier on the number classification data. Where each feature represents a pixel. </p>
<p>When trying to implement this, I hit a bump, I've noticed that some the feature variance equate to 0.
This is an issue because I would not be able to divide by 0 whe... | https://stackoverflow.com/questions/46513538/implement-naive-bayes-gaussian-classifier-on-the-number-classification-data |
Question: <p>So far I have used Keras Tensorflow to model image processing, NLP, time series prediction. Usually in case of having labels with multiple entries, so multiple categories the task was always to just predict to which class the sample belongs. So for example the list of possible classes was [car, human, airp... | https://stackoverflow.com/questions/63666851/multi-label-classification-implementation |
Question: <p>I am trying to implement classification and clustering of tweets and also using jupyter notebook and getting error while running this:</p>
<pre><code>nlp = en_core_web_sm.load()
tokenizer = RegexpTokenizer(r'\w+')
lemmatizer = WordNetLemmatizer()
stop = set(stopwords.words('english'))
punctuation = list(st... | https://stackoverflow.com/questions/71296865/classification-and-clustering-of-tweets |
Question: <p>I'm currently working on a multi-label image classification problem where my dataset is significantly imbalanced. Each image in my dataset can have multiple labels. The labels are provided in a one-hot encoded format.
For example: [1,0,0,0,0,1,0] etc.</p>
<p>My train df:</p>
<pre><code>Image Index Finding ... | https://stackoverflow.com/questions/78595351/how-to-implement-class-or-sample-weight-sampling-in-multi-label-classification |
Question: <p>I am making an iOS application using objective-c and Xcode that will collect and analyze some data from the user. Using this data, it will return one of 3 classifications. I can use training data in either R or Python to create a random forest model that has the capability to do this. I would like to know ... | https://stackoverflow.com/questions/34871592/how-to-implement-random-decision-forest-classification-in-ios |
Question: <p>I am creating a choropleth plot function with Altair and want to use different data <a href="https://gisgeography.com/choropleth-maps-data-classification/" rel="nofollow noreferrer">classification scheme</a> for the size of the scatter markers. I have looked up the <code>bin parameters</code> and <code>bin... | https://stackoverflow.com/questions/72021194/is-it-possible-to-implement-data-classification-scheme-for-choropleth-plot-in |
Question: <p>I’m new to Julia and i am trying to implement One-Vs-Rest Multi-Class Classification, and I was wondering if anyone could help me out. Here is a snippet of my code so far:
My data frame is basic since I’m trying to figure out the implementation first, my c column is my class consisting of [0, 1, 2], and my... | https://stackoverflow.com/questions/74932178/how-to-implement-one-vs-rest-for-multi-class-classification-in-julia |
Question: <p>I would like to implement attention to a trained image classification CNN model. For example, there are 30 classes and with the Keras CNN, I obtain for each image the predicted class. However, to visualize the important features/locations of the predicted result. I want to add a Soft Attention after the FC... | https://stackoverflow.com/questions/57059382/implementing-attention-in-keras-classification |
Question: <p>I am trying to implement the Hierarchical Attention <a href="https://www.cs.cmu.edu/~diyiy/docs/naacl16.pdf" rel="nofollow noreferrer">paper</a> for text classification. One of the challenges that I am finding is how to manage batching and updates to the weights of the network by the optimizer. The archit... | https://stackoverflow.com/questions/49057752/implementing-hierarchical-attention-for-classification |
Question: <p>I'm currently performing a research that involves identification of food items using image classification techniques, I'm well versed in the theories and maths of SVM, yet I'm completely lost when it comes to implementing it using Matlab.</p>
<p>I would like some guiding steps to perform full image classi... | https://stackoverflow.com/questions/36307467/how-to-implement-image-classification-and-feature-extraction-using-matlab |
Question: I have some geographical trajectories sampled to analyze, and I calculated the histogram of data in spatial and temporal dimension, which yielded a time domain based feature for each spatial element. I want to perform a discrete <code>FFT</code> to transform the time domain based feature into frequency domain... | https://stackoverflow.com/questions/27546476/what-fft-descriptors-should-be-used-as-feature-to-implement-classification-or-cl |
Question: <p>I am writing a code for implementing Naive Bayes classifier for text classification. I have worked a very small example, <a href="https://web.stanford.edu/class/cs124/lec/naivebayes.pdf" rel="nofollow">please refer page 44</a>, it seems to be working.</p>
<ol>
<li>But I want know whether the implementatio... | https://stackoverflow.com/questions/34515035/implementation-of-naive-bayes-for-text-classification-in-c |
Question: <p>I try to implement a API for pre-trained resnet(machine learning model). so server can accepts a single valid image file in the request to be analyzed. Returns the output from running the image against the model.</p>
<p>I'm wondering what's the general structure of my api look like. So far I have </p>
<p... | https://stackoverflow.com/questions/61115346/flask-image-classification-ml-model-api-implementation |
Question: <p>I am working on <strong>Multi-Label Image classification</strong> using a dataset having 14,720 training images. I need to implement it using <em>ResNet/DenseNet</em>. I trying to work on it. Could you please suggest me a reference to move forward.</p>
Answer: <p>For creating a multi-label classification ... | https://stackoverflow.com/questions/60784634/how-to-implement-multi-label-classification-with-train-validation-and-test-imag |
Question: <p>I am trying to understand SVM and want to do image classification using SVM. I saw some sample codes which use sklearn <a href="https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html" rel="nofollow noreferrer">https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html</a> but ev... | https://stackoverflow.com/questions/76801704/implementing-image-classification-using-svm |
Question: <p>I am implementing Naive Bayes algorithm for text classification. I have ~1000 documents for training and 400 documents for testing. I think I've implemented training part correctly, but I am confused in testing part. Here is what I've done briefly:</p>
<p>In my training function:</p>
<pre><code>vocabular... | https://stackoverflow.com/questions/5451004/log-likelihood-to-implement-naive-bayes-for-text-classification |
Question: <p>I have done SVM using 1/-1 classification.</p>
<p>i.e. by checking sign of decision function <code>wTrans * X - gamma</code></p>
<pre><code>if(decfun<0)
setclasslabel to -1
else
setclasslabel to 1
</code></pre>
<p>What about in 1/0 classification. </p>
<p>Is that the same thing?</p>
Answer: <... | https://stackoverflow.com/questions/19899410/svm-implementation-in-java-1-0-classification |
Question: <p>The developer API example (<a href="https://github.com/apache/spark/blob/master/examples/src/main/scala/org/apache/spark/examples/ml/DeveloperApiExample.scala" rel="nofollow noreferrer">https://github.com/apache/spark/blob/master/examples/src/main/scala/org/apache/spark/examples/ml/DeveloperApiExample.scal... | https://stackoverflow.com/questions/45957112/trying-to-implement-predictraw-for-classification-model-in-apache-spark |
Question: <p>I have created script for binary (0 and 1) text classification using XLM-ROBERTa model. I would like to put metrics (as Binary Cross-Entropy) but also early stopping with patience of 15.</p>
<p>But I have a problem. I tried to use the path <code>model.compile</code> and <code>model.fit</code>, but XLM-RoBe... | https://stackoverflow.com/questions/72515966/implement-metrics-using-xlmroberta-model-for-text-classification |
Question: <p>I have a regression problem on which I want to use logistic regression - not logistic classification - because my target variables <code>y</code> are continuopus quantities between 0 and 1. However, the common implementations of logistic regression in Python seem to be exclusively logistic classification. ... | https://stackoverflow.com/questions/65268985/python-implementation-of-logistic-regression-as-regression-not-classification |
Question: <p>I am building a Medical Image classification app,
Is there a way to intergrate <code>Grad-CAM</code> into the model so that when images are classified they return with <code>class activation map</code>, Or the Grad-CAM functionality is to be added in the app independant from the model?I need the app to cla... | https://stackoverflow.com/questions/69881311/how-to-implement-grad-cam-in-a-classification-app |
Question: <h3>Problem Context</h3>
<p>I am trying to learn Neural Networks in Python, & I've developed an implementation of a Logistic Regression based NN.</p>
<p>Here is the code - </p>
<pre><code>import numpy as np
# Input array
X = np.array([[1, 0, 1, 0], [1, 0, 1, 1], [0, 1, 0, 1]])
# Output
y = np.array([... | https://stackoverflow.com/questions/47626075/implement-a-regression-classification-neural-network-in-python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.