myawesomepkg 0.1.2__py3-none-any.whl → 0.1.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- myawesomepkg/TSAPY1/Practical No 1.py +148 -0
- myawesomepkg/TSAPY1/Practical No 2.py +115 -0
- myawesomepkg/TSAPY1/Practical No 3.py +168 -0
- myawesomepkg/TSAPY1/Practical No 4 A.py +233 -0
- myawesomepkg/TSAPY1/Practical No 4 B.py +137 -0
- myawesomepkg/TSAPY1/Practical No 5.py +52 -0
- myawesomepkg/TSAPY1/Practical No 6.py +29 -0
- myawesomepkg/TSAPY1/Practical No 7.py +67 -0
- myawesomepkg/TSAPY1/Practical No 8.py +108 -0
- myawesomepkg/TSAPY1/__init__.py +0 -0
- myawesomepkg/TSAPY1/practical_no_3.py +167 -0
- myawesomepkg/TSAPY1/practical_no_4.py +215 -0
- myawesomepkg/TSAPY1/practical_no_4b.py +78 -0
- myawesomepkg/TSAPY1/practical_no_5_ac_and_pca.py +39 -0
- myawesomepkg/TSAPY1/practical_no_6.py +37 -0
- myawesomepkg/TSAPY1/practical_no_7.py +69 -0
- myawesomepkg/TSAPY1/practical_no_8.py +79 -0
- myawesomepkg/TSAPY1/tsa_practical_no_1.py +287 -0
- myawesomepkg/TSAPY1/tsa_practical_no_2.py +121 -0
- myawesomepkg-0.1.4.dist-info/METADATA +12 -0
- myawesomepkg-0.1.4.dist-info/RECORD +25 -0
- myawesomepkg/d.py +0 -36
- myawesomepkg-0.1.2.dist-info/METADATA +0 -7
- myawesomepkg-0.1.2.dist-info/RECORD +0 -7
- {myawesomepkg-0.1.2.dist-info → myawesomepkg-0.1.4.dist-info}/WHEEL +0 -0
- {myawesomepkg-0.1.2.dist-info → myawesomepkg-0.1.4.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,287 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
"""TSA_Practical_No_1.ipynb
|
3
|
+
|
4
|
+
Automatically generated by Colab.
|
5
|
+
|
6
|
+
Original file is located at
|
7
|
+
https://colab.research.google.com/drive/1-xNPJwhkAO4KzKFMvXII92dc9Y_VTQ8H
|
8
|
+
|
9
|
+
**Practical No 1:**
|
10
|
+
**Aim: Handling timeseries data**
|
11
|
+
|
12
|
+
a. Import timeseries data
|
13
|
+
|
14
|
+
b. Visualizing timeseries data using various plot
|
15
|
+
|
16
|
+
# **A. Load and Explore Time Series Data**
|
17
|
+
"""
|
18
|
+
|
19
|
+
from pandas import read_csv
|
20
|
+
series = read_csv('/content/daily-total-female-births.csv', header=0, index_col=0, parse_dates=True)
|
21
|
+
print(type(series))
|
22
|
+
print(series.head())
|
23
|
+
|
24
|
+
"""The arguments to the **readcsv()** function. We provide it a number of hints to ensure the data is loaded as a Series.
|
25
|
+
|
26
|
+
1. **header=0:** We must specify the header information at row 0.
|
27
|
+
2. **parse_dates=True:** We give the function a hint that data in the first column contains dates that need to be parsed.
|
28
|
+
3. **index_col=0:** We hint that the first column contains the index information for the time series.
|
29
|
+
4. **squeeze=True:** We hint that we only have one data column and that we are interested in a Series and not a DataFrame.
|
30
|
+
|
31
|
+
You can use the **head()** function to peek at the first 5 records or specify the first n number of records to review
|
32
|
+
"""
|
33
|
+
|
34
|
+
print(series.head(10))
|
35
|
+
|
36
|
+
"""**Number of Observations**
|
37
|
+
You can get the dimensionality of your Series using the size parameter.
|
38
|
+
"""
|
39
|
+
|
40
|
+
print(series.size)
|
41
|
+
|
42
|
+
""" **Querying By Time**
|
43
|
+
You can slice, dice, and query your series using the time index. For example, you can access all observations in January as follows:
|
44
|
+
|
45
|
+
**series.loc[]**
|
46
|
+
|
47
|
+
Access a group of rows and columns by label(s) or a boolean array.
|
48
|
+
.loc[] is primarily label based, but may also be used with a boolean array.
|
49
|
+
"""
|
50
|
+
|
51
|
+
print(series.loc["1959-01"])
|
52
|
+
|
53
|
+
"""**Descriptive Statistics**
|
54
|
+
Calculating descriptive statistics on your time series can help get an idea of the distribution and
|
55
|
+
spread of values.
|
56
|
+
The **describe()** function creates
|
57
|
+
a 7 number summary of the loaded time series including mean, standard deviation, median,
|
58
|
+
minimum, and maximum of the observations
|
59
|
+
"""
|
60
|
+
|
61
|
+
print(series.describe())
|
62
|
+
|
63
|
+
"""# **B. Data Visualization**
|
64
|
+
Visualization plays an important role in time series analysis and forecasting. Plots of the raw
|
65
|
+
sample data can provide valuable diagnostics to identify temporal structures like trends, cycles,
|
66
|
+
and seasonality that can influence the choice of model. A problem is that many novices in the
|
67
|
+
field of time series forecasting stop with line plots.
|
68
|
+
|
69
|
+
Different types of visualizations that you can use on your own time series data. They are:
|
70
|
+
1. Line Plots.
|
71
|
+
2. Histograms and Density Plots.
|
72
|
+
3. Box and Whisker Plots.
|
73
|
+
4. Heat Maps.
|
74
|
+
5. Lag Plots or Scatter Plots.
|
75
|
+
6. Autocorrelation Plots.
|
76
|
+
|
77
|
+
**Minimum Daily Temperatures Dataset**
|
78
|
+
We will use the Minimum Daily Temperatures dataset as an example. This dataset
|
79
|
+
describes the minimum daily temperatures over 10 years (1981-1990) in the city Melbourne,
|
80
|
+
Australia.
|
81
|
+
"""
|
82
|
+
|
83
|
+
from pandas import read_csv
|
84
|
+
from matplotlib import pyplot
|
85
|
+
series = read_csv('daily-min-temperatures.csv', header=0, index_col=0,parse_dates=True)
|
86
|
+
print(series.head())
|
87
|
+
series=series.squeeze()
|
88
|
+
type(series)
|
89
|
+
print(series.describe())
|
90
|
+
|
91
|
+
"""**Line Plot**
|
92
|
+
The first, and perhaps most popular, visualization for time series is the line plot. In this plot,
|
93
|
+
time is shown on the x-axis with observation values along the y-axis. Below is an example of
|
94
|
+
visualizing the Pandas Series of the Minimum Daily Temperatures dataset directly as a line
|
95
|
+
plot.
|
96
|
+
"""
|
97
|
+
|
98
|
+
series.plot()
|
99
|
+
pyplot.show()
|
100
|
+
|
101
|
+
"""Changing the style of the line to
|
102
|
+
be black dots instead of a connected line (the style=’k.’ argument).
|
103
|
+
"""
|
104
|
+
|
105
|
+
series.plot(style='k.')
|
106
|
+
pyplot.show()
|
107
|
+
|
108
|
+
series.plot(style='k--')
|
109
|
+
pyplot.show()
|
110
|
+
|
111
|
+
"""It can be helpful to compare line plots for the same interval, such as from day-to-day,
|
112
|
+
month-to-month, and year-to-year. The Minimum Daily Temperatures dataset spans 10
|
113
|
+
years. We can group data by year and create a line plot for each year for direct comparison. The example below shows how to do this. First the observations are grouped by year (series.groupby(Grouper(freq=’A’))).
|
114
|
+
|
115
|
+
A **Grouper** allows the user to specify a groupby instruction for an object.
|
116
|
+
|
117
|
+
This specification will select a column via the key parameter, or if the level and/or axis parameters are given, a level of the index of the target object.
|
118
|
+
|
119
|
+
If axis and/or level are passed as keywords to both Grouper and groupby, the values passed to Grouper take precedence
|
120
|
+
|
121
|
+
The groups are then enumerated and the observations for each year are stored as columns
|
122
|
+
in a new DataFrame. Finally, a plot of this contrived DataFrame is created with each column
|
123
|
+
visualized as a subplot with legends removed to cut back on the clutter.
|
124
|
+
|
125
|
+
The **squeeze()** method converts a single column DataFrame into a Series.
|
126
|
+
"""
|
127
|
+
|
128
|
+
from pandas import read_csv
|
129
|
+
from pandas import DataFrame
|
130
|
+
from pandas import Grouper
|
131
|
+
from matplotlib import pyplot
|
132
|
+
series = read_csv('/content/daily-min-temperatures.csv', header=0, index_col=0, parse_dates=True)
|
133
|
+
#print(series.head())
|
134
|
+
|
135
|
+
series=series.squeeze()
|
136
|
+
#print(series.head())
|
137
|
+
groups = series.groupby(Grouper(freq='A'))
|
138
|
+
#print(groups)
|
139
|
+
years = DataFrame()
|
140
|
+
#print(years)
|
141
|
+
for name, group in groups:
|
142
|
+
years[name.year] = group.values
|
143
|
+
print(years)
|
144
|
+
years.plot(subplots=True, legend=False)
|
145
|
+
pyplot.show()
|
146
|
+
|
147
|
+
"""**Histogram and Density Plots**
|
148
|
+
|
149
|
+
Another important visualization is of the distribution of observations themselves. This means a
|
150
|
+
plot of the values without the temporal ordering. Some linear time series forecasting methods
|
151
|
+
assume a well-behaved distribution of observations (i.e. a bell curve or normal distribution).
|
152
|
+
This can be explicitly checked using tools like statistical hypothesis tests. But plots can provide
|
153
|
+
a useful first check of the distribution of observations both on raw observations and after any
|
154
|
+
type of data transform has been performed.
|
155
|
+
The example below creates a histogram plot of the observations in the Minimum Daily
|
156
|
+
Temperatures dataset. A histogram groups values into bins, and the frequency or count of
|
157
|
+
observations in each bin can provide insight into the underlying distribution of the observations. Histograms and density plots provide insight into the distribution of all observations, but we
|
158
|
+
may be interested in the distribution of values by time interval.
|
159
|
+
"""
|
160
|
+
|
161
|
+
series.hist()
|
162
|
+
pyplot.show()
|
163
|
+
|
164
|
+
"""Generate Kernel Density Estimate plot using Gaussian kernels."""
|
165
|
+
|
166
|
+
series.plot(kind='kde')
|
167
|
+
pyplot.show()
|
168
|
+
|
169
|
+
years.boxplot()
|
170
|
+
pyplot.show()
|
171
|
+
|
172
|
+
"""**Box and Whisker Plots by Interval**
|
173
|
+
|
174
|
+
Another type of plot that is
|
175
|
+
useful to summarize the distribution of observations is the box and whisker plot. This plot
|
176
|
+
draws a box around the 25th and 75th percentiles of the data that captures the middle 50% of
|
177
|
+
observations. A line is drawn at the 50th percentile (the median) and whiskers are drawn above
|
178
|
+
and below the box to summarize the general extents of the observations. Dots are drawn for
|
179
|
+
outliers outside the whiskers or extents of the data.
|
180
|
+
|
181
|
+
Box and whisker plots can be created and compared for each interval in a time series, such
|
182
|
+
as years, months, or days. Below is an example of grouping the Minimum Daily Temperatures
|
183
|
+
dataset by years, as was done above in the plot example. A box and whisker plot is then created
|
184
|
+
for each year and lined up side-by-side for direct comparison.
|
185
|
+
|
186
|
+
Within an interval,
|
187
|
+
it can help to spot outliers (dots above or below the whiskers). Across intervals, in this case
|
188
|
+
years, we can look for multiple year trends, seasonality, and other structural information that
|
189
|
+
could be modeled
|
190
|
+
"""
|
191
|
+
|
192
|
+
from pandas import read_csv
|
193
|
+
from pandas import DataFrame
|
194
|
+
from pandas import Grouper
|
195
|
+
from matplotlib import pyplot
|
196
|
+
series = read_csv('daily-min-temperatures.csv', header=0, index_col=0, parse_dates=True)
|
197
|
+
series=series.squeeze()
|
198
|
+
groups = series.groupby(Grouper(freq='A'))
|
199
|
+
years = DataFrame()
|
200
|
+
for name, group in groups:
|
201
|
+
years[name.year] = group.values
|
202
|
+
years.boxplot()
|
203
|
+
pyplot.show()
|
204
|
+
|
205
|
+
"""**Heat Maps**
|
206
|
+
A matrix of numbers can be plotted as a surface, where the values in each cell of the matrix are
|
207
|
+
assigned a unique color. This is called a heatmap, as larger values can be drawn with warmer
|
208
|
+
colors (yellows and reds) and smaller values can be drawn with cooler colors (blues and greens).
|
209
|
+
Like the box and whisker plots, we can compare observations between intervals using a heat
|
210
|
+
map.
|
211
|
+
In the case of the Minimum Daily Temperatures, the observations can be arranged into a
|
212
|
+
matrix of year-columns and day-rows, with minimum temperature in the cell for each day. A
|
213
|
+
heat map of this matrix can then be plotted. Below is an example of creating a heatmap of
|
214
|
+
the Minimum Daily Temperatures data. The matshow() function from the Matplotlib library
|
215
|
+
is used as no heatmap support is provided directly in Pandas. For convenience, the matrix is rotated (transposed) so that each row represents one year and each column one day. This
|
216
|
+
provides a more intuitive, left-to-right layout of the data.
|
217
|
+
|
218
|
+
"""
|
219
|
+
|
220
|
+
from pandas import read_csv
|
221
|
+
from pandas import DataFrame
|
222
|
+
from pandas import Grouper
|
223
|
+
from matplotlib import pyplot
|
224
|
+
series = read_csv('daily-min-temperatures.csv', header=0, index_col=0, parse_dates=True)
|
225
|
+
series=series.squeeze()
|
226
|
+
groups = series.groupby(Grouper(freq='A'))
|
227
|
+
years = DataFrame()
|
228
|
+
for name, group in groups:
|
229
|
+
years[name.year] = group.values
|
230
|
+
years = years.T
|
231
|
+
print(years)
|
232
|
+
pyplot.matshow(years, interpolation=None, aspect='auto')
|
233
|
+
pyplot.show()
|
234
|
+
|
235
|
+
"""The plot shows the cooler minimum temperatures in the middle days of the years and
|
236
|
+
the warmer minimum temperatures in the start and ends of the years, and all the fading and
|
237
|
+
complexity in between.
|
238
|
+
|
239
|
+
**Lag Scatter Plots**
|
240
|
+
Time series modeling assumes a relationship between an observation and the previous observation.
|
241
|
+
Previous observations in a time series are called lags, with the observation at the previous timestep called lag=1, the observation at two time steps ago lag=2, and so on. A useful type of plot
|
242
|
+
to explore the relationship between each observation and a lag of that observation is called the
|
243
|
+
scatter plot. Pandas has a built-in function for exactly this called the lag plot. It plots the
|
244
|
+
observation at time t on the x-axis and the observation at the next time step (t+1) on the
|
245
|
+
y-axis.
|
246
|
+
|
247
|
+
If the points cluster along a diagonal line from the bottom-left to the top-right of the plot,
|
248
|
+
it suggests a positive correlation relationship.
|
249
|
+
If the points cluster along a diagonal line from the top-left to the bottom-right, it suggests
|
250
|
+
a negative correlation relationship.
|
251
|
+
Either relationship is good as they can be modeled.
|
252
|
+
|
253
|
+
More points tighter in to the diagonal line suggests a stronger relationship and more spread
|
254
|
+
from the line suggests a weaker relationship. A ball in the middle or a spread across the plot
|
255
|
+
suggests a weak or no relationship.
|
256
|
+
"""
|
257
|
+
|
258
|
+
from pandas.plotting import lag_plot
|
259
|
+
lag_plot(series)
|
260
|
+
pyplot.show()
|
261
|
+
|
262
|
+
"""The plot created from running the example shows a relatively strong positive correlation
|
263
|
+
between observations and their lag1 values
|
264
|
+
|
265
|
+
**Autocorrelation Plots**
|
266
|
+
We can quantify the strength and type of relationship between observations and their lags. In
|
267
|
+
statistics, this is called correlation, and when calculated against lag values in time series, it is
|
268
|
+
called autocorrelation (self-correlation). A correlation value calculated between two groups of
|
269
|
+
numbers, such as observations and their lag=1 values, results in a number between -1 and 1.
|
270
|
+
The sign of this number indicates a negative or positive correlation respectively. A value close to
|
271
|
+
zero suggests a weak correlation, whereas a value closer to -1 or 1 indicates a strong correlation.
|
272
|
+
Correlation values, called correlation coefficients, can be calculated for each observation and
|
273
|
+
different lag values. Once calculated, a plot can be created to help better understand how this
|
274
|
+
relationship changes over the lag. This type of plot is called an autocorrelation plot and Pandas provides this capability built in, called the autocorrelation plot() function.
|
275
|
+
"""
|
276
|
+
|
277
|
+
from pandas.plotting import autocorrelation_plot
|
278
|
+
autocorrelation_plot(series)
|
279
|
+
pyplot.show()
|
280
|
+
|
281
|
+
"""The resulting plot shows lag along the x-axis and the correlation on the y-axis. Dotted lines
|
282
|
+
are provided that indicate any correlation values above those lines are statistically significant
|
283
|
+
(meaningful). We can see that for the Minimum Daily Temperatures dataset we see cycles of
|
284
|
+
strong negative and positive correlation. This captures the relationship of an observation with
|
285
|
+
past observations in the same and opposite seasons or times of year. Sine waves like those seen
|
286
|
+
in this example are a strong sign of seasonality in the dataset
|
287
|
+
"""
|
@@ -0,0 +1,121 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
"""TSA_Practical No 2.ipynb
|
3
|
+
|
4
|
+
Automatically generated by Colab.
|
5
|
+
|
6
|
+
Original file is located at
|
7
|
+
https://colab.research.google.com/drive/1X2scZpqK4F_dqV8QohehZCIZswnttekq
|
8
|
+
|
9
|
+
**Practical No 2**
|
10
|
+
**Aim: Implementing timeseries components**
|
11
|
+
1. Seasonality
|
12
|
+
2. Trend
|
13
|
+
3. Pattern
|
14
|
+
4. Cyclic
|
15
|
+
|
16
|
+
**random.normal(loc=0.0, scale=1.0, size=None)**
|
17
|
+
|
18
|
+
Draw random samples from a normal (Gaussian) distribution.
|
19
|
+
|
20
|
+
**Parameters:**
|
21
|
+
loc: float or array_like of floats
|
22
|
+
Mean (“centre”) of the distribution.
|
23
|
+
|
24
|
+
scale: float or array_like of floats
|
25
|
+
Standard deviation (spread or “width”) of the distribution. Must be non-negative.
|
26
|
+
|
27
|
+
size: int or tuple of ints, optional
|
28
|
+
Output shape.
|
29
|
+
"""
|
30
|
+
|
31
|
+
import numpy as np
|
32
|
+
import matplotlib.pyplot as plt
|
33
|
+
|
34
|
+
# Upward Trend
|
35
|
+
t = np.arange(0, 10, 0.1)
|
36
|
+
data = t + np.random.normal(0, 0.5, len(t))
|
37
|
+
plt.plot(t, data, label='Upward Trend')
|
38
|
+
|
39
|
+
# Downward Trend
|
40
|
+
t = np.arange(0, 10, 0.1)
|
41
|
+
data = -t + np.random.normal(0, 0.5, len(t))
|
42
|
+
plt.plot(t, data, label='Downward Trend')
|
43
|
+
|
44
|
+
# Horizontal Trend
|
45
|
+
t = np.arange(0, 10, 0.1)
|
46
|
+
data = np.zeros(len(t)) + np.random.normal(0, 0.5, len(t))
|
47
|
+
plt.plot(t, data, label='Horizontal Trend')
|
48
|
+
|
49
|
+
# Non-linear Trend
|
50
|
+
t = np.arange(0, 10, 0.1)
|
51
|
+
data = t**2 + np.random.normal(0, 0.5, len(t))
|
52
|
+
plt.plot(t, data, label='Non-linear Trend')
|
53
|
+
|
54
|
+
plt.legend()
|
55
|
+
plt.show()
|
56
|
+
|
57
|
+
import numpy as np
|
58
|
+
import matplotlib.pyplot as plt
|
59
|
+
|
60
|
+
# generate sample data with different types of seasonality
|
61
|
+
np.random.seed(1)
|
62
|
+
time = np.arange(0, 366)
|
63
|
+
|
64
|
+
# weekly seasonality
|
65
|
+
weekly_seasonality = np.sin(2 * np.pi * time / 7)
|
66
|
+
weekly_data = 5 + weekly_seasonality
|
67
|
+
|
68
|
+
# monthly seasonality
|
69
|
+
monthly_seasonality = np.sin(2 * np.pi * time / 30)
|
70
|
+
monthly_data = 5 + monthly_seasonality
|
71
|
+
|
72
|
+
# annual seasonality
|
73
|
+
annual_seasonality = np.sin(2 * np.pi * time / 365)
|
74
|
+
annual_data = 5 + annual_seasonality
|
75
|
+
|
76
|
+
# plot the data
|
77
|
+
plt.figure(figsize=(12, 8))
|
78
|
+
plt.plot(time, weekly_data,label='Weekly Seasonality')
|
79
|
+
plt.plot(time, monthly_data,label='Monthly Seasonality')
|
80
|
+
plt.plot(time, annual_data,label='Annual Seasonality')
|
81
|
+
plt.legend(loc='upper left')
|
82
|
+
plt.show()
|
83
|
+
|
84
|
+
import numpy as np
|
85
|
+
import matplotlib.pyplot as plt
|
86
|
+
|
87
|
+
# Generate sample data with cyclic patterns
|
88
|
+
np.random.seed(1)
|
89
|
+
time = np.array([0, 30, 60, 90, 120,
|
90
|
+
150, 180, 210, 240,
|
91
|
+
270, 300, 330])
|
92
|
+
data = 10 * np.sin(2 * np.pi * time / 50) + 20 * np.sin(2 * np.pi * time / 100)
|
93
|
+
|
94
|
+
# Plot the data
|
95
|
+
plt.figure(figsize=(12, 8))
|
96
|
+
plt.plot(time, data, label='Cyclic Data')
|
97
|
+
plt.legend(loc='upper left')
|
98
|
+
plt.xlabel('Time (days)')
|
99
|
+
plt.ylabel('Value')
|
100
|
+
plt.title('Cyclic Time Series Data')
|
101
|
+
plt.show()
|
102
|
+
|
103
|
+
import numpy as np
|
104
|
+
import matplotlib.pyplot as plt
|
105
|
+
|
106
|
+
# Generate sample time series data
|
107
|
+
np.random.seed(1)
|
108
|
+
time = np.arange(0, 100)
|
109
|
+
#data = 5 * np.sin(2 * np.pi * time / 20) + 2 * time
|
110
|
+
data=np.sin(2 * np.pi * time / 30)+time
|
111
|
+
|
112
|
+
# Introduce irregularities by adding random noise
|
113
|
+
irregularities = np.random.normal(0, 5, len(data))
|
114
|
+
irregular_data = data + irregularities
|
115
|
+
|
116
|
+
# Plot the original data and the data with irregularities
|
117
|
+
plt.figure(figsize=(12, 8))
|
118
|
+
plt.plot(time, data, label='Original Data')
|
119
|
+
plt.plot(time, irregular_data,label='Data with Irregularities')
|
120
|
+
plt.legend(loc='upper left')
|
121
|
+
plt.show()
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: myawesomepkg
|
3
|
+
Version: 0.1.4
|
4
|
+
Summary: A simple greeting library
|
5
|
+
Author: Your Name
|
6
|
+
Author-email: your.email@example.com
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
9
|
+
Classifier: Operating System :: OS Independent
|
10
|
+
Requires-Python: >=3.6
|
11
|
+
Description-Content-Type: text/markdown
|
12
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
myawesomepkg/__init__.py,sha256=gNi6noitr9U8Cfc2UcldtL4tyZk6QHS6MU8OKJOElCA,29
|
2
|
+
myawesomepkg/core.py,sha256=BrAMNx-AdBpoqCAJ_In7Z5ZJC3AZaseEg79JUzs16gs,52
|
3
|
+
myawesomepkg/TSAPY1/Practical No 1.py,sha256=gqBPwTi8BuG3D1CnFAzjPeyey5iEhDryoYWq1Wxc218,3140
|
4
|
+
myawesomepkg/TSAPY1/Practical No 2.py,sha256=MF4a-5P_YX86uRPQPYhq3XxbBDJihFkuljAV2wN4qPc,2897
|
5
|
+
myawesomepkg/TSAPY1/Practical No 3.py,sha256=x9mKHk0r9F_08geny0DsWU8VZqLDr0RjhxqAaAEaJuM,4994
|
6
|
+
myawesomepkg/TSAPY1/Practical No 4 A.py,sha256=Mhdni1p1TPNSrK4SebO4vomVpJogmydFIsxKaMNAxwE,5575
|
7
|
+
myawesomepkg/TSAPY1/Practical No 4 B.py,sha256=Nm9IDkRsyZkHzTNgkbaQjGX36kQyMqF6KPSxlIA7bho,2211
|
8
|
+
myawesomepkg/TSAPY1/Practical No 5.py,sha256=UKIMzwpI2AAgQ7AdsGCMk1yjUSHna9fAx-rR-kI6N8k,1211
|
9
|
+
myawesomepkg/TSAPY1/Practical No 6.py,sha256=SR3Z_D83Mj6xZu1_6aMWrLDBebcvLaJl4vWXHw2lTx0,1061
|
10
|
+
myawesomepkg/TSAPY1/Practical No 7.py,sha256=oOokK-GegBum3v884JtbgBjqZJRKCngOuo2u7qopz1Q,2060
|
11
|
+
myawesomepkg/TSAPY1/Practical No 8.py,sha256=Qmm--XEXDrsOi8z7NyfwU-2ubjXkYvxf_L--Z7CMjIA,2070
|
12
|
+
myawesomepkg/TSAPY1/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
|
+
myawesomepkg/TSAPY1/practical_no_3.py,sha256=UL3Q7uG9C8E8vqj3Oz2ZPeqeQsqFkbhZj5PIHNZPXj0,5772
|
14
|
+
myawesomepkg/TSAPY1/practical_no_4.py,sha256=d-eLgQqIOVbJppMa_G26TybLV7XKN945KgAwFGAzHGc,6688
|
15
|
+
myawesomepkg/TSAPY1/practical_no_4b.py,sha256=3b4FcycuTR-hBgYSdTII1C8fM80NRiXImW5aMIa08TI,2078
|
16
|
+
myawesomepkg/TSAPY1/practical_no_5_ac_and_pca.py,sha256=yGV47-sRLODerprs3Jz9dyppfiFE6jo0aml5Qvk3swg,1305
|
17
|
+
myawesomepkg/TSAPY1/practical_no_6.py,sha256=LdkeIQzDqbFMkxZzvlvDDIqKcT8jERm0rrDboQk3QWI,1229
|
18
|
+
myawesomepkg/TSAPY1/practical_no_7.py,sha256=2QPJ2jBVxW2UHe1tq-ftoyBmv3uUxuGVmXEXe6e7Wi0,2175
|
19
|
+
myawesomepkg/TSAPY1/practical_no_8.py,sha256=oVL2pA30SXkVoRZrp7iAwIzJFc-fvlXw5FZXjnxvPDs,2096
|
20
|
+
myawesomepkg/TSAPY1/tsa_practical_no_1.py,sha256=70woXKISzeKysib6pWmvUbGUpGec7E2cFpfdwXxenZM,12517
|
21
|
+
myawesomepkg/TSAPY1/tsa_practical_no_2.py,sha256=ebS05HTVVuJHn92-wNzaU_wgADq6UTY2dsgZ9I736FQ,3167
|
22
|
+
myawesomepkg-0.1.4.dist-info/METADATA,sha256=KGO_AcGa3q3BfLIcNVY-LaWawIQWqoK6qHwhnrfjKvE,368
|
23
|
+
myawesomepkg-0.1.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
24
|
+
myawesomepkg-0.1.4.dist-info/top_level.txt,sha256=Pngzshta5k3nST58NluFg5L7yoZth2MPR0huoroI7ao,13
|
25
|
+
myawesomepkg-0.1.4.dist-info/RECORD,,
|
myawesomepkg/d.py
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
import math
|
2
|
-
n=int(input("Enter no of input neurons:"))
|
3
|
-
|
4
|
-
print("enter input")
|
5
|
-
inputs=[]
|
6
|
-
|
7
|
-
for i in range(0,n):
|
8
|
-
x=float(input())
|
9
|
-
inputs.append(x)
|
10
|
-
print(inputs)
|
11
|
-
|
12
|
-
print("enter weight")
|
13
|
-
weights=[]
|
14
|
-
|
15
|
-
for i in range(0,n):
|
16
|
-
w=float(input())
|
17
|
-
weights.append(w)
|
18
|
-
print(weights)
|
19
|
-
|
20
|
-
print(" the net input is calculated as Yin=x1w1+x2w2+x3w3")
|
21
|
-
|
22
|
-
Yin=[]
|
23
|
-
for i in range(0,n):
|
24
|
-
Yin.append(inputs[i]*weights[i])
|
25
|
-
ynet=round(sum(Yin),3)
|
26
|
-
|
27
|
-
print("net input for y neuron",ynet)
|
28
|
-
|
29
|
-
print("apply activation function over net input, Binary function")
|
30
|
-
|
31
|
-
y=round(1/(1+math.exp(-ynet)),3)
|
32
|
-
print(y)
|
33
|
-
|
34
|
-
print("apply activation function over net input, Bipolar function")
|
35
|
-
y=round((2/(1+math.exp(-ynet)))-1,3)
|
36
|
-
print(y)
|
@@ -1,7 +0,0 @@
|
|
1
|
-
myawesomepkg/__init__.py,sha256=gNi6noitr9U8Cfc2UcldtL4tyZk6QHS6MU8OKJOElCA,29
|
2
|
-
myawesomepkg/core.py,sha256=BrAMNx-AdBpoqCAJ_In7Z5ZJC3AZaseEg79JUzs16gs,52
|
3
|
-
myawesomepkg/d.py,sha256=9MYJrjyoIJxsjdkXwUNzEbTHIVTyYd8M9OsBJ4bLRXE,729
|
4
|
-
myawesomepkg-0.1.2.dist-info/METADATA,sha256=DB4TiUNmfQyWXgRIUD9uKr0b2wAvYfZvyB8bzDNnmzY,140
|
5
|
-
myawesomepkg-0.1.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
6
|
-
myawesomepkg-0.1.2.dist-info/top_level.txt,sha256=Pngzshta5k3nST58NluFg5L7yoZth2MPR0huoroI7ao,13
|
7
|
-
myawesomepkg-0.1.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|