小编Ram*_*Ram的帖子

线性回归和非线性回归之间的区别?

在机器学习中,我们说:

  • w 1 x 1 + w 2 x 2 + ... + w n x n线性回归模型,其中w 1,w 2 .... w n是权重,x 1,x 2 ... x 2是功能而:
  • w 1 x 1 2 + w 2 x 2 2 + ... + w n x n 2非线性(多项式)回归模型

然而,在一些讲座我看到有人说一个模型是线性基础上的权重,即权重系数是线性和特征的程度并不重要,无论是直线(X 1)或多项式Λ(x 1 2).真的吗?如何区分线性和非线性模型?它是基于权重还是特征值?

regression machine-learning linear-regression non-linear-regression

6
推荐指数
1
解决办法
3038
查看次数

使用鼠标点击进行交互式绘图

我正在做一个项目,我使用闪亮的服务器并将R连接到mongodb以从数据库中获取结果并动态显示它.

但是,我面临以下问题.我最初从db获得结果并制作一个情节.完成此绘图后,我希望用户在绘图上进行两次鼠标单击,根据该绘图将两个值作为xlim并绘制上一个绘图的缩放版本.但是,我无法成功完成.

这是我写的代码.

ui.R

library(shiny)
shinyUI(fluidPage(
    titlePanel("LOAD AND PERFORMANCE DASHBOARD"),

    sidebarLayout(
            sidebarPanel(
                    fluidRow(
                            selectInput("select", label = h3("Select type of testing"), 
                                        choices = list("Performance Testing"=1, "Capacity Testing"=2)),
                            radioButtons("radio", label = h3("Select parameter to plot"),
                                         choices = list("Disk" = 1, "Flit" = 2,"CPU" = 3,"Egress" =4,
                                                        "Memory" = 5))  
                    )),
            mainPanel(
                    plotOutput("plot",clickId="plot_click"),
                    textOutput("text1"),
                    plotOutput("plot2")
                    )
    )
))
Run Code Online (Sandbox Code Playgroud)

server.R

library(shiny)
library(rmongodb)
cursor <- vector()
shinyServer(function(input, output) {

    initialize <- reactive({
            mongo = mongo.create(host = "localhost")
    })

    calculate <- reactive({
            if(input$radio==1)
                    xvalue <- mongo.distinct(mongo,ns …
Run Code Online (Sandbox Code Playgroud)

r shiny

4
推荐指数
1
解决办法
6117
查看次数

在Tensorflow中使用Adadelta优化器时未初始化的值错误

我正在尝试使用Adagrad优化器构建CNN,但我收到以下错误.

tensorflow.python.framework.errors.FailedPreconditionError:试图使用未初始化值Variable_7/Adadelta

[[Node:Adadelta/update_Variable_7/ApplyAdadelta = ApplyAdadelta [T = DT_FLOAT,_class = ["loc:@ Variable_7"],use_locking = false,_device ="/ job:localhost/replica:0/task:0/cpu:0 "](Variable_7,Variable_7/Adadelta,Variable_7/Adadelta_1,Adadelta/lr,Adadelta/rho,Adadelta/epsilon,gradients/add_3_grad/tuple/control_dependency_1)]]由op u'Adadelta/update_Variable_7/ApplyAdadelta'引起,

optimizer = tf.train.AdadeltaOptimizer(learning_rate).minimize(cross_entropy)

我尝试在adagrad语句之后重新初始化会话变量,如本文所述,但这也没有帮助.

我怎样才能避免这个错误?谢谢.

Tensorflow:使用Adam优化器

import tensorflow as tf
import numpy
from tensorflow.examples.tutorials.mnist import input_data

def conv2d(x, W):
  return tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')

def max_pool_2x2(x):
  return tf.nn.max_pool(x, ksize=[1, 2, 2, 1],
                        strides=[1, 2, 2, 1], padding='SAME')

def weight_variable(shape):
  initial = tf.truncated_normal(shape, stddev=0.1)
  return tf.Variable(initial)

def bias_variable(shape):
  initial = tf.constant(0.1, shape=shape)
  return tf.Variable(initial)


mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)

# Parameters
learning_rate …
Run Code Online (Sandbox Code Playgroud)

python mnist deep-learning tensorflow

0
推荐指数
1
解决办法
1574
查看次数