Intern Saro
Intern Saro
THENI-625 582
Affliated to Anna University,Chennai
Submitted by
Name: SARAVANAN S J
Register number:923321104043
1
ACKNOWLEDGEMENT
I express my deepest thanks to the TVS Training and Service members for
taking part in useful decision and giving necessary advices, guidance and arranged
all facilities to make things easier.
2
CONTENTS
Acknowledgement
Chapter 5: Conclusion
Chapter 6: Gallery
3
CHAPTER 1
COMPANY PROFILE
TVS Training and Services Ltd is a TVS group company that was
established in 2010, in Chennai. TVS TS offers training in various domains from
automotive and engineering to finance and retail. We train and facilitate
employment to unemployed youth across the country.
TVS TS offers more than 250 courses in various domains. Our courses are
generally designed at 3 levels viz. Basic, Intermediary and Advanced, to suit
different levels of audience such as entry, supervisory and managerial. The short
term courses range from 1 to 5 days of duration, while the longer duration
programs range from 6 to 90 days based on the customer needs.
VISION
To be an exemplary training organization that is committed to developing
skills and competencies in individuals to meet global standards of excellence
across multiple domains.
To impart multi-skill training to unemployed youth across India that will
open doors to a wide range of employment opportunities and ensure
professional advancement.
MISSION
To provide high quality training in knowledge, skills and social
competencies across domains in a wide range of processes and systems to
diverse clients/ individuals and businesses.
To develop custom training programs designed and continually improved, to
meet each client’s unique requirements and solve specific problems.
4
TVS TS offer various services through its 6 business divisions.
B2B |Business to Business.
B2E |Business to Education.
B2G |Business to Government
BFSI |Business to Banking, Financial Services & Insurance Companies.
STAFFING |Contracted employment on TVS TS rolls.
NAPS |National Apprenticeship Promotion Scheme.
Training Centers
TVS TS is one of the largest training partner of,
NSDC (National Skill Development Corporation) &
TNSDC (Tamil Nadu Skill Development Corporation)
NSDC & TNSDC creates opportunity to train students from rural areas and
facilitate with employment opportunity through TVS TS
5
CHAPTER 2
Python:
Python is a popular programming language. It was created by Guido van
Rossum, and released in 1991.
It is used for:
Uses of Python:
Python Indentation
6
Example:
if 5 > 2:
Python Comments
Comments can be used to explain Python code.
Creating a Comment:
Example:
#This is a comment
print("Hello, World!")
Variables
Variables are containers for storing data values.
Creating Variables
Python has no command for declaring a variable.
A variable is created the moment you first assign a value to it.
Example:
x=5
y = "John"
print(x)
print(y)
7
2.2: DATA TYPES
You can get the data type of any object by using the type() function:
Example:
x=5
print(type(x))
There may be times when you want to specify a type on to a variable. This
can be done with casting. Python is an object-orientated language, and as such it
uses classes to define data types, including its primitive types.
8
int() - constructs an integer number from an integer literal, a float literal (by
removing all decimals), or a string literal (providing the string represents a
whole number)
float() - constructs a float number from an integer literal, a float literal or a
string literal (providing the string represents a float or an integer)
str() - constructs a string from a wide variety of data types, including strings,
integer literals and float literals
Example:
x = int(1) # x will be 1
Control Flow
Python Conditions and If statements:
Python supports the usual logical conditions from mathematics:
Equals: a == b
Not Equals: a != b
Less than: a < b
Less than or equal to: a <= b
Greater than: a > b
Greater than or equal to: a >= b
These conditions can be used in several ways, most commonly in "if statements"
and loops.
Example:
a = 33
b = 200
if b > a:
print("b is greater than a")
9
In this example we use two variables, a and b, which are used as part of the if
statement to test whether b is greater than a. As a is 33, and b is 200, we know that
200 is greater than 33, and so we print to screen that "b is greater than a".
Elif:
The elif keyword is Python's way of saying "if the previous conditions were not
true, then try this condition".
Example:
a = 33
b = 33
if b > a:
print("b is greater than a")
elif a == b:
print("a and b are equal")
Else:
The else keyword catches anything which isn't caught by the preceding conditions.
Example:
a = 200
b = 33
if b > a:
print("b is greater than a")
elif a == b:
print("a and b are equal")
else:
print("a is greater than b")
Nested If:
You can have if statements inside if statements, this is called nested if statements.
Example:
x = 41
if x > 10:
print("Above ten,")
10
if x > 20:
print("and also above 20!")
else:
print("but not above 20.")
Python Loops
while loops
for loops
With the while loop we can execute a set of statements as long as a condition
is true.
Example:
i=1
while i < 6:
print(i)
i += 1
The break Statement
With the break statement we can stop the loop even if the while condition is
true:
Example:
i=1
while i < 6:
print(i)
if i == 3:
break
i += 1
11
The continue Statement
With the continue statement we can stop the current iteration, and continue
with the next:
Example:
i=0
while i < 6:
i += 1
if i == 3:
continue
print(i)
Python For Loops
A for loop is used for iterating over a sequence (that is either a list, a tuple, a
dictionary, a set, or a string).
This is less like the for keyword in other programming languages, and works
more like an iterator method as found in other object-orientated programming
languages.
With the for loop we can execute a set of statements, once for each item in a
list, tuple, set etc.
Example:
Print a fruits in a list
fruits = ["apple", "banana", "cherry"]
for x in fruits:
print(x)
Looping through the string
It will return a sequence of characters
for x in "banana":
print(x)
12
Functions
Example:
def my_function():
print("Hello from a function")
Calling a Function
Example:
def my_function():
print("Hello from a function")
my_function()
Arguments
Arguments are specified after the function name, inside the parentheses. You
can add as many arguments as you want, just separate them with a comma.
The following example has a function with one argument (fname). When the
function is called, we pass along a first name, which is used inside the function to
print the full name:
Example:
def my_function(fname):
print(fname + " Refsnes")
my_function("Emil")
13
my_function("Tobias")
my_function("Linus")
Number of Arguments
Example:
my_function("Emil", "Refsnes")
If you try to call the function with 1 or 3 arguments, you will get an error.
Keyword Arguments
You can also send arguments with the key = value syntax.
Example:
Example:
14
my_function("Sweden")
my_function("India")
my_function()
You can send any data types of argument to a function (string, number, list,
dictionary etc.), and it will be treated as the same data type inside the function.
E.g. if you send a List as an argument, it will still be a List when it reaches
the function:
Example:
def my_function(food):
for x in food:
print(x)
my_function(fruits)
Return Values
Example:
def my_function(x):
return 5 * x
print(my_function(3))
15
Strings
Example:
a = "Hello"
print(a)
Multiline Strings
Example:
However, Python does not have a character data type, a single character is
simply a string with a length of 1.
Example:
a = "Hello, World!"
print(a[1])
16
String Length
Example:
a = "Hello, World!"
print(len(a))
Check String
Example:
String Methods:
index() Searches the string for a specified value and returns the position
of where it was found
isalpha() Returns True if all characters in the string are in the alphabet
isascii() Returns True if all characters in the string are ascii characters
17
2.4: LIST, TUPLES , DICTIONARIES:
List:
Lists are one of 4 built-in data types in Python used to store collections of
data, the other 3 are Tuple, Set, and Dictionary, all with different qualities and
usage.
List Items
List items are indexed, the first item has index [0], the second item has
index [1] etc.
Example:
List Methods
Python has a set of built-in methods that you can use on lists.
Method Description
18
clear() Removes all the elements from the list
index() Returns the index of the first element with the value
Tuple:
Example:
#Creating a tuple
19
Tuple items are indexed, the first item has index [0], the second item has
index [1] etc.
Example:
Tuple Methods
Python has two built-in methods that you can use on tuples.
Method Description
index() Searches the tuple for a specified value and returns the position
of where it was found
Set:
Set is one of 4 built-in data types in Python used to store collections of data,
the other 3 are List, Tuple, and Dictionary, all with different qualities and usage.
Note: Set items are unchangeable, but you can remove items and add new
items.
Example:
20
thisset = {"apple", "banana", "cherry"}
print(thisset)
Set Items
Set items are unordered, unchangeable, and do not allow duplicate values.
Example:
print(thisset)
Set Methods
Python has a set of built-in methods that you can use on sets.
Method Description
21
Dictionary
Dictionaries are written with curly brackets, and have keys and values:
Example:
thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
print(thisdict)
Dictionary Items
Example:
thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964,
"year": 2020
}
print(thisdict)
22
Dictionary Methods
Python has a set of built-in methods that you can use on dictionaries.
Method Description
items() Returns a list containing a tuple for each key value pair
Python Class
Class syntax
class ClassName:
# Statement-1
# Statement-N
23
Python Objects
Example:
class Dog:
attr1 = "mammal"
self.name = name
Rodger = Dog("Rodger")
Tommy = Dog("Tommy")
print("Rodger is a {}".format(Rodger.__class__.attr1))
Output
Rodger is a mammal
My name is Rodger
24
CHAPTER 3
MACHINE LEARNING
Machine Learning:
Numpy:
25
NumPy was created in 2005 by Travis Oliphant. It is an open source project
and you can use it freely.
import numpy as np
print(arr)
print(type(arr))
Pandas:
The name "Pandas" has a reference to both "Panel Data", and "Python Data
Analysis" and was created by Wes McKinney in 2008.
Series:
Import pandas as pd
a = [1, 7, 2]
myvar = pd.Series(a)
26
print(myvar)
Dataframe:
import pandas as pd
data = {
"calories": [420, 380, 390],
"duration": [50, 40, 45]
}
print(df)
Read CSV Files
A simple way to store big data sets is to use CSV files (comma separated
files).
CSV files contains plain text and is a well know format that can be read by
everyone including Pandas.
import pandas as pd
df = pd.read_csv('data.csv')
print(df.head())
Seaborn:
Seaborn is a powerful Python visualization library built on top of
Matplotlib.
27
It provides a high-level interface for drawing attractive and informative
statistical graphics.
Example:
sns.distplot([0, 1, 2, 3, 4, 5])
plt.show()
Key Concepts:
Labeled Data: The training dataset consists of input-output pairs, where each
input is associated with a correct output label. For example, in a housing price
prediction task, features might include the size and location of a house, and the
label would be its price.
Training Phase: During training, the model learns to identify patterns and
relationships between the features and the labels. The algorithm adjusts its
parameters to minimize the difference between its predictions and the actual labels.
28
Regression: Predicting a continuous value. For instance, estimating the price
of a car based on its features.
Common Algorithms:
Applications:
Supervised learning is widely used in various applications, including:
29
Key Concepts:
1. Unlabeled Data: The training dataset consists solely of input data without
corresponding output labels. The model must learn from the data itself.
2. Goal: The main objectives of unsupervised learning are to explore the data,
identify groupings or patterns, and reduce dimensionality.
3. Common Techniques:
o Clustering: Grouping similar data points together based on their
features. For example, customer segmentation in marketing.
Algorithms: K-Means, Hierarchical Clustering, DBSCAN.
o Dimensionality Reduction: Reducing the number of features in the
dataset while preserving important information. This helps visualize
high-dimensional data and reduce noise.
Algorithms: Principal Component Analysis (PCA), t-
Distributed Stochastic Neighbor Embedding (t-SNE),
Autoencoders.
30
CHAPTER 4
FINAL PROJECT
PROGRAM:
import numpy as np
31
print(q_table)
# Define hyperparameters
learning_rate = 0.1
discount_factor = 0.9
episodes = 1000
rewards = {
('Controlled', 'Exercise'): 7,
('Uncontrolled', 'Exercise'): 1
32
if state == 'Controlled':
return 'Controlled'
else:
return 'Uncontrolled'
return 'Controlled'
else:
return 'Uncontrolled'
else:
state_index = states.index(state)
def train_algorithm(algorithm):
33
global q_table # Use the global q_table variable
if algorithm == 'q_learning':
done = False
if algorithm == 'q_learning':
next_state_index = states.index(next_state)
best_next_action = np.argmax(q_table[next_state_index])
34
)
next_state_index = states.index(next_state)
next_action_index = actions.index(next_action)
state = next_state
steps += 1
35
# print(f"Breaking out of loop to avoid infinite loop after {steps} steps.")
done = True
done = True
while True:
train_algorithm(algorithm)
print("Learned Q-table:")
36
print(q_table)
def suggest_treatment(current_state):
state_index = states.index(current_state)
action_index = np.argmax(q_table[state_index])
return actions[action_index]
suggested_treatment = suggest_treatment(patient_state)
if continue_choice != 'yes':
break
OUTPUT:
[[0. 0. 0. 0.]
[0. 0. 0. 0.]]
37
Enter the algorithm you want to use ('q_learning' or
'sarsa'): q_learning
Learned Q-table:
Learned Q-table:
38
Enter the algorithm you want to use ('q_learning' or
'sarsa'): q_learning
Learned Q-table:
Learned Q-table:
39
Do you want to continue with another algorithm?
(yes/no): no
CHAPTER 5
CONCLUSION
40
CHAPTER 6
GALLERY
41