Encog3Java-User.pdf翻译:第二章 为Encog获取数据

Chapter 2
第二章


Obtaining Data for Encog
为Encog获取数据


? Finding Data for Neural Networks
为神经网络发现数据


? Why Normalize?
为什么规范化


? Specifying Normalization Sources
指定规范原


? Specifying Normalization Targets
指定规范目标


Neural networks can provide profound insights into the data supplied to them. However, you can’t just feed any sort of data directly into a neural network. This “raw”data must usually be normalized into a form that the neural network can process. This chapter will show how to normalize “raw”data for use by Encog.
神经网络可以对他们获得的数据提供深刻的洞察力。然而,你不能直接将任何数据输入到神经网络中,这种“原始”数据通常必须被转为神经网络可以处理的形式。本章将展示如何规范“原始”数据,以便Encog使用。


Before data can be normalized, we must first have data. Once you decide what the neural network should do, you must find data to teach the neural network how to perform a task. Fortunately, the Internet provides a wealth of information that can be used with neural networks.
在数据可以规范化之前,我们首先必须有数据。一旦决定了神经网络应该做什么,就必须找到数据来教神经网络如何执行任务。幸运的是,互联网提供了大量的信息,可以被神经网络使用。


2.1 Where to Get Data for Neural Networks
2.1 从哪里为神经网络获取数据


The Internet can be a great source of data for the neural network. Data found on the Internet can be in many different formats. One of the most convenient formats for data is the comma-separated value (CSV) format. Other times it may be necessary to create a spider or bot to obtain this data. One very useful source for neural network is the Machine Learning Repository, which is run by the University of California at Irvine.
互联网可以成为神经网络的重要数据源。在互联网上发现的数据可以有许多不同的格式。数据最方便的格式之一是逗号分隔值(CSV)格式。有时可能需要创建一个蜘蛛或机器人来获取这些数据。神经网络的一个非常有用的来源是由加州大学欧文分校运行的机器学习知识库。


http://kdd.ics.uci.edu/
The Machine Learning Repository site is a repository of various datasets that have been donated to the University of California. Several of these datasets will be used in this book.
机器学习存储库站点是一个存储各种数据集的库,这些数据集已经捐赠给了加利福尼亚大学。这些数据集中的几个将在本书中使用。


2.2 Normalizing Data
2.2 规范化数据


Data obtained from sites, such as those listed above, often cannot be directly fed into neural networks. Neural networks can be very “intelligent,”but cannot receive just any sort of data and produce a meaningful result. Often the data must first be normalized. We will begin by defining normalization. Neural networks are designed to accept floating-point numbers as their input. Usually these input numbers should be in either the range of -1 to +1 or 0 to +1 for maximum efficiency. The choice of which range is often dictated by the choice of activation function, as certain activation functions have a positive range and others have both a negative and positive range.
从站点获得的数据,如上面列出的数据,通常不能直接输入到神经网络中。神经网络可以非常智能,但不能接收任何类型的数据并产生有意义的结果。通常,数据必须首先规范化。我们将从定义规范开始。神经网络被设计成接受浮点数作为输入。通常,这些输入数字应该在-1到1或0到1之间,以达到最大效率。选择范围通常取决于选择的激活函数,因为某些激活函数有一个正的范围,而其他的函数具有负和正的范围。


The sigmoid activation function, for example, has a range of only positive numbers. Conversely, the hyperbolic tangent activation function has a range of positive and negative numbers. The most common case is to use a hyperbolic tangent activation function with a normalization range of -1 to +1.
例如,sigmoid激活函数有一个只有正数的范围。相反,双曲正切激活函数有一个正负数范围。最常见的情况是使用双曲正切激活函数,其标准化范围为-1到1。


Recall from Chapter 1 the iris dataset. This data set could be applied to a classification problem. However, we did not see how the data needed to be actually processed to make it useful to a neural network. A sampling of the dataset is shown here:
回顾第1章IRIS数据集。该数据集可以应用于分类问题。然而,我们没有看到如何实际处理数据以使其对神经网络有用。这里显示了数据集的采样:


”Sepal Length”,”Sepal Width”,”Peta l Length”,”Petal Width”,”Species”
5.1 , 3.5 , 1.4 , 0.2 ,”setosa”
4.9 , 3.0 , 1.4 , 0.2 ,”setosa”
4.7 , 3.2 , 1.3 , 0.2 ,”setosa”
..
7.0 , 3.2 , 4.7 , 1.4 ,”versicolor”
6.4 , 3.2 , 4.5 , 1.5 ,”versicolor”
6.9 , 3.1 , 4.9 , 1.5 ,”versicolor”
...
6.3 , 3.3 , 6.0 , 2.5 ,”virginica”
5.8 , 2.7 , 5.1 , 1.9 ,”virginica”
7.1 , 3.0 , 5.9 , 2.1 ,”virginica”
The fields from this dataset must now be represented as an array of floating point numbers between -1 and +1.
该数据集的字段现在必须表示为一个浮点数数组,在-1和+1之间。


? Sepal Length - Numeric
? Sepal Width - Numeric
? Petal Length - Numeric
? Petal Width - Numeric
? Species - Class
There are really two different attribute types to consider. First, there are four numeric attributes. Each of these will simply map to an input neuron. The values will need to be scaled to -1 to +1.Class attributes, sometimes called nominal attributes, present a unique challenge. In the example, the species of iris must be represented as either one or more floating point numbers. The mapping will not be to a single neuron. Because a three-member class is involved, the number of neurons used to represent the species will not be a single neuron. The number of neurons used to represent the species will be either two or three, depending on the normalization type used.
实际上有两种不同的属性类型需要考虑。首先,有四个数字属性。每一个都只映射到一个输入神经元。该值将需要达到-1到1。类属性,有时称为标称属性,它提出了独特的挑战。在该示例中,iris的种类必须表示为一个或多个浮点数。映射不会是单个神经元。由于涉及三个成员类,用于表示该物种的神经元数目将不是单个神经元。用于表示该物种的神经元数目将是两个或三个,这取决于所使用的标准化类型。


The next
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
如何解决下面的错误?2023-07-15 14:20:55.827 ERROR 27660 --- [eate-1290795133] com.alibaba.druid.pool.DruidDataSource : create connection SQLException, url: jdbc:mysql://localhost:3306/reggie?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true, errorCode 1045, state 28000 java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:833) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:453) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1644) ~[druid-1.1.23.jar:1.1.23] at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1710) ~[druid-1.1.23.jar:1.1.23] at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2774) ~[druid-1.1.23.jar:1.1.23]
07-16

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值